File: llvm-string_02-c37e098.stdout

package info (click to toggle)
lfortran 0.60.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,412 kB
  • sloc: cpp: 173,406; f90: 80,491; python: 17,586; ansic: 9,610; yacc: 2,356; sh: 1,401; fortran: 895; makefile: 37; javascript: 15
file content (177 lines) | stat: -rw-r--r-- 10,012 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
; ModuleID = 'LFortran'
source_filename = "LFortran"

%string_descriptor = type <{ i8*, i64 }>

@string_const_data = private constant [4 x i8] c"Mr. "
@string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }>
@string_const_data.1 = private constant [6 x i8] c"Rowan "
@string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([6 x i8], [6 x i8]* @string_const_data.1, i32 0, i32 0), i64 6 }>
@string_const_data.3 = private constant [8 x i8] c"Atkinson"
@string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.3, i32 0, i32 0), i64 8 }>
@string_const_data.5 = private constant [25 x i8] c"A big hello from Mr. Bean"
@string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([25 x i8], [25 x i8]* @string_const_data.5, i32 0, i32 0), i64 25 }>
@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [38 x i8] c"S-DESC-8,S-DESC-6,S-DESC-15,S-DESC-15\00", align 1
@string_const_data.7 = private constant [8 x i8] c"Here is "
@string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.7, i32 0, i32 0), i64 8 }>
@1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define i32 @main(i32 %0, i8** %1) {
.entry:
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %firstname = alloca %string_descriptor, align 8
  store %string_descriptor zeroinitializer, %string_descriptor* %firstname, align 1
  %2 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 1
  store i64 15, i64* %2, align 4
  %3 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0
  %4 = call i8* @_lfortran_malloc(i64 15)
  store i8* %4, i8** %3, align 8
  %greetings = alloca %string_descriptor, align 8
  store %string_descriptor zeroinitializer, %string_descriptor* %greetings, align 1
  %5 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 1
  store i64 25, i64* %5, align 4
  %6 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0
  %7 = call i8* @_lfortran_malloc(i64 25)
  store i8* %7, i8** %6, align 8
  %surname = alloca %string_descriptor, align 8
  store %string_descriptor zeroinitializer, %string_descriptor* %surname, align 1
  %8 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 1
  store i64 15, i64* %8, align 4
  %9 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0
  %10 = call i8* @_lfortran_malloc(i64 15)
  store i8* %10, i8** %9, align 8
  %title = alloca %string_descriptor, align 8
  store %string_descriptor zeroinitializer, %string_descriptor* %title, align 1
  %11 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1
  store i64 6, i64* %11, align 4
  %12 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0
  %13 = call i8* @_lfortran_malloc(i64 6)
  store i8* %13, i8** %12, align 8
  %14 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0
  %15 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1
  %16 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8
  call void @_lfortran_strcpy(i8** %14, i64* %15, i8 0, i8 0, i8* %16, i64 4)
  %17 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0
  %18 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 1
  %19 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8
  call void @_lfortran_strcpy(i8** %17, i64* %18, i8 0, i8 0, i8* %19, i64 6)
  %20 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0
  %21 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 1
  %22 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8
  call void @_lfortran_strcpy(i8** %20, i64* %21, i8 0, i8 0, i8* %22, i64 8)
  %23 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0
  %24 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 1
  %25 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8
  call void @_lfortran_strcpy(i8** %23, i64* %24, i8 0, i8 0, i8* %25, i64 25)
  %26 = alloca i64, align 8
  %27 = load %string_descriptor, %string_descriptor* %title, align 1
  %28 = alloca %string_descriptor, align 8
  store %string_descriptor %27, %string_descriptor* %28, align 1
  %29 = load %string_descriptor, %string_descriptor* %firstname, align 1
  %30 = alloca %string_descriptor, align 8
  store %string_descriptor %29, %string_descriptor* %30, align 1
  %31 = load %string_descriptor, %string_descriptor* %surname, align 1
  %32 = alloca %string_descriptor, align 8
  store %string_descriptor %31, %string_descriptor* %32, align 1
  %33 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @serialization_info, i32 0, i32 0), i64* %26, i32 0, i32 0, %string_descriptor* @string_const.8, %string_descriptor* %28, %string_descriptor* %30, %string_descriptor* %32)
  %34 = load i64, i64* %26, align 4
  %stringFormat_desc = alloca %string_descriptor, align 8
  %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  store i8* %33, i8** %35, align 8
  %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  store i64 %34, i64* %36, align 4
  %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  %38 = load i8*, i8** %37, align 8
  %39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  %40 = load i64, i64* %39, align 4
  %41 = trunc i64 %40 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %38, i32 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
  %42 = icmp eq i8* %33, null
  br i1 %42, label %free_done, label %free_nonnull

free_nonnull:                                     ; preds = %.entry
  call void @_lfortran_free(i8* %33)
  br label %free_done

free_done:                                        ; preds = %free_nonnull, %.entry
  %43 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0
  %44 = load i8*, i8** %43, align 8
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %44, i32 25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
  call void @_lpython_free_argv()
  br label %return

return:                                           ; preds = %free_done
  br label %FINALIZE_SYMTABLE_string_02

FINALIZE_SYMTABLE_string_02:                      ; preds = %return
  br label %Finalize_Variable_firstname

Finalize_Variable_firstname:                      ; preds = %FINALIZE_SYMTABLE_string_02
  %45 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0
  %46 = load i8*, i8** %45, align 8
  %47 = icmp eq i8* %46, null
  br i1 %47, label %free_done2, label %free_nonnull1

free_nonnull1:                                    ; preds = %Finalize_Variable_firstname
  call void @_lfortran_free(i8* %46)
  br label %free_done2

free_done2:                                       ; preds = %free_nonnull1, %Finalize_Variable_firstname
  br label %Finalize_Variable_greetings

Finalize_Variable_greetings:                      ; preds = %free_done2
  %48 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0
  %49 = load i8*, i8** %48, align 8
  %50 = icmp eq i8* %49, null
  br i1 %50, label %free_done4, label %free_nonnull3

free_nonnull3:                                    ; preds = %Finalize_Variable_greetings
  call void @_lfortran_free(i8* %49)
  br label %free_done4

free_done4:                                       ; preds = %free_nonnull3, %Finalize_Variable_greetings
  br label %Finalize_Variable_surname

Finalize_Variable_surname:                        ; preds = %free_done4
  %51 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0
  %52 = load i8*, i8** %51, align 8
  %53 = icmp eq i8* %52, null
  br i1 %53, label %free_done6, label %free_nonnull5

free_nonnull5:                                    ; preds = %Finalize_Variable_surname
  call void @_lfortran_free(i8* %52)
  br label %free_done6

free_done6:                                       ; preds = %free_nonnull5, %Finalize_Variable_surname
  br label %Finalize_Variable_title

Finalize_Variable_title:                          ; preds = %free_done6
  %54 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0
  %55 = load i8*, i8** %54, align 8
  %56 = icmp eq i8* %55, null
  br i1 %56, label %free_done8, label %free_nonnull7

free_nonnull7:                                    ; preds = %Finalize_Variable_title
  call void @_lfortran_free(i8* %55)
  br label %free_done8

free_done8:                                       ; preds = %free_nonnull7, %Finalize_Variable_title
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

declare i8* @_lfortran_malloc(i64)

declare void @_lfortran_strcpy(i8**, i64*, i8, i8, i8*, i64)

declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...)

declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32)

declare void @_lfortran_free(i8*)

declare void @_lpython_free_argv()