Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This file has been truncated, but you can view the full file.
*** IR Dump After Module Verifier ***
; Function Attrs: nounwind uwtable
define internal void @add(%struct.vector3* %v, %struct.vector3* %w) #0 !dbg !4 {
entry:
%v.addr = alloca %struct.vector3*, align 8
%w.addr = alloca %struct.vector3*, align 8
store %struct.vector3* %v, %struct.vector3** %v.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %v.addr, metadata !34, metadata !35), !dbg !36
store %struct.vector3* %w, %struct.vector3** %w.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %w.addr, metadata !37, metadata !35), !dbg !38
%0 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !39
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %0, i32 0, i32 0, !dbg !40
%1 = load i32, i32* %x, align 4, !dbg !40
%2 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !41
%x1 = getelementptr inbounds %struct.vector3, %struct.vector3* %2, i32 0, i32 0, !dbg !42
%3 = load i32, i32* %x1, align 4, !dbg !43
%add = add nsw i32 %3, %1, !dbg !43
store i32 %add, i32* %x1, align 4, !dbg !43
%4 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !44
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i32 0, i32 1, !dbg !45
%5 = load i32, i32* %y, align 4, !dbg !45
%6 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !46
%y2 = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i32 0, i32 1, !dbg !47
%7 = load i32, i32* %y2, align 4, !dbg !48
%add3 = add nsw i32 %7, %5, !dbg !48
store i32 %add3, i32* %y2, align 4, !dbg !48
%8 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !49
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i32 0, i32 2, !dbg !50
%9 = load i32, i32* %z, align 4, !dbg !50
%10 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !51
%z4 = getelementptr inbounds %struct.vector3, %struct.vector3* %10, i32 0, i32 2, !dbg !52
%11 = load i32, i32* %z4, align 4, !dbg !53
%add5 = add nsw i32 %11, %9, !dbg !53
store i32 %add5, i32* %z4, align 4, !dbg !53
ret void, !dbg !54
}
*** IR Dump After Module Verifier ***
; Function Attrs: nounwind uwtable
define internal void @copy(%struct.vector3* %dst, %struct.vector3* %src) #0 !dbg !14 {
entry:
%dst.addr = alloca %struct.vector3*, align 8
%src.addr = alloca %struct.vector3*, align 8
store %struct.vector3* %dst, %struct.vector3** %dst.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %dst.addr, metadata !55, metadata !35), !dbg !56
store %struct.vector3* %src, %struct.vector3** %src.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %src.addr, metadata !57, metadata !35), !dbg !58
%0 = load %struct.vector3*, %struct.vector3** %dst.addr, align 8, !dbg !59
%1 = bitcast %struct.vector3* %0 to i8*, !dbg !60
%2 = load %struct.vector3*, %struct.vector3** %src.addr, align 8, !dbg !61
%3 = bitcast %struct.vector3* %2 to i8*, !dbg !60
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %3, i64 12, i32 4, i1 false), !dbg !60
ret void, !dbg !62
}
*** IR Dump After Module Verifier ***
; Function Attrs: nounwind uwtable
define internal void @swap(%struct.vector3* %a, %struct.vector3* %b) #0 !dbg !15 {
entry:
%a.addr = alloca %struct.vector3*, align 8
%b.addr = alloca %struct.vector3*, align 8
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
store %struct.vector3* %a, %struct.vector3** %a.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %a.addr, metadata !63, metadata !35), !dbg !64
store %struct.vector3* %b, %struct.vector3** %b.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %b.addr, metadata !65, metadata !35), !dbg !66
call void @llvm.dbg.declare(metadata i32* %x, metadata !67, metadata !35), !dbg !68
%0 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !69
%x1 = getelementptr inbounds %struct.vector3, %struct.vector3* %0, i32 0, i32 0, !dbg !70
%1 = load i32, i32* %x1, align 4, !dbg !70
store i32 %1, i32* %x, align 4, !dbg !68
call void @llvm.dbg.declare(metadata i32* %y, metadata !71, metadata !35), !dbg !72
%2 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !73
%y2 = getelementptr inbounds %struct.vector3, %struct.vector3* %2, i32 0, i32 1, !dbg !74
%3 = load i32, i32* %y2, align 4, !dbg !74
store i32 %3, i32* %y, align 4, !dbg !72
call void @llvm.dbg.declare(metadata i32* %z, metadata !75, metadata !35), !dbg !76
%4 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !77
%z3 = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i32 0, i32 2, !dbg !78
%5 = load i32, i32* %z3, align 4, !dbg !78
store i32 %5, i32* %z, align 4, !dbg !76
%6 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !79
%x4 = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i32 0, i32 0, !dbg !80
%7 = load i32, i32* %x4, align 4, !dbg !80
%8 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !81
%x5 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i32 0, i32 0, !dbg !82
store i32 %7, i32* %x5, align 4, !dbg !83
%9 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !84
%y6 = getelementptr inbounds %struct.vector3, %struct.vector3* %9, i32 0, i32 1, !dbg !85
%10 = load i32, i32* %y6, align 4, !dbg !85
%11 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !86
%y7 = getelementptr inbounds %struct.vector3, %struct.vector3* %11, i32 0, i32 1, !dbg !87
store i32 %10, i32* %y7, align 4, !dbg !88
%12 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !89
%z8 = getelementptr inbounds %struct.vector3, %struct.vector3* %12, i32 0, i32 2, !dbg !90
%13 = load i32, i32* %z8, align 4, !dbg !90
%14 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !91
%z9 = getelementptr inbounds %struct.vector3, %struct.vector3* %14, i32 0, i32 2, !dbg !92
store i32 %13, i32* %z9, align 4, !dbg !93
%15 = load i32, i32* %x, align 4, !dbg !94
%16 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !95
%x10 = getelementptr inbounds %struct.vector3, %struct.vector3* %16, i32 0, i32 0, !dbg !96
store i32 %15, i32* %x10, align 4, !dbg !97
%17 = load i32, i32* %y, align 4, !dbg !98
%18 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !99
%y11 = getelementptr inbounds %struct.vector3, %struct.vector3* %18, i32 0, i32 1, !dbg !100
store i32 %17, i32* %y11, align 4, !dbg !101
%19 = load i32, i32* %z, align 4, !dbg !102
%20 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !103
%z12 = getelementptr inbounds %struct.vector3, %struct.vector3* %20, i32 0, i32 2, !dbg !104
store i32 %19, i32* %z12, align 4, !dbg !105
ret void, !dbg !106
}
*** IR Dump After Module Verifier ***
; Function Attrs: nounwind uwtable
define internal void @selection_sort(%struct.vector3* %vs, i32 %N) #0 !dbg !16 {
entry:
%vs.addr = alloca %struct.vector3*, align 8
%N.addr = alloca i32, align 4
%i = alloca i32, align 4
%idx = alloca i32, align 4
store %struct.vector3* %vs, %struct.vector3** %vs.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %vs.addr, metadata !107, metadata !35), !dbg !108
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !109, metadata !35), !dbg !110
call void @llvm.dbg.declare(metadata i32* %i, metadata !111, metadata !35), !dbg !113
store i32 0, i32* %i, align 4, !dbg !113
br label %for.cond, !dbg !114
for.cond: ; preds = %for.inc, %entry
%0 = load i32, i32* %i, align 4, !dbg !115
%1 = load i32, i32* %N.addr, align 4, !dbg !118
%cmp = icmp slt i32 %0, %1, !dbg !119
br i1 %cmp, label %for.body, label %for.end, !dbg !120
for.body: ; preds = %for.cond
call void @llvm.dbg.declare(metadata i32* %idx, metadata !121, metadata !35), !dbg !123
%2 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !124
%3 = load i32, i32* %i, align 4, !dbg !125
%4 = load i32, i32* %N.addr, align 4, !dbg !126
%call = call i32 @get_smallest(%struct.vector3* %2, i32 %3, i32 %4), !dbg !127
store i32 %call, i32* %idx, align 4, !dbg !123
%5 = load i32, i32* %idx, align 4, !dbg !128
%idxprom = sext i32 %5 to i64, !dbg !129
%6 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !129
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i64 %idxprom, !dbg !129
%7 = load i32, i32* %i, align 4, !dbg !130
%idxprom1 = sext i32 %7 to i64, !dbg !131
%8 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !131
%arrayidx2 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i64 %idxprom1, !dbg !131
call void @swap(%struct.vector3* %arrayidx, %struct.vector3* %arrayidx2), !dbg !132
br label %for.inc, !dbg !133
for.inc: ; preds = %for.body
%9 = load i32, i32* %i, align 4, !dbg !134
%inc = add nsw i32 %9, 1, !dbg !134
store i32 %inc, i32* %i, align 4, !dbg !134
br label %for.cond, !dbg !136
for.end: ; preds = %for.cond
ret void, !dbg !137
}
*** IR Dump After Module Verifier ***
; Function Attrs: nounwind uwtable
define internal i32 @get_smallest(%struct.vector3* %vs, i32 %start, i32 %N) #0 !dbg !19 {
entry:
%vs.addr = alloca %struct.vector3*, align 8
%start.addr = alloca i32, align 4
%N.addr = alloca i32, align 4
%smallest = alloca i32, align 4
%idx = alloca i32, align 4
%i = alloca i32, align 4
store %struct.vector3* %vs, %struct.vector3** %vs.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %vs.addr, metadata !138, metadata !35), !dbg !139
store i32 %start, i32* %start.addr, align 4
call void @llvm.dbg.declare(metadata i32* %start.addr, metadata !140, metadata !35), !dbg !141
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !142, metadata !35), !dbg !143
call void @llvm.dbg.declare(metadata i32* %smallest, metadata !144, metadata !35), !dbg !145
%0 = load i32, i32* %start.addr, align 4, !dbg !146
%idxprom = sext i32 %0 to i64, !dbg !147
%1 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !147
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %1, i64 %idxprom, !dbg !147
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx, i32 0, i32 0, !dbg !148
%2 = load i32, i32* %x, align 4, !dbg !148
store i32 %2, i32* %smallest, align 4, !dbg !145
call void @llvm.dbg.declare(metadata i32* %idx, metadata !149, metadata !35), !dbg !150
%3 = load i32, i32* %start.addr, align 4, !dbg !151
store i32 %3, i32* %idx, align 4, !dbg !150
call void @llvm.dbg.declare(metadata i32* %i, metadata !152, metadata !35), !dbg !154
%4 = load i32, i32* %start.addr, align 4, !dbg !155
store i32 %4, i32* %i, align 4, !dbg !154
br label %for.cond, !dbg !156
for.cond: ; preds = %for.inc, %entry
%5 = load i32, i32* %i, align 4, !dbg !157
%6 = load i32, i32* %N.addr, align 4, !dbg !160
%cmp = icmp slt i32 %5, %6, !dbg !161
br i1 %cmp, label %for.body, label %for.end, !dbg !162
for.body: ; preds = %for.cond
%7 = load i32, i32* %i, align 4, !dbg !163
%idxprom1 = sext i32 %7 to i64, !dbg !166
%8 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !166
%arrayidx2 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i64 %idxprom1, !dbg !166
%x3 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx2, i32 0, i32 0, !dbg !167
%9 = load i32, i32* %x3, align 4, !dbg !167
%10 = load i32, i32* %smallest, align 4, !dbg !168
%cmp4 = icmp slt i32 %9, %10, !dbg !169
br i1 %cmp4, label %if.then, label %if.end, !dbg !170
if.then: ; preds = %for.body
%11 = load i32, i32* %i, align 4, !dbg !171
store i32 %11, i32* %idx, align 4, !dbg !173
%12 = load i32, i32* %i, align 4, !dbg !174
%idxprom5 = sext i32 %12 to i64, !dbg !175
%13 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !175
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %13, i64 %idxprom5, !dbg !175
%x7 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx6, i32 0, i32 0, !dbg !176
%14 = load i32, i32* %x7, align 4, !dbg !176
store i32 %14, i32* %smallest, align 4, !dbg !177
br label %if.end, !dbg !178
if.end: ; preds = %if.then, %for.body
br label %for.inc, !dbg !179
for.inc: ; preds = %if.end
%15 = load i32, i32* %i, align 4, !dbg !180
%inc = add nsw i32 %15, 1, !dbg !180
store i32 %inc, i32* %i, align 4, !dbg !180
br label %for.cond, !dbg !182
for.end: ; preds = %for.cond
%16 = load i32, i32* %idx, align 4, !dbg !183
ret i32 %16, !dbg !184
}
*** IR Dump After Module Verifier ***
; Function Attrs: nounwind uwtable
define internal %struct.vector3* @make_random_arr(i32 %N) #0 !dbg !22 {
entry:
%N.addr = alloca i32, align 4
%arr = alloca %struct.vector3*, align 8
%i = alloca i32, align 4
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !185, metadata !35), !dbg !186
call void @llvm.dbg.declare(metadata %struct.vector3** %arr, metadata !187, metadata !35), !dbg !188
%0 = load i32, i32* %N.addr, align 4, !dbg !189
%conv = sext i32 %0 to i64, !dbg !189
%mul = mul i64 12, %conv, !dbg !190
%call = call noalias i8* @malloc(i64 %mul) #5, !dbg !191
%1 = bitcast i8* %call to %struct.vector3*, !dbg !191
store %struct.vector3* %1, %struct.vector3** %arr, align 8, !dbg !188
call void @llvm.dbg.declare(metadata i32* %i, metadata !192, metadata !35), !dbg !194
store i32 0, i32* %i, align 4, !dbg !194
br label %for.cond, !dbg !195
for.cond: ; preds = %for.inc, %entry
%2 = load i32, i32* %i, align 4, !dbg !196
%3 = load i32, i32* %N.addr, align 4, !dbg !199
%cmp = icmp slt i32 %2, %3, !dbg !200
br i1 %cmp, label %for.body, label %for.end, !dbg !201
for.body: ; preds = %for.cond
%call2 = call i32 @rand() #5, !dbg !202
%rem = srem i32 %call2, 100, !dbg !204
%4 = load i32, i32* %i, align 4, !dbg !205
%idxprom = sext i32 %4 to i64, !dbg !206
%5 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !206
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %5, i64 %idxprom, !dbg !206
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx, i32 0, i32 0, !dbg !207
store i32 %rem, i32* %x, align 4, !dbg !208
%call3 = call i32 @rand() #5, !dbg !209
%rem4 = srem i32 %call3, 100, !dbg !210
%6 = load i32, i32* %i, align 4, !dbg !211
%idxprom5 = sext i32 %6 to i64, !dbg !212
%7 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !212
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %7, i64 %idxprom5, !dbg !212
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx6, i32 0, i32 1, !dbg !213
store i32 %rem4, i32* %y, align 4, !dbg !214
%call7 = call i32 @rand() #5, !dbg !215
%rem8 = srem i32 %call7, 100, !dbg !216
%8 = load i32, i32* %i, align 4, !dbg !217
%idxprom9 = sext i32 %8 to i64, !dbg !218
%9 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !218
%arrayidx10 = getelementptr inbounds %struct.vector3, %struct.vector3* %9, i64 %idxprom9, !dbg !218
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx10, i32 0, i32 2, !dbg !219
store i32 %rem8, i32* %z, align 4, !dbg !220
br label %for.inc, !dbg !221
for.inc: ; preds = %for.body
%10 = load i32, i32* %i, align 4, !dbg !222
%inc = add nsw i32 %10, 1, !dbg !222
store i32 %inc, i32* %i, align 4, !dbg !222
br label %for.cond, !dbg !224
for.end: ; preds = %for.cond
%11 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !225
ret %struct.vector3* %11, !dbg !226
}
*** IR Dump After Module Verifier ***
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** %argv) #0 !dbg !25 {
entry:
%retval = alloca i32, align 4
%argc.addr = alloca i32, align 4
%argv.addr = alloca i8**, align 8
%x = alloca i32, align 4
%arr = alloca %struct.vector3*, align 8
%arr2 = alloca %struct.vector3*, align 8
%a = alloca %struct.vector3*, align 8
%b = alloca %struct.vector3*, align 8
%c = alloca %struct.vector3*, align 8
store i32 0, i32* %retval, align 4
store i32 %argc, i32* %argc.addr, align 4
call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !227, metadata !35), !dbg !228
store i8** %argv, i8*** %argv.addr, align 8
call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !229, metadata !35), !dbg !230
%0 = load i32, i32* %argc.addr, align 4, !dbg !231
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %0), !dbg !232
%1 = load i8**, i8*** %argv.addr, align 8, !dbg !233
%arrayidx = getelementptr inbounds i8*, i8** %1, i64 0, !dbg !233
%2 = load i8*, i8** %arrayidx, align 8, !dbg !233
%call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0), i8* %2), !dbg !234
call void @llvm.dbg.declare(metadata i32* %x, metadata !235, metadata !35), !dbg !236
%call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i32* %x), !dbg !237
%call3 = call i64 @time(i64* null) #5, !dbg !238
%conv = trunc i64 %call3 to i32, !dbg !238
call void @srand(i32 %conv) #5, !dbg !239
call void @llvm.dbg.declare(metadata %struct.vector3** %arr, metadata !241, metadata !35), !dbg !242
%call4 = call %struct.vector3* @make_random_arr(i32 3), !dbg !243
store %struct.vector3* %call4, %struct.vector3** %arr, align 8, !dbg !242
call void @llvm.dbg.declare(metadata %struct.vector3** %arr2, metadata !244, metadata !35), !dbg !245
%call5 = call %struct.vector3* @make_random_arr(i32 10), !dbg !246
store %struct.vector3* %call5, %struct.vector3** %arr2, align 8, !dbg !245
call void @llvm.dbg.declare(metadata %struct.vector3** %a, metadata !247, metadata !35), !dbg !248
%3 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !249
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %3, i64 0, !dbg !249
store %struct.vector3* %arrayidx6, %struct.vector3** %a, align 8, !dbg !248
call void @llvm.dbg.declare(metadata %struct.vector3** %b, metadata !250, metadata !35), !dbg !251
%4 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !252
%arrayidx7 = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i64 1, !dbg !252
store %struct.vector3* %arrayidx7, %struct.vector3** %b, align 8, !dbg !251
call void @llvm.dbg.declare(metadata %struct.vector3** %c, metadata !253, metadata !35), !dbg !254
%5 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !255
%arrayidx8 = getelementptr inbounds %struct.vector3, %struct.vector3* %5, i64 2, !dbg !255
store %struct.vector3* %arrayidx8, %struct.vector3** %c, align 8, !dbg !254
%6 = load i32, i32* %argc.addr, align 4, !dbg !256
%cmp = icmp eq i32 %6, 1, !dbg !258
br i1 %cmp, label %if.then, label %if.else, !dbg !259
if.then: ; preds = %entry
%7 = load %struct.vector3*, %struct.vector3** %c, align 8, !dbg !260
%8 = load %struct.vector3*, %struct.vector3** %b, align 8, !dbg !262
call void @add(%struct.vector3* %7, %struct.vector3* %8), !dbg !263
br label %if.end, !dbg !264
if.else: ; preds = %entry
%9 = load %struct.vector3*, %struct.vector3** %c, align 8, !dbg !265
%10 = load %struct.vector3*, %struct.vector3** %b, align 8, !dbg !267
call void @add(%struct.vector3* %9, %struct.vector3* %10), !dbg !268
%11 = load %struct.vector3*, %struct.vector3** %c, align 8, !dbg !269
%12 = load %struct.vector3*, %struct.vector3** %b, align 8, !dbg !270
call void @add(%struct.vector3* %11, %struct.vector3* %12), !dbg !271
br label %if.end
if.end: ; preds = %if.else, %if.then
%13 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !272
call void @selection_sort(%struct.vector3* %13, i32 3), !dbg !273
%14 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !274
call void @selection_sort(%struct.vector3* %14, i32 10), !dbg !275
%15 = load %struct.vector3*, %struct.vector3** %a, align 8, !dbg !276
%x10 = getelementptr inbounds %struct.vector3, %struct.vector3* %15, i32 0, i32 0, !dbg !277
%16 = load i32, i32* %x10, align 4, !dbg !277
%17 = load %struct.vector3*, %struct.vector3** %a, align 8, !dbg !278
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %17, i32 0, i32 1, !dbg !279
%18 = load i32, i32* %y, align 4, !dbg !279
%19 = load %struct.vector3*, %struct.vector3** %a, align 8, !dbg !280
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %19, i32 0, i32 2, !dbg !281
%20 = load i32, i32* %z, align 4, !dbg !281
%call11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i32 0, i32 0), i32 %16, i32 %18, i32 %20), !dbg !282
%21 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !283
%arrayidx12 = getelementptr inbounds %struct.vector3, %struct.vector3* %21, i64 0, !dbg !283
%x13 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx12, i32 0, i32 0, !dbg !284
%22 = load i32, i32* %x13, align 4, !dbg !284
%23 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !285
%arrayidx14 = getelementptr inbounds %struct.vector3, %struct.vector3* %23, i64 1, !dbg !285
%x15 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx14, i32 0, i32 0, !dbg !286
%24 = load i32, i32* %x15, align 4, !dbg !286
%25 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !287
%arrayidx16 = getelementptr inbounds %struct.vector3, %struct.vector3* %25, i64 2, !dbg !287
%x17 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx16, i32 0, i32 0, !dbg !288
%26 = load i32, i32* %x17, align 4, !dbg !288
%call18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i32 0, i32 0), i32 %22, i32 %24, i32 %26), !dbg !289
ret i32 0, !dbg !290
}
*** IR Dump After Force set function attributes ***; ModuleID = 'ld-temp.o'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.vector3 = type { i32, i32, i32 }
@.str = private unnamed_addr constant [11 x i8] c"argc = %i\0A\00", align 1
@.str.1 = private unnamed_addr constant [14 x i8] c"argv[0] = %s\0A\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"&x = %p\0A\00", align 1
@.str.3 = private unnamed_addr constant [28 x i8] c"should be random: %i %i %i\0A\00", align 1
@.str.4 = private unnamed_addr constant [28 x i8] c"should be sorted: %i %i %i\0A\00", align 1
; Function Attrs: nounwind uwtable
define internal void @add(%struct.vector3* %v, %struct.vector3* %w) #0 !dbg !4 {
entry:
%v.addr = alloca %struct.vector3*, align 8
%w.addr = alloca %struct.vector3*, align 8
store %struct.vector3* %v, %struct.vector3** %v.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %v.addr, metadata !34, metadata !35), !dbg !36
store %struct.vector3* %w, %struct.vector3** %w.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %w.addr, metadata !37, metadata !35), !dbg !38
%0 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !39
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %0, i32 0, i32 0, !dbg !40
%1 = load i32, i32* %x, align 4, !dbg !40
%2 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !41
%x1 = getelementptr inbounds %struct.vector3, %struct.vector3* %2, i32 0, i32 0, !dbg !42
%3 = load i32, i32* %x1, align 4, !dbg !43
%add = add nsw i32 %3, %1, !dbg !43
store i32 %add, i32* %x1, align 4, !dbg !43
%4 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !44
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i32 0, i32 1, !dbg !45
%5 = load i32, i32* %y, align 4, !dbg !45
%6 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !46
%y2 = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i32 0, i32 1, !dbg !47
%7 = load i32, i32* %y2, align 4, !dbg !48
%add3 = add nsw i32 %7, %5, !dbg !48
store i32 %add3, i32* %y2, align 4, !dbg !48
%8 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !49
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i32 0, i32 2, !dbg !50
%9 = load i32, i32* %z, align 4, !dbg !50
%10 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !51
%z4 = getelementptr inbounds %struct.vector3, %struct.vector3* %10, i32 0, i32 2, !dbg !52
%11 = load i32, i32* %z4, align 4, !dbg !53
%add5 = add nsw i32 %11, %9, !dbg !53
store i32 %add5, i32* %z4, align 4, !dbg !53
ret void, !dbg !54
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind uwtable
define internal void @copy(%struct.vector3* %dst, %struct.vector3* %src) #0 !dbg !14 {
entry:
%dst.addr = alloca %struct.vector3*, align 8
%src.addr = alloca %struct.vector3*, align 8
store %struct.vector3* %dst, %struct.vector3** %dst.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %dst.addr, metadata !55, metadata !35), !dbg !56
store %struct.vector3* %src, %struct.vector3** %src.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %src.addr, metadata !57, metadata !35), !dbg !58
%0 = load %struct.vector3*, %struct.vector3** %dst.addr, align 8, !dbg !59
%1 = bitcast %struct.vector3* %0 to i8*, !dbg !60
%2 = load %struct.vector3*, %struct.vector3** %src.addr, align 8, !dbg !61
%3 = bitcast %struct.vector3* %2 to i8*, !dbg !60
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %3, i64 12, i32 4, i1 false), !dbg !60
ret void, !dbg !62
}
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #2
; Function Attrs: nounwind uwtable
define internal void @swap(%struct.vector3* %a, %struct.vector3* %b) #0 !dbg !15 {
entry:
%a.addr = alloca %struct.vector3*, align 8
%b.addr = alloca %struct.vector3*, align 8
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
store %struct.vector3* %a, %struct.vector3** %a.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %a.addr, metadata !63, metadata !35), !dbg !64
store %struct.vector3* %b, %struct.vector3** %b.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %b.addr, metadata !65, metadata !35), !dbg !66
call void @llvm.dbg.declare(metadata i32* %x, metadata !67, metadata !35), !dbg !68
%0 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !69
%x1 = getelementptr inbounds %struct.vector3, %struct.vector3* %0, i32 0, i32 0, !dbg !70
%1 = load i32, i32* %x1, align 4, !dbg !70
store i32 %1, i32* %x, align 4, !dbg !68
call void @llvm.dbg.declare(metadata i32* %y, metadata !71, metadata !35), !dbg !72
%2 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !73
%y2 = getelementptr inbounds %struct.vector3, %struct.vector3* %2, i32 0, i32 1, !dbg !74
%3 = load i32, i32* %y2, align 4, !dbg !74
store i32 %3, i32* %y, align 4, !dbg !72
call void @llvm.dbg.declare(metadata i32* %z, metadata !75, metadata !35), !dbg !76
%4 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !77
%z3 = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i32 0, i32 2, !dbg !78
%5 = load i32, i32* %z3, align 4, !dbg !78
store i32 %5, i32* %z, align 4, !dbg !76
%6 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !79
%x4 = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i32 0, i32 0, !dbg !80
%7 = load i32, i32* %x4, align 4, !dbg !80
%8 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !81
%x5 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i32 0, i32 0, !dbg !82
store i32 %7, i32* %x5, align 4, !dbg !83
%9 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !84
%y6 = getelementptr inbounds %struct.vector3, %struct.vector3* %9, i32 0, i32 1, !dbg !85
%10 = load i32, i32* %y6, align 4, !dbg !85
%11 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !86
%y7 = getelementptr inbounds %struct.vector3, %struct.vector3* %11, i32 0, i32 1, !dbg !87
store i32 %10, i32* %y7, align 4, !dbg !88
%12 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !89
%z8 = getelementptr inbounds %struct.vector3, %struct.vector3* %12, i32 0, i32 2, !dbg !90
%13 = load i32, i32* %z8, align 4, !dbg !90
%14 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !91
%z9 = getelementptr inbounds %struct.vector3, %struct.vector3* %14, i32 0, i32 2, !dbg !92
store i32 %13, i32* %z9, align 4, !dbg !93
%15 = load i32, i32* %x, align 4, !dbg !94
%16 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !95
%x10 = getelementptr inbounds %struct.vector3, %struct.vector3* %16, i32 0, i32 0, !dbg !96
store i32 %15, i32* %x10, align 4, !dbg !97
%17 = load i32, i32* %y, align 4, !dbg !98
%18 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !99
%y11 = getelementptr inbounds %struct.vector3, %struct.vector3* %18, i32 0, i32 1, !dbg !100
store i32 %17, i32* %y11, align 4, !dbg !101
%19 = load i32, i32* %z, align 4, !dbg !102
%20 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !103
%z12 = getelementptr inbounds %struct.vector3, %struct.vector3* %20, i32 0, i32 2, !dbg !104
store i32 %19, i32* %z12, align 4, !dbg !105
ret void, !dbg !106
}
; Function Attrs: nounwind uwtable
define internal void @selection_sort(%struct.vector3* %vs, i32 %N) #0 !dbg !16 {
entry:
%vs.addr = alloca %struct.vector3*, align 8
%N.addr = alloca i32, align 4
%i = alloca i32, align 4
%idx = alloca i32, align 4
store %struct.vector3* %vs, %struct.vector3** %vs.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %vs.addr, metadata !107, metadata !35), !dbg !108
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !109, metadata !35), !dbg !110
call void @llvm.dbg.declare(metadata i32* %i, metadata !111, metadata !35), !dbg !113
store i32 0, i32* %i, align 4, !dbg !113
br label %for.cond, !dbg !114
for.cond: ; preds = %for.inc, %entry
%0 = load i32, i32* %i, align 4, !dbg !115
%1 = load i32, i32* %N.addr, align 4, !dbg !118
%cmp = icmp slt i32 %0, %1, !dbg !119
br i1 %cmp, label %for.body, label %for.end, !dbg !120
for.body: ; preds = %for.cond
call void @llvm.dbg.declare(metadata i32* %idx, metadata !121, metadata !35), !dbg !123
%2 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !124
%3 = load i32, i32* %i, align 4, !dbg !125
%4 = load i32, i32* %N.addr, align 4, !dbg !126
%call = call i32 @get_smallest(%struct.vector3* %2, i32 %3, i32 %4), !dbg !127
store i32 %call, i32* %idx, align 4, !dbg !123
%5 = load i32, i32* %idx, align 4, !dbg !128
%idxprom = sext i32 %5 to i64, !dbg !129
%6 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !129
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i64 %idxprom, !dbg !129
%7 = load i32, i32* %i, align 4, !dbg !130
%idxprom1 = sext i32 %7 to i64, !dbg !131
%8 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !131
%arrayidx2 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i64 %idxprom1, !dbg !131
call void @swap(%struct.vector3* %arrayidx, %struct.vector3* %arrayidx2), !dbg !132
br label %for.inc, !dbg !133
for.inc: ; preds = %for.body
%9 = load i32, i32* %i, align 4, !dbg !134
%inc = add nsw i32 %9, 1, !dbg !134
store i32 %inc, i32* %i, align 4, !dbg !134
br label %for.cond, !dbg !136
for.end: ; preds = %for.cond
ret void, !dbg !137
}
; Function Attrs: nounwind uwtable
define internal i32 @get_smallest(%struct.vector3* %vs, i32 %start, i32 %N) #0 !dbg !19 {
entry:
%vs.addr = alloca %struct.vector3*, align 8
%start.addr = alloca i32, align 4
%N.addr = alloca i32, align 4
%smallest = alloca i32, align 4
%idx = alloca i32, align 4
%i = alloca i32, align 4
store %struct.vector3* %vs, %struct.vector3** %vs.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %vs.addr, metadata !138, metadata !35), !dbg !139
store i32 %start, i32* %start.addr, align 4
call void @llvm.dbg.declare(metadata i32* %start.addr, metadata !140, metadata !35), !dbg !141
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !142, metadata !35), !dbg !143
call void @llvm.dbg.declare(metadata i32* %smallest, metadata !144, metadata !35), !dbg !145
%0 = load i32, i32* %start.addr, align 4, !dbg !146
%idxprom = sext i32 %0 to i64, !dbg !147
%1 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !147
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %1, i64 %idxprom, !dbg !147
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx, i32 0, i32 0, !dbg !148
%2 = load i32, i32* %x, align 4, !dbg !148
store i32 %2, i32* %smallest, align 4, !dbg !145
call void @llvm.dbg.declare(metadata i32* %idx, metadata !149, metadata !35), !dbg !150
%3 = load i32, i32* %start.addr, align 4, !dbg !151
store i32 %3, i32* %idx, align 4, !dbg !150
call void @llvm.dbg.declare(metadata i32* %i, metadata !152, metadata !35), !dbg !154
%4 = load i32, i32* %start.addr, align 4, !dbg !155
store i32 %4, i32* %i, align 4, !dbg !154
br label %for.cond, !dbg !156
for.cond: ; preds = %for.inc, %entry
%5 = load i32, i32* %i, align 4, !dbg !157
%6 = load i32, i32* %N.addr, align 4, !dbg !160
%cmp = icmp slt i32 %5, %6, !dbg !161
br i1 %cmp, label %for.body, label %for.end, !dbg !162
for.body: ; preds = %for.cond
%7 = load i32, i32* %i, align 4, !dbg !163
%idxprom1 = sext i32 %7 to i64, !dbg !166
%8 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !166
%arrayidx2 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i64 %idxprom1, !dbg !166
%x3 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx2, i32 0, i32 0, !dbg !167
%9 = load i32, i32* %x3, align 4, !dbg !167
%10 = load i32, i32* %smallest, align 4, !dbg !168
%cmp4 = icmp slt i32 %9, %10, !dbg !169
br i1 %cmp4, label %if.then, label %if.end, !dbg !170
if.then: ; preds = %for.body
%11 = load i32, i32* %i, align 4, !dbg !171
store i32 %11, i32* %idx, align 4, !dbg !173
%12 = load i32, i32* %i, align 4, !dbg !174
%idxprom5 = sext i32 %12 to i64, !dbg !175
%13 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !175
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %13, i64 %idxprom5, !dbg !175
%x7 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx6, i32 0, i32 0, !dbg !176
%14 = load i32, i32* %x7, align 4, !dbg !176
store i32 %14, i32* %smallest, align 4, !dbg !177
br label %if.end, !dbg !178
if.end: ; preds = %if.then, %for.body
br label %for.inc, !dbg !179
for.inc: ; preds = %if.end
%15 = load i32, i32* %i, align 4, !dbg !180
%inc = add nsw i32 %15, 1, !dbg !180
store i32 %inc, i32* %i, align 4, !dbg !180
br label %for.cond, !dbg !182
for.end: ; preds = %for.cond
%16 = load i32, i32* %idx, align 4, !dbg !183
ret i32 %16, !dbg !184
}
; Function Attrs: nounwind uwtable
define internal %struct.vector3* @make_random_arr(i32 %N) #0 !dbg !22 {
entry:
%N.addr = alloca i32, align 4
%arr = alloca %struct.vector3*, align 8
%i = alloca i32, align 4
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !185, metadata !35), !dbg !186
call void @llvm.dbg.declare(metadata %struct.vector3** %arr, metadata !187, metadata !35), !dbg !188
%0 = load i32, i32* %N.addr, align 4, !dbg !189
%conv = sext i32 %0 to i64, !dbg !189
%mul = mul i64 12, %conv, !dbg !190
%call = call noalias i8* @malloc(i64 %mul) #5, !dbg !191
%1 = bitcast i8* %call to %struct.vector3*, !dbg !191
store %struct.vector3* %1, %struct.vector3** %arr, align 8, !dbg !188
call void @llvm.dbg.declare(metadata i32* %i, metadata !192, metadata !35), !dbg !194
store i32 0, i32* %i, align 4, !dbg !194
br label %for.cond, !dbg !195
for.cond: ; preds = %for.inc, %entry
%2 = load i32, i32* %i, align 4, !dbg !196
%3 = load i32, i32* %N.addr, align 4, !dbg !199
%cmp = icmp slt i32 %2, %3, !dbg !200
br i1 %cmp, label %for.body, label %for.end, !dbg !201
for.body: ; preds = %for.cond
%call2 = call i32 @rand() #5, !dbg !202
%rem = srem i32 %call2, 100, !dbg !204
%4 = load i32, i32* %i, align 4, !dbg !205
%idxprom = sext i32 %4 to i64, !dbg !206
%5 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !206
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %5, i64 %idxprom, !dbg !206
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx, i32 0, i32 0, !dbg !207
store i32 %rem, i32* %x, align 4, !dbg !208
%call3 = call i32 @rand() #5, !dbg !209
%rem4 = srem i32 %call3, 100, !dbg !210
%6 = load i32, i32* %i, align 4, !dbg !211
%idxprom5 = sext i32 %6 to i64, !dbg !212
%7 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !212
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %7, i64 %idxprom5, !dbg !212
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx6, i32 0, i32 1, !dbg !213
store i32 %rem4, i32* %y, align 4, !dbg !214
%call7 = call i32 @rand() #5, !dbg !215
%rem8 = srem i32 %call7, 100, !dbg !216
%8 = load i32, i32* %i, align 4, !dbg !217
%idxprom9 = sext i32 %8 to i64, !dbg !218
%9 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !218
%arrayidx10 = getelementptr inbounds %struct.vector3, %struct.vector3* %9, i64 %idxprom9, !dbg !218
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx10, i32 0, i32 2, !dbg !219
store i32 %rem8, i32* %z, align 4, !dbg !220
br label %for.inc, !dbg !221
for.inc: ; preds = %for.body
%10 = load i32, i32* %i, align 4, !dbg !222
%inc = add nsw i32 %10, 1, !dbg !222
store i32 %inc, i32* %i, align 4, !dbg !222
br label %for.cond, !dbg !224
for.end: ; preds = %for.cond
%11 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !225
ret %struct.vector3* %11, !dbg !226
}
; Function Attrs: nounwind
declare noalias i8* @malloc(i64) #3
; Function Attrs: nounwind
declare i32 @rand() #3
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** %argv) #0 !dbg !25 {
entry:
%retval = alloca i32, align 4
%argc.addr = alloca i32, align 4
%argv.addr = alloca i8**, align 8
%x = alloca i32, align 4
%arr = alloca %struct.vector3*, align 8
%arr2 = alloca %struct.vector3*, align 8
%a = alloca %struct.vector3*, align 8
%b = alloca %struct.vector3*, align 8
%c = alloca %struct.vector3*, align 8
store i32 0, i32* %retval, align 4
store i32 %argc, i32* %argc.addr, align 4
call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !227, metadata !35), !dbg !228
store i8** %argv, i8*** %argv.addr, align 8
call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !229, metadata !35), !dbg !230
%0 = load i32, i32* %argc.addr, align 4, !dbg !231
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %0), !dbg !232
%1 = load i8**, i8*** %argv.addr, align 8, !dbg !233
%arrayidx = getelementptr inbounds i8*, i8** %1, i64 0, !dbg !233
%2 = load i8*, i8** %arrayidx, align 8, !dbg !233
%call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0), i8* %2), !dbg !234
call void @llvm.dbg.declare(metadata i32* %x, metadata !235, metadata !35), !dbg !236
%call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i32* %x), !dbg !237
%call3 = call i64 @time(i64* null) #5, !dbg !238
%conv = trunc i64 %call3 to i32, !dbg !238
call void @srand(i32 %conv) #5, !dbg !239
call void @llvm.dbg.declare(metadata %struct.vector3** %arr, metadata !241, metadata !35), !dbg !242
%call4 = call %struct.vector3* @make_random_arr(i32 3), !dbg !243
store %struct.vector3* %call4, %struct.vector3** %arr, align 8, !dbg !242
call void @llvm.dbg.declare(metadata %struct.vector3** %arr2, metadata !244, metadata !35), !dbg !245
%call5 = call %struct.vector3* @make_random_arr(i32 10), !dbg !246
store %struct.vector3* %call5, %struct.vector3** %arr2, align 8, !dbg !245
call void @llvm.dbg.declare(metadata %struct.vector3** %a, metadata !247, metadata !35), !dbg !248
%3 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !249
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %3, i64 0, !dbg !249
store %struct.vector3* %arrayidx6, %struct.vector3** %a, align 8, !dbg !248
call void @llvm.dbg.declare(metadata %struct.vector3** %b, metadata !250, metadata !35), !dbg !251
%4 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !252
%arrayidx7 = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i64 1, !dbg !252
store %struct.vector3* %arrayidx7, %struct.vector3** %b, align 8, !dbg !251
call void @llvm.dbg.declare(metadata %struct.vector3** %c, metadata !253, metadata !35), !dbg !254
%5 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !255
%arrayidx8 = getelementptr inbounds %struct.vector3, %struct.vector3* %5, i64 2, !dbg !255
store %struct.vector3* %arrayidx8, %struct.vector3** %c, align 8, !dbg !254
%6 = load i32, i32* %argc.addr, align 4, !dbg !256
%cmp = icmp eq i32 %6, 1, !dbg !258
br i1 %cmp, label %if.then, label %if.else, !dbg !259
if.then: ; preds = %entry
%7 = load %struct.vector3*, %struct.vector3** %c, align 8, !dbg !260
%8 = load %struct.vector3*, %struct.vector3** %b, align 8, !dbg !262
call void @add(%struct.vector3* %7, %struct.vector3* %8), !dbg !263
br label %if.end, !dbg !264
if.else: ; preds = %entry
%9 = load %struct.vector3*, %struct.vector3** %c, align 8, !dbg !265
%10 = load %struct.vector3*, %struct.vector3** %b, align 8, !dbg !267
call void @add(%struct.vector3* %9, %struct.vector3* %10), !dbg !268
%11 = load %struct.vector3*, %struct.vector3** %c, align 8, !dbg !269
%12 = load %struct.vector3*, %struct.vector3** %b, align 8, !dbg !270
call void @add(%struct.vector3* %11, %struct.vector3* %12), !dbg !271
br label %if.end
if.end: ; preds = %if.else, %if.then
%13 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !272
call void @selection_sort(%struct.vector3* %13, i32 3), !dbg !273
%14 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !274
call void @selection_sort(%struct.vector3* %14, i32 10), !dbg !275
%15 = load %struct.vector3*, %struct.vector3** %a, align 8, !dbg !276
%x10 = getelementptr inbounds %struct.vector3, %struct.vector3* %15, i32 0, i32 0, !dbg !277
%16 = load i32, i32* %x10, align 4, !dbg !277
%17 = load %struct.vector3*, %struct.vector3** %a, align 8, !dbg !278
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %17, i32 0, i32 1, !dbg !279
%18 = load i32, i32* %y, align 4, !dbg !279
%19 = load %struct.vector3*, %struct.vector3** %a, align 8, !dbg !280
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %19, i32 0, i32 2, !dbg !281
%20 = load i32, i32* %z, align 4, !dbg !281
%call11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i32 0, i32 0), i32 %16, i32 %18, i32 %20), !dbg !282
%21 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !283
%arrayidx12 = getelementptr inbounds %struct.vector3, %struct.vector3* %21, i64 0, !dbg !283
%x13 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx12, i32 0, i32 0, !dbg !284
%22 = load i32, i32* %x13, align 4, !dbg !284
%23 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !285
%arrayidx14 = getelementptr inbounds %struct.vector3, %struct.vector3* %23, i64 1, !dbg !285
%x15 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx14, i32 0, i32 0, !dbg !286
%24 = load i32, i32* %x15, align 4, !dbg !286
%25 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !287
%arrayidx16 = getelementptr inbounds %struct.vector3, %struct.vector3* %25, i64 2, !dbg !287
%x17 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx16, i32 0, i32 0, !dbg !288
%26 = load i32, i32* %x17, align 4, !dbg !288
%call18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i32 0, i32 0), i32 %22, i32 %24, i32 %26), !dbg !289
ret i32 0, !dbg !290
}
declare i32 @printf(i8*, ...) #4
; Function Attrs: nounwind
declare i64 @time(i64*) #3
; Function Attrs: nounwind
declare void @srand(i32) #3
attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
attributes #2 = { argmemonly nounwind }
attributes #3 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #4 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #5 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.ident = !{!31}
!llvm.module.flags = !{!32, !33}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (git@github.com:llvm-mirror/clang.git 4880b6df49a5b87f8d8412bf929e95bf9feecc17) (git@github.com:llvm-mirror/llvm.git a60f524c803cf3c5b035a398e8f6906b293a7295)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3)
!1 = !DIFile(filename: "test2.c", directory: "/home/carr27/test-clone-function/test")
!2 = !{}
!3 = !{!4, !14, !15, !16, !19, !22, !25}
!4 = distinct !DISubprogram(name: "add", scope: !1, file: !1, line: 12, type: !5, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{null, !7, !7}
!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64)
!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "vector3", file: !1, line: 6, size: 96, align: 32, elements: !9)
!9 = !{!10, !12, !13}
!10 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !8, file: !1, line: 7, baseType: !11, size: 32, align: 32)
!11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!12 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !8, file: !1, line: 7, baseType: !11, size: 32, align: 32, offset: 32)
!13 = !DIDerivedType(tag: DW_TAG_member, name: "z", scope: !8, file: !1, line: 7, baseType: !11, size: 32, align: 32, offset: 64)
!14 = distinct !DISubprogram(name: "copy", scope: !1, file: !1, line: 18, type: !5, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!15 = distinct !DISubprogram(name: "swap", scope: !1, file: !1, line: 22, type: !5, isLocal: false, isDefinition: true, scopeLine: 22, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!16 = distinct !DISubprogram(name: "selection_sort", scope: !1, file: !1, line: 38, type: !17, isLocal: false, isDefinition: true, scopeLine: 38, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!17 = !DISubroutineType(types: !18)
!18 = !{null, !7, !11}
!19 = distinct !DISubprogram(name: "get_smallest", scope: !1, file: !1, line: 45, type: !20, isLocal: false, isDefinition: true, scopeLine: 45, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!20 = !DISubroutineType(types: !21)
!21 = !{!11, !7, !11, !11}
!22 = distinct !DISubprogram(name: "make_random_arr", scope: !1, file: !1, line: 57, type: !23, isLocal: false, isDefinition: true, scopeLine: 57, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!23 = !DISubroutineType(types: !24)
!24 = !{!7, !11}
!25 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 67, type: !26, isLocal: false, isDefinition: true, scopeLine: 67, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!26 = !DISubroutineType(types: !27)
!27 = !{!11, !11, !28}
!28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !29, size: 64, align: 64)
!29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !30, size: 64, align: 64)
!30 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
!31 = !{!"clang version 3.9.0 (git@github.com:llvm-mirror/clang.git 4880b6df49a5b87f8d8412bf929e95bf9feecc17) (git@github.com:llvm-mirror/llvm.git a60f524c803cf3c5b035a398e8f6906b293a7295)"}
!32 = !{i32 2, !"Dwarf Version", i32 4}
!33 = !{i32 2, !"Debug Info Version", i32 3}
!34 = !DILocalVariable(name: "v", arg: 1, scope: !4, file: !1, line: 12, type: !7)
!35 = !DIExpression()
!36 = !DILocation(line: 12, column: 26, scope: !4)
!37 = !DILocalVariable(name: "w", arg: 2, scope: !4, file: !1, line: 12, type: !7)
!38 = !DILocation(line: 12, column: 45, scope: !4)
!39 = !DILocation(line: 13, column: 11, scope: !4)
!40 = !DILocation(line: 13, column: 14, scope: !4)
!41 = !DILocation(line: 13, column: 3, scope: !4)
!42 = !DILocation(line: 13, column: 6, scope: !4)
!43 = !DILocation(line: 13, column: 8, scope: !4)
!44 = !DILocation(line: 14, column: 11, scope: !4)
!45 = !DILocation(line: 14, column: 14, scope: !4)
!46 = !DILocation(line: 14, column: 3, scope: !4)
!47 = !DILocation(line: 14, column: 6, scope: !4)
!48 = !DILocation(line: 14, column: 8, scope: !4)
!49 = !DILocation(line: 15, column: 11, scope: !4)
!50 = !DILocation(line: 15, column: 14, scope: !4)
!51 = !DILocation(line: 15, column: 3, scope: !4)
!52 = !DILocation(line: 15, column: 6, scope: !4)
!53 = !DILocation(line: 15, column: 8, scope: !4)
!54 = !DILocation(line: 16, column: 1, scope: !4)
!55 = !DILocalVariable(name: "dst", arg: 1, scope: !14, file: !1, line: 18, type: !7)
!56 = !DILocation(line: 18, column: 27, scope: !14)
!57 = !DILocalVariable(name: "src", arg: 2, scope: !14, file: !1, line: 18, type: !7)
!58 = !DILocation(line: 18, column: 48, scope: !14)
!59 = !DILocation(line: 19, column: 10, scope: !14)
!60 = !DILocation(line: 19, column: 3, scope: !14)
!61 = !DILocation(line: 19, column: 15, scope: !14)
!62 = !DILocation(line: 20, column: 1, scope: !14)
!63 = !DILocalVariable(name: "a", arg: 1, scope: !15, file: !1, line: 22, type: !7)
!64 = !DILocation(line: 22, column: 27, scope: !15)
!65 = !DILocalVariable(name: "b", arg: 2, scope: !15, file: !1, line: 22, type: !7)
!66 = !DILocation(line: 22, column: 46, scope: !15)
!67 = !DILocalVariable(name: "x", scope: !15, file: !1, line: 23, type: !11)
!68 = !DILocation(line: 23, column: 7, scope: !15)
!69 = !DILocation(line: 23, column: 11, scope: !15)
!70 = !DILocation(line: 23, column: 14, scope: !15)
!71 = !DILocalVariable(name: "y", scope: !15, file: !1, line: 24, type: !11)
!72 = !DILocation(line: 24, column: 7, scope: !15)
!73 = !DILocation(line: 24, column: 11, scope: !15)
!74 = !DILocation(line: 24, column: 14, scope: !15)
!75 = !DILocalVariable(name: "z", scope: !15, file: !1, line: 25, type: !11)
!76 = !DILocation(line: 25, column: 7, scope: !15)
!77 = !DILocation(line: 25, column: 11, scope: !15)
!78 = !DILocation(line: 25, column: 14, scope: !15)
!79 = !DILocation(line: 27, column: 10, scope: !15)
!80 = !DILocation(line: 27, column: 13, scope: !15)
!81 = !DILocation(line: 27, column: 3, scope: !15)
!82 = !DILocation(line: 27, column: 6, scope: !15)
!83 = !DILocation(line: 27, column: 8, scope: !15)
!84 = !DILocation(line: 28, column: 10, scope: !15)
!85 = !DILocation(line: 28, column: 13, scope: !15)
!86 = !DILocation(line: 28, column: 3, scope: !15)
!87 = !DILocation(line: 28, column: 6, scope: !15)
!88 = !DILocation(line: 28, column: 8, scope: !15)
!89 = !DILocation(line: 29, column: 10, scope: !15)
!90 = !DILocation(line: 29, column: 13, scope: !15)
!91 = !DILocation(line: 29, column: 3, scope: !15)
!92 = !DILocation(line: 29, column: 6, scope: !15)
!93 = !DILocation(line: 29, column: 8, scope: !15)
!94 = !DILocation(line: 31, column: 10, scope: !15)
!95 = !DILocation(line: 31, column: 3, scope: !15)
!96 = !DILocation(line: 31, column: 6, scope: !15)
!97 = !DILocation(line: 31, column: 8, scope: !15)
!98 = !DILocation(line: 32, column: 10, scope: !15)
!99 = !DILocation(line: 32, column: 3, scope: !15)
!100 = !DILocation(line: 32, column: 6, scope: !15)
!101 = !DILocation(line: 32, column: 8, scope: !15)
!102 = !DILocation(line: 33, column: 10, scope: !15)
!103 = !DILocation(line: 33, column: 3, scope: !15)
!104 = !DILocation(line: 33, column: 6, scope: !15)
!105 = !DILocation(line: 33, column: 8, scope: !15)
!106 = !DILocation(line: 34, column: 1, scope: !15)
!107 = !DILocalVariable(name: "vs", arg: 1, scope: !16, file: !1, line: 38, type: !7)
!108 = !DILocation(line: 38, column: 37, scope: !16)
!109 = !DILocalVariable(name: "N", arg: 2, scope: !16, file: !1, line: 38, type: !11)
!110 = !DILocation(line: 38, column: 45, scope: !16)
!111 = !DILocalVariable(name: "i", scope: !112, file: !1, line: 39, type: !11)
!112 = distinct !DILexicalBlock(scope: !16, file: !1, line: 39, column: 3)
!113 = !DILocation(line: 39, column: 12, scope: !112)
!114 = !DILocation(line: 39, column: 8, scope: !112)
!115 = !DILocation(line: 39, column: 19, scope: !116)
!116 = !DILexicalBlockFile(scope: !117, file: !1, discriminator: 1)
!117 = distinct !DILexicalBlock(scope: !112, file: !1, line: 39, column: 3)
!118 = !DILocation(line: 39, column: 23, scope: !116)
!119 = !DILocation(line: 39, column: 21, scope: !116)
!120 = !DILocation(line: 39, column: 3, scope: !116)
!121 = !DILocalVariable(name: "idx", scope: !122, file: !1, line: 40, type: !11)
!122 = distinct !DILexicalBlock(scope: !117, file: !1, line: 39, column: 31)
!123 = !DILocation(line: 40, column: 9, scope: !122)
!124 = !DILocation(line: 40, column: 28, scope: !122)
!125 = !DILocation(line: 40, column: 32, scope: !122)
!126 = !DILocation(line: 40, column: 35, scope: !122)
!127 = !DILocation(line: 40, column: 15, scope: !122)
!128 = !DILocation(line: 41, column: 14, scope: !122)
!129 = !DILocation(line: 41, column: 11, scope: !122)
!130 = !DILocation(line: 41, column: 24, scope: !122)
!131 = !DILocation(line: 41, column: 21, scope: !122)
!132 = !DILocation(line: 41, column: 5, scope: !122)
!133 = !DILocation(line: 42, column: 3, scope: !122)
!134 = !DILocation(line: 39, column: 27, scope: !135)
!135 = !DILexicalBlockFile(scope: !117, file: !1, discriminator: 2)
!136 = !DILocation(line: 39, column: 3, scope: !135)
!137 = !DILocation(line: 43, column: 1, scope: !16)
!138 = !DILocalVariable(name: "vs", arg: 1, scope: !19, file: !1, line: 45, type: !7)
!139 = !DILocation(line: 45, column: 34, scope: !19)
!140 = !DILocalVariable(name: "start", arg: 2, scope: !19, file: !1, line: 45, type: !11)
!141 = !DILocation(line: 45, column: 42, scope: !19)
!142 = !DILocalVariable(name: "N", arg: 3, scope: !19, file: !1, line: 45, type: !11)
!143 = !DILocation(line: 45, column: 53, scope: !19)
!144 = !DILocalVariable(name: "smallest", scope: !19, file: !1, line: 46, type: !11)
!145 = !DILocation(line: 46, column: 7, scope: !19)
!146 = !DILocation(line: 46, column: 21, scope: !19)
!147 = !DILocation(line: 46, column: 18, scope: !19)
!148 = !DILocation(line: 46, column: 28, scope: !19)
!149 = !DILocalVariable(name: "idx", scope: !19, file: !1, line: 47, type: !11)
!150 = !DILocation(line: 47, column: 7, scope: !19)
!151 = !DILocation(line: 47, column: 13, scope: !19)
!152 = !DILocalVariable(name: "i", scope: !153, file: !1, line: 48, type: !11)
!153 = distinct !DILexicalBlock(scope: !19, file: !1, line: 48, column: 3)
!154 = !DILocation(line: 48, column: 12, scope: !153)
!155 = !DILocation(line: 48, column: 16, scope: !153)
!156 = !DILocation(line: 48, column: 8, scope: !153)
!157 = !DILocation(line: 48, column: 23, scope: !158)
!158 = !DILexicalBlockFile(scope: !159, file: !1, discriminator: 1)
!159 = distinct !DILexicalBlock(scope: !153, file: !1, line: 48, column: 3)
!160 = !DILocation(line: 48, column: 27, scope: !158)
!161 = !DILocation(line: 48, column: 25, scope: !158)
!162 = !DILocation(line: 48, column: 3, scope: !158)
!163 = !DILocation(line: 49, column: 12, scope: !164)
!164 = distinct !DILexicalBlock(scope: !165, file: !1, line: 49, column: 9)
!165 = distinct !DILexicalBlock(scope: !159, file: !1, line: 48, column: 35)
!166 = !DILocation(line: 49, column: 9, scope: !164)
!167 = !DILocation(line: 49, column: 15, scope: !164)
!168 = !DILocation(line: 49, column: 19, scope: !164)
!169 = !DILocation(line: 49, column: 17, scope: !164)
!170 = !DILocation(line: 49, column: 9, scope: !165)
!171 = !DILocation(line: 50, column: 13, scope: !172)
!172 = distinct !DILexicalBlock(scope: !164, file: !1, line: 49, column: 29)
!173 = !DILocation(line: 50, column: 11, scope: !172)
!174 = !DILocation(line: 51, column: 21, scope: !172)
!175 = !DILocation(line: 51, column: 18, scope: !172)
!176 = !DILocation(line: 51, column: 24, scope: !172)
!177 = !DILocation(line: 51, column: 16, scope: !172)
!178 = !DILocation(line: 52, column: 5, scope: !172)
!179 = !DILocation(line: 53, column: 3, scope: !165)
!180 = !DILocation(line: 48, column: 30, scope: !181)
!181 = !DILexicalBlockFile(scope: !159, file: !1, discriminator: 2)
!182 = !DILocation(line: 48, column: 3, scope: !181)
!183 = !DILocation(line: 54, column: 10, scope: !19)
!184 = !DILocation(line: 54, column: 3, scope: !19)
!185 = !DILocalVariable(name: "N", arg: 1, scope: !22, file: !1, line: 57, type: !11)
!186 = !DILocation(line: 57, column: 37, scope: !22)
!187 = !DILocalVariable(name: "arr", scope: !22, file: !1, line: 58, type: !7)
!188 = !DILocation(line: 58, column: 19, scope: !22)
!189 = !DILocation(line: 58, column: 55, scope: !22)
!190 = !DILocation(line: 58, column: 54, scope: !22)
!191 = !DILocation(line: 58, column: 25, scope: !22)
!192 = !DILocalVariable(name: "i", scope: !193, file: !1, line: 59, type: !11)
!193 = distinct !DILexicalBlock(scope: !22, file: !1, line: 59, column: 3)
!194 = !DILocation(line: 59, column: 12, scope: !193)
!195 = !DILocation(line: 59, column: 8, scope: !193)
!196 = !DILocation(line: 59, column: 19, scope: !197)
!197 = !DILexicalBlockFile(scope: !198, file: !1, discriminator: 1)
!198 = distinct !DILexicalBlock(scope: !193, file: !1, line: 59, column: 3)
!199 = !DILocation(line: 59, column: 23, scope: !197)
!200 = !DILocation(line: 59, column: 21, scope: !197)
!201 = !DILocation(line: 59, column: 3, scope: !197)
!202 = !DILocation(line: 60, column: 16, scope: !203)
!203 = distinct !DILexicalBlock(scope: !198, file: !1, line: 59, column: 31)
!204 = !DILocation(line: 60, column: 23, scope: !203)
!205 = !DILocation(line: 60, column: 9, scope: !203)
!206 = !DILocation(line: 60, column: 5, scope: !203)
!207 = !DILocation(line: 60, column: 12, scope: !203)
!208 = !DILocation(line: 60, column: 14, scope: !203)
!209 = !DILocation(line: 61, column: 16, scope: !203)
!210 = !DILocation(line: 61, column: 23, scope: !203)
!211 = !DILocation(line: 61, column: 9, scope: !203)
!212 = !DILocation(line: 61, column: 5, scope: !203)
!213 = !DILocation(line: 61, column: 12, scope: !203)
!214 = !DILocation(line: 61, column: 14, scope: !203)
!215 = !DILocation(line: 62, column: 16, scope: !203)
!216 = !DILocation(line: 62, column: 23, scope: !203)
!217 = !DILocation(line: 62, column: 9, scope: !203)
!218 = !DILocation(line: 62, column: 5, scope: !203)
!219 = !DILocation(line: 62, column: 12, scope: !203)
!220 = !DILocation(line: 62, column: 14, scope: !203)
!221 = !DILocation(line: 63, column: 3, scope: !203)
!222 = !DILocation(line: 59, column: 26, scope: !223)
!223 = !DILexicalBlockFile(scope: !198, file: !1, discriminator: 2)
!224 = !DILocation(line: 59, column: 3, scope: !223)
!225 = !DILocation(line: 64, column: 10, scope: !22)
!226 = !DILocation(line: 64, column: 3, scope: !22)
!227 = !DILocalVariable(name: "argc", arg: 1, scope: !25, file: !1, line: 67, type: !11)
!228 = !DILocation(line: 67, column: 14, scope: !25)
!229 = !DILocalVariable(name: "argv", arg: 2, scope: !25, file: !1, line: 67, type: !28)
!230 = !DILocation(line: 67, column: 27, scope: !25)
!231 = !DILocation(line: 68, column: 25, scope: !25)
!232 = !DILocation(line: 68, column: 3, scope: !25)
!233 = !DILocation(line: 69, column: 28, scope: !25)
!234 = !DILocation(line: 69, column: 3, scope: !25)
!235 = !DILocalVariable(name: "x", scope: !25, file: !1, line: 71, type: !11)
!236 = !DILocation(line: 71, column: 7, scope: !25)
!237 = !DILocation(line: 72, column: 3, scope: !25)
!238 = !DILocation(line: 74, column: 9, scope: !25)
!239 = !DILocation(line: 74, column: 3, scope: !240)
!240 = !DILexicalBlockFile(scope: !25, file: !1, discriminator: 1)
!241 = !DILocalVariable(name: "arr", scope: !25, file: !1, line: 75, type: !7)
!242 = !DILocation(line: 75, column: 19, scope: !25)
!243 = !DILocation(line: 75, column: 25, scope: !25)
!244 = !DILocalVariable(name: "arr2", scope: !25, file: !1, line: 76, type: !7)
!245 = !DILocation(line: 76, column: 19, scope: !25)
!246 = !DILocation(line: 76, column: 26, scope: !25)
!247 = !DILocalVariable(name: "a", scope: !25, file: !1, line: 77, type: !7)
!248 = !DILocation(line: 77, column: 19, scope: !25)
!249 = !DILocation(line: 77, column: 24, scope: !25)
!250 = !DILocalVariable(name: "b", scope: !25, file: !1, line: 78, type: !7)
!251 = !DILocation(line: 78, column: 19, scope: !25)
!252 = !DILocation(line: 78, column: 24, scope: !25)
!253 = !DILocalVariable(name: "c", scope: !25, file: !1, line: 79, type: !7)
!254 = !DILocation(line: 79, column: 19, scope: !25)
!255 = !DILocation(line: 79, column: 24, scope: !25)
!256 = !DILocation(line: 81, column: 7, scope: !257)
!257 = distinct !DILexicalBlock(scope: !25, file: !1, line: 81, column: 7)
!258 = !DILocation(line: 81, column: 12, scope: !257)
!259 = !DILocation(line: 81, column: 7, scope: !25)
!260 = !DILocation(line: 82, column: 9, scope: !261)
!261 = distinct !DILexicalBlock(scope: !257, file: !1, line: 81, column: 18)
!262 = !DILocation(line: 82, column: 12, scope: !261)
!263 = !DILocation(line: 82, column: 5, scope: !261)
!264 = !DILocation(line: 83, column: 3, scope: !261)
!265 = !DILocation(line: 84, column: 9, scope: !266)
!266 = distinct !DILexicalBlock(scope: !257, file: !1, line: 83, column: 10)
!267 = !DILocation(line: 84, column: 12, scope: !266)
!268 = !DILocation(line: 84, column: 5, scope: !266)
!269 = !DILocation(line: 85, column: 9, scope: !266)
!270 = !DILocation(line: 85, column: 12, scope: !266)
!271 = !DILocation(line: 85, column: 5, scope: !266)
!272 = !DILocation(line: 88, column: 18, scope: !25)
!273 = !DILocation(line: 88, column: 3, scope: !25)
!274 = !DILocation(line: 89, column: 18, scope: !25)
!275 = !DILocation(line: 89, column: 3, scope: !25)
!276 = !DILocation(line: 91, column: 42, scope: !25)
!277 = !DILocation(line: 91, column: 45, scope: !25)
!278 = !DILocation(line: 91, column: 48, scope: !25)
!279 = !DILocation(line: 91, column: 51, scope: !25)
!280 = !DILocation(line: 91, column: 54, scope: !25)
!281 = !DILocation(line: 91, column: 57, scope: !25)
!282 = !DILocation(line: 91, column: 3, scope: !25)
!283 = !DILocation(line: 92, column: 42, scope: !25)
!284 = !DILocation(line: 92, column: 50, scope: !25)
!285 = !DILocation(line: 92, column: 53, scope: !25)
!286 = !DILocation(line: 92, column: 61, scope: !25)
!287 = !DILocation(line: 92, column: 64, scope: !25)
!288 = !DILocation(line: 92, column: 72, scope: !25)
!289 = !DILocation(line: 92, column: 3, scope: !25)
!290 = !DILocation(line: 95, column: 3, scope: !25)
*** IR Dump After Infer set function attributes ***; ModuleID = 'ld-temp.o'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.vector3 = type { i32, i32, i32 }
@.str = private unnamed_addr constant [11 x i8] c"argc = %i\0A\00", align 1
@.str.1 = private unnamed_addr constant [14 x i8] c"argv[0] = %s\0A\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"&x = %p\0A\00", align 1
@.str.3 = private unnamed_addr constant [28 x i8] c"should be random: %i %i %i\0A\00", align 1
@.str.4 = private unnamed_addr constant [28 x i8] c"should be sorted: %i %i %i\0A\00", align 1
; Function Attrs: nounwind uwtable
define internal void @add(%struct.vector3* %v, %struct.vector3* %w) #0 !dbg !4 {
entry:
%v.addr = alloca %struct.vector3*, align 8
%w.addr = alloca %struct.vector3*, align 8
store %struct.vector3* %v, %struct.vector3** %v.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %v.addr, metadata !34, metadata !35), !dbg !36
store %struct.vector3* %w, %struct.vector3** %w.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %w.addr, metadata !37, metadata !35), !dbg !38
%0 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !39
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %0, i32 0, i32 0, !dbg !40
%1 = load i32, i32* %x, align 4, !dbg !40
%2 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !41
%x1 = getelementptr inbounds %struct.vector3, %struct.vector3* %2, i32 0, i32 0, !dbg !42
%3 = load i32, i32* %x1, align 4, !dbg !43
%add = add nsw i32 %3, %1, !dbg !43
store i32 %add, i32* %x1, align 4, !dbg !43
%4 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !44
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i32 0, i32 1, !dbg !45
%5 = load i32, i32* %y, align 4, !dbg !45
%6 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !46
%y2 = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i32 0, i32 1, !dbg !47
%7 = load i32, i32* %y2, align 4, !dbg !48
%add3 = add nsw i32 %7, %5, !dbg !48
store i32 %add3, i32* %y2, align 4, !dbg !48
%8 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !49
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i32 0, i32 2, !dbg !50
%9 = load i32, i32* %z, align 4, !dbg !50
%10 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !51
%z4 = getelementptr inbounds %struct.vector3, %struct.vector3* %10, i32 0, i32 2, !dbg !52
%11 = load i32, i32* %z4, align 4, !dbg !53
%add5 = add nsw i32 %11, %9, !dbg !53
store i32 %add5, i32* %z4, align 4, !dbg !53
ret void, !dbg !54
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind uwtable
define internal void @copy(%struct.vector3* %dst, %struct.vector3* %src) #0 !dbg !14 {
entry:
%dst.addr = alloca %struct.vector3*, align 8
%src.addr = alloca %struct.vector3*, align 8
store %struct.vector3* %dst, %struct.vector3** %dst.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %dst.addr, metadata !55, metadata !35), !dbg !56
store %struct.vector3* %src, %struct.vector3** %src.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %src.addr, metadata !57, metadata !35), !dbg !58
%0 = load %struct.vector3*, %struct.vector3** %dst.addr, align 8, !dbg !59
%1 = bitcast %struct.vector3* %0 to i8*, !dbg !60
%2 = load %struct.vector3*, %struct.vector3** %src.addr, align 8, !dbg !61
%3 = bitcast %struct.vector3* %2 to i8*, !dbg !60
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %3, i64 12, i32 4, i1 false), !dbg !60
ret void, !dbg !62
}
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #2
; Function Attrs: nounwind uwtable
define internal void @swap(%struct.vector3* %a, %struct.vector3* %b) #0 !dbg !15 {
entry:
%a.addr = alloca %struct.vector3*, align 8
%b.addr = alloca %struct.vector3*, align 8
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
store %struct.vector3* %a, %struct.vector3** %a.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %a.addr, metadata !63, metadata !35), !dbg !64
store %struct.vector3* %b, %struct.vector3** %b.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %b.addr, metadata !65, metadata !35), !dbg !66
call void @llvm.dbg.declare(metadata i32* %x, metadata !67, metadata !35), !dbg !68
%0 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !69
%x1 = getelementptr inbounds %struct.vector3, %struct.vector3* %0, i32 0, i32 0, !dbg !70
%1 = load i32, i32* %x1, align 4, !dbg !70
store i32 %1, i32* %x, align 4, !dbg !68
call void @llvm.dbg.declare(metadata i32* %y, metadata !71, metadata !35), !dbg !72
%2 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !73
%y2 = getelementptr inbounds %struct.vector3, %struct.vector3* %2, i32 0, i32 1, !dbg !74
%3 = load i32, i32* %y2, align 4, !dbg !74
store i32 %3, i32* %y, align 4, !dbg !72
call void @llvm.dbg.declare(metadata i32* %z, metadata !75, metadata !35), !dbg !76
%4 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !77
%z3 = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i32 0, i32 2, !dbg !78
%5 = load i32, i32* %z3, align 4, !dbg !78
store i32 %5, i32* %z, align 4, !dbg !76
%6 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !79
%x4 = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i32 0, i32 0, !dbg !80
%7 = load i32, i32* %x4, align 4, !dbg !80
%8 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !81
%x5 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i32 0, i32 0, !dbg !82
store i32 %7, i32* %x5, align 4, !dbg !83
%9 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !84
%y6 = getelementptr inbounds %struct.vector3, %struct.vector3* %9, i32 0, i32 1, !dbg !85
%10 = load i32, i32* %y6, align 4, !dbg !85
%11 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !86
%y7 = getelementptr inbounds %struct.vector3, %struct.vector3* %11, i32 0, i32 1, !dbg !87
store i32 %10, i32* %y7, align 4, !dbg !88
%12 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !89
%z8 = getelementptr inbounds %struct.vector3, %struct.vector3* %12, i32 0, i32 2, !dbg !90
%13 = load i32, i32* %z8, align 4, !dbg !90
%14 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !91
%z9 = getelementptr inbounds %struct.vector3, %struct.vector3* %14, i32 0, i32 2, !dbg !92
store i32 %13, i32* %z9, align 4, !dbg !93
%15 = load i32, i32* %x, align 4, !dbg !94
%16 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !95
%x10 = getelementptr inbounds %struct.vector3, %struct.vector3* %16, i32 0, i32 0, !dbg !96
store i32 %15, i32* %x10, align 4, !dbg !97
%17 = load i32, i32* %y, align 4, !dbg !98
%18 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !99
%y11 = getelementptr inbounds %struct.vector3, %struct.vector3* %18, i32 0, i32 1, !dbg !100
store i32 %17, i32* %y11, align 4, !dbg !101
%19 = load i32, i32* %z, align 4, !dbg !102
%20 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !103
%z12 = getelementptr inbounds %struct.vector3, %struct.vector3* %20, i32 0, i32 2, !dbg !104
store i32 %19, i32* %z12, align 4, !dbg !105
ret void, !dbg !106
}
; Function Attrs: nounwind uwtable
define internal void @selection_sort(%struct.vector3* %vs, i32 %N) #0 !dbg !16 {
entry:
%vs.addr = alloca %struct.vector3*, align 8
%N.addr = alloca i32, align 4
%i = alloca i32, align 4
%idx = alloca i32, align 4
store %struct.vector3* %vs, %struct.vector3** %vs.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %vs.addr, metadata !107, metadata !35), !dbg !108
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !109, metadata !35), !dbg !110
call void @llvm.dbg.declare(metadata i32* %i, metadata !111, metadata !35), !dbg !113
store i32 0, i32* %i, align 4, !dbg !113
br label %for.cond, !dbg !114
for.cond: ; preds = %for.inc, %entry
%0 = load i32, i32* %i, align 4, !dbg !115
%1 = load i32, i32* %N.addr, align 4, !dbg !118
%cmp = icmp slt i32 %0, %1, !dbg !119
br i1 %cmp, label %for.body, label %for.end, !dbg !120
for.body: ; preds = %for.cond
call void @llvm.dbg.declare(metadata i32* %idx, metadata !121, metadata !35), !dbg !123
%2 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !124
%3 = load i32, i32* %i, align 4, !dbg !125
%4 = load i32, i32* %N.addr, align 4, !dbg !126
%call = call i32 @get_smallest(%struct.vector3* %2, i32 %3, i32 %4), !dbg !127
store i32 %call, i32* %idx, align 4, !dbg !123
%5 = load i32, i32* %idx, align 4, !dbg !128
%idxprom = sext i32 %5 to i64, !dbg !129
%6 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !129
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i64 %idxprom, !dbg !129
%7 = load i32, i32* %i, align 4, !dbg !130
%idxprom1 = sext i32 %7 to i64, !dbg !131
%8 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !131
%arrayidx2 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i64 %idxprom1, !dbg !131
call void @swap(%struct.vector3* %arrayidx, %struct.vector3* %arrayidx2), !dbg !132
br label %for.inc, !dbg !133
for.inc: ; preds = %for.body
%9 = load i32, i32* %i, align 4, !dbg !134
%inc = add nsw i32 %9, 1, !dbg !134
store i32 %inc, i32* %i, align 4, !dbg !134
br label %for.cond, !dbg !136
for.end: ; preds = %for.cond
ret void, !dbg !137
}
; Function Attrs: nounwind uwtable
define internal i32 @get_smallest(%struct.vector3* %vs, i32 %start, i32 %N) #0 !dbg !19 {
entry:
%vs.addr = alloca %struct.vector3*, align 8
%start.addr = alloca i32, align 4
%N.addr = alloca i32, align 4
%smallest = alloca i32, align 4
%idx = alloca i32, align 4
%i = alloca i32, align 4
store %struct.vector3* %vs, %struct.vector3** %vs.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %vs.addr, metadata !138, metadata !35), !dbg !139
store i32 %start, i32* %start.addr, align 4
call void @llvm.dbg.declare(metadata i32* %start.addr, metadata !140, metadata !35), !dbg !141
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !142, metadata !35), !dbg !143
call void @llvm.dbg.declare(metadata i32* %smallest, metadata !144, metadata !35), !dbg !145
%0 = load i32, i32* %start.addr, align 4, !dbg !146
%idxprom = sext i32 %0 to i64, !dbg !147
%1 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !147
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %1, i64 %idxprom, !dbg !147
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx, i32 0, i32 0, !dbg !148
%2 = load i32, i32* %x, align 4, !dbg !148
store i32 %2, i32* %smallest, align 4, !dbg !145
call void @llvm.dbg.declare(metadata i32* %idx, metadata !149, metadata !35), !dbg !150
%3 = load i32, i32* %start.addr, align 4, !dbg !151
store i32 %3, i32* %idx, align 4, !dbg !150
call void @llvm.dbg.declare(metadata i32* %i, metadata !152, metadata !35), !dbg !154
%4 = load i32, i32* %start.addr, align 4, !dbg !155
store i32 %4, i32* %i, align 4, !dbg !154
br label %for.cond, !dbg !156
for.cond: ; preds = %for.inc, %entry
%5 = load i32, i32* %i, align 4, !dbg !157
%6 = load i32, i32* %N.addr, align 4, !dbg !160
%cmp = icmp slt i32 %5, %6, !dbg !161
br i1 %cmp, label %for.body, label %for.end, !dbg !162
for.body: ; preds = %for.cond
%7 = load i32, i32* %i, align 4, !dbg !163
%idxprom1 = sext i32 %7 to i64, !dbg !166
%8 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !166
%arrayidx2 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i64 %idxprom1, !dbg !166
%x3 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx2, i32 0, i32 0, !dbg !167
%9 = load i32, i32* %x3, align 4, !dbg !167
%10 = load i32, i32* %smallest, align 4, !dbg !168
%cmp4 = icmp slt i32 %9, %10, !dbg !169
br i1 %cmp4, label %if.then, label %if.end, !dbg !170
if.then: ; preds = %for.body
%11 = load i32, i32* %i, align 4, !dbg !171
store i32 %11, i32* %idx, align 4, !dbg !173
%12 = load i32, i32* %i, align 4, !dbg !174
%idxprom5 = sext i32 %12 to i64, !dbg !175
%13 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !175
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %13, i64 %idxprom5, !dbg !175
%x7 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx6, i32 0, i32 0, !dbg !176
%14 = load i32, i32* %x7, align 4, !dbg !176
store i32 %14, i32* %smallest, align 4, !dbg !177
br label %if.end, !dbg !178
if.end: ; preds = %if.then, %for.body
br label %for.inc, !dbg !179
for.inc: ; preds = %if.end
%15 = load i32, i32* %i, align 4, !dbg !180
%inc = add nsw i32 %15, 1, !dbg !180
store i32 %inc, i32* %i, align 4, !dbg !180
br label %for.cond, !dbg !182
for.end: ; preds = %for.cond
%16 = load i32, i32* %idx, align 4, !dbg !183
ret i32 %16, !dbg !184
}
; Function Attrs: nounwind uwtable
define internal %struct.vector3* @make_random_arr(i32 %N) #0 !dbg !22 {
entry:
%N.addr = alloca i32, align 4
%arr = alloca %struct.vector3*, align 8
%i = alloca i32, align 4
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !185, metadata !35), !dbg !186
call void @llvm.dbg.declare(metadata %struct.vector3** %arr, metadata !187, metadata !35), !dbg !188
%0 = load i32, i32* %N.addr, align 4, !dbg !189
%conv = sext i32 %0 to i64, !dbg !189
%mul = mul i64 12, %conv, !dbg !190
%call = call noalias i8* @malloc(i64 %mul) #4, !dbg !191
%1 = bitcast i8* %call to %struct.vector3*, !dbg !191
store %struct.vector3* %1, %struct.vector3** %arr, align 8, !dbg !188
call void @llvm.dbg.declare(metadata i32* %i, metadata !192, metadata !35), !dbg !194
store i32 0, i32* %i, align 4, !dbg !194
br label %for.cond, !dbg !195
for.cond: ; preds = %for.inc, %entry
%2 = load i32, i32* %i, align 4, !dbg !196
%3 = load i32, i32* %N.addr, align 4, !dbg !199
%cmp = icmp slt i32 %2, %3, !dbg !200
br i1 %cmp, label %for.body, label %for.end, !dbg !201
for.body: ; preds = %for.cond
%call2 = call i32 @rand() #4, !dbg !202
%rem = srem i32 %call2, 100, !dbg !204
%4 = load i32, i32* %i, align 4, !dbg !205
%idxprom = sext i32 %4 to i64, !dbg !206
%5 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !206
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %5, i64 %idxprom, !dbg !206
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx, i32 0, i32 0, !dbg !207
store i32 %rem, i32* %x, align 4, !dbg !208
%call3 = call i32 @rand() #4, !dbg !209
%rem4 = srem i32 %call3, 100, !dbg !210
%6 = load i32, i32* %i, align 4, !dbg !211
%idxprom5 = sext i32 %6 to i64, !dbg !212
%7 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !212
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %7, i64 %idxprom5, !dbg !212
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx6, i32 0, i32 1, !dbg !213
store i32 %rem4, i32* %y, align 4, !dbg !214
%call7 = call i32 @rand() #4, !dbg !215
%rem8 = srem i32 %call7, 100, !dbg !216
%8 = load i32, i32* %i, align 4, !dbg !217
%idxprom9 = sext i32 %8 to i64, !dbg !218
%9 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !218
%arrayidx10 = getelementptr inbounds %struct.vector3, %struct.vector3* %9, i64 %idxprom9, !dbg !218
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx10, i32 0, i32 2, !dbg !219
store i32 %rem8, i32* %z, align 4, !dbg !220
br label %for.inc, !dbg !221
for.inc: ; preds = %for.body
%10 = load i32, i32* %i, align 4, !dbg !222
%inc = add nsw i32 %10, 1, !dbg !222
store i32 %inc, i32* %i, align 4, !dbg !222
br label %for.cond, !dbg !224
for.end: ; preds = %for.cond
%11 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !225
ret %struct.vector3* %11, !dbg !226
}
; Function Attrs: nounwind
declare noalias i8* @malloc(i64) #3
; Function Attrs: nounwind
declare i32 @rand() #3
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** %argv) #0 !dbg !25 {
entry:
%retval = alloca i32, align 4
%argc.addr = alloca i32, align 4
%argv.addr = alloca i8**, align 8
%x = alloca i32, align 4
%arr = alloca %struct.vector3*, align 8
%arr2 = alloca %struct.vector3*, align 8
%a = alloca %struct.vector3*, align 8
%b = alloca %struct.vector3*, align 8
%c = alloca %struct.vector3*, align 8
store i32 0, i32* %retval, align 4
store i32 %argc, i32* %argc.addr, align 4
call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !227, metadata !35), !dbg !228
store i8** %argv, i8*** %argv.addr, align 8
call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !229, metadata !35), !dbg !230
%0 = load i32, i32* %argc.addr, align 4, !dbg !231
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %0), !dbg !232
%1 = load i8**, i8*** %argv.addr, align 8, !dbg !233
%arrayidx = getelementptr inbounds i8*, i8** %1, i64 0, !dbg !233
%2 = load i8*, i8** %arrayidx, align 8, !dbg !233
%call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0), i8* %2), !dbg !234
call void @llvm.dbg.declare(metadata i32* %x, metadata !235, metadata !35), !dbg !236
%call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i32* %x), !dbg !237
%call3 = call i64 @time(i64* null) #4, !dbg !238
%conv = trunc i64 %call3 to i32, !dbg !238
call void @srand(i32 %conv) #4, !dbg !239
call void @llvm.dbg.declare(metadata %struct.vector3** %arr, metadata !241, metadata !35), !dbg !242
%call4 = call %struct.vector3* @make_random_arr(i32 3), !dbg !243
store %struct.vector3* %call4, %struct.vector3** %arr, align 8, !dbg !242
call void @llvm.dbg.declare(metadata %struct.vector3** %arr2, metadata !244, metadata !35), !dbg !245
%call5 = call %struct.vector3* @make_random_arr(i32 10), !dbg !246
store %struct.vector3* %call5, %struct.vector3** %arr2, align 8, !dbg !245
call void @llvm.dbg.declare(metadata %struct.vector3** %a, metadata !247, metadata !35), !dbg !248
%3 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !249
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %3, i64 0, !dbg !249
store %struct.vector3* %arrayidx6, %struct.vector3** %a, align 8, !dbg !248
call void @llvm.dbg.declare(metadata %struct.vector3** %b, metadata !250, metadata !35), !dbg !251
%4 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !252
%arrayidx7 = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i64 1, !dbg !252
store %struct.vector3* %arrayidx7, %struct.vector3** %b, align 8, !dbg !251
call void @llvm.dbg.declare(metadata %struct.vector3** %c, metadata !253, metadata !35), !dbg !254
%5 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !255
%arrayidx8 = getelementptr inbounds %struct.vector3, %struct.vector3* %5, i64 2, !dbg !255
store %struct.vector3* %arrayidx8, %struct.vector3** %c, align 8, !dbg !254
%6 = load i32, i32* %argc.addr, align 4, !dbg !256
%cmp = icmp eq i32 %6, 1, !dbg !258
br i1 %cmp, label %if.then, label %if.else, !dbg !259
if.then: ; preds = %entry
%7 = load %struct.vector3*, %struct.vector3** %c, align 8, !dbg !260
%8 = load %struct.vector3*, %struct.vector3** %b, align 8, !dbg !262
call void @add(%struct.vector3* %7, %struct.vector3* %8), !dbg !263
br label %if.end, !dbg !264
if.else: ; preds = %entry
%9 = load %struct.vector3*, %struct.vector3** %c, align 8, !dbg !265
%10 = load %struct.vector3*, %struct.vector3** %b, align 8, !dbg !267
call void @add(%struct.vector3* %9, %struct.vector3* %10), !dbg !268
%11 = load %struct.vector3*, %struct.vector3** %c, align 8, !dbg !269
%12 = load %struct.vector3*, %struct.vector3** %b, align 8, !dbg !270
call void @add(%struct.vector3* %11, %struct.vector3* %12), !dbg !271
br label %if.end
if.end: ; preds = %if.else, %if.then
%13 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !272
call void @selection_sort(%struct.vector3* %13, i32 3), !dbg !273
%14 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !274
call void @selection_sort(%struct.vector3* %14, i32 10), !dbg !275
%15 = load %struct.vector3*, %struct.vector3** %a, align 8, !dbg !276
%x10 = getelementptr inbounds %struct.vector3, %struct.vector3* %15, i32 0, i32 0, !dbg !277
%16 = load i32, i32* %x10, align 4, !dbg !277
%17 = load %struct.vector3*, %struct.vector3** %a, align 8, !dbg !278
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %17, i32 0, i32 1, !dbg !279
%18 = load i32, i32* %y, align 4, !dbg !279
%19 = load %struct.vector3*, %struct.vector3** %a, align 8, !dbg !280
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %19, i32 0, i32 2, !dbg !281
%20 = load i32, i32* %z, align 4, !dbg !281
%call11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i32 0, i32 0), i32 %16, i32 %18, i32 %20), !dbg !282
%21 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !283
%arrayidx12 = getelementptr inbounds %struct.vector3, %struct.vector3* %21, i64 0, !dbg !283
%x13 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx12, i32 0, i32 0, !dbg !284
%22 = load i32, i32* %x13, align 4, !dbg !284
%23 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !285
%arrayidx14 = getelementptr inbounds %struct.vector3, %struct.vector3* %23, i64 1, !dbg !285
%x15 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx14, i32 0, i32 0, !dbg !286
%24 = load i32, i32* %x15, align 4, !dbg !286
%25 = load %struct.vector3*, %struct.vector3** %arr2, align 8, !dbg !287
%arrayidx16 = getelementptr inbounds %struct.vector3, %struct.vector3* %25, i64 2, !dbg !287
%x17 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx16, i32 0, i32 0, !dbg !288
%26 = load i32, i32* %x17, align 4, !dbg !288
%call18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i32 0, i32 0), i32 %22, i32 %24, i32 %26), !dbg !289
ret i32 0, !dbg !290
}
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture readonly, ...) #3
; Function Attrs: nounwind
declare i64 @time(i64*) #3
; Function Attrs: nounwind
declare void @srand(i32) #3
attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
attributes #2 = { argmemonly nounwind }
attributes #3 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #4 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.ident = !{!31}
!llvm.module.flags = !{!32, !33}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (git@github.com:llvm-mirror/clang.git 4880b6df49a5b87f8d8412bf929e95bf9feecc17) (git@github.com:llvm-mirror/llvm.git a60f524c803cf3c5b035a398e8f6906b293a7295)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3)
!1 = !DIFile(filename: "test2.c", directory: "/home/carr27/test-clone-function/test")
!2 = !{}
!3 = !{!4, !14, !15, !16, !19, !22, !25}
!4 = distinct !DISubprogram(name: "add", scope: !1, file: !1, line: 12, type: !5, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{null, !7, !7}
!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64)
!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "vector3", file: !1, line: 6, size: 96, align: 32, elements: !9)
!9 = !{!10, !12, !13}
!10 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !8, file: !1, line: 7, baseType: !11, size: 32, align: 32)
!11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!12 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !8, file: !1, line: 7, baseType: !11, size: 32, align: 32, offset: 32)
!13 = !DIDerivedType(tag: DW_TAG_member, name: "z", scope: !8, file: !1, line: 7, baseType: !11, size: 32, align: 32, offset: 64)
!14 = distinct !DISubprogram(name: "copy", scope: !1, file: !1, line: 18, type: !5, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!15 = distinct !DISubprogram(name: "swap", scope: !1, file: !1, line: 22, type: !5, isLocal: false, isDefinition: true, scopeLine: 22, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!16 = distinct !DISubprogram(name: "selection_sort", scope: !1, file: !1, line: 38, type: !17, isLocal: false, isDefinition: true, scopeLine: 38, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!17 = !DISubroutineType(types: !18)
!18 = !{null, !7, !11}
!19 = distinct !DISubprogram(name: "get_smallest", scope: !1, file: !1, line: 45, type: !20, isLocal: false, isDefinition: true, scopeLine: 45, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!20 = !DISubroutineType(types: !21)
!21 = !{!11, !7, !11, !11}
!22 = distinct !DISubprogram(name: "make_random_arr", scope: !1, file: !1, line: 57, type: !23, isLocal: false, isDefinition: true, scopeLine: 57, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!23 = !DISubroutineType(types: !24)
!24 = !{!7, !11}
!25 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 67, type: !26, isLocal: false, isDefinition: true, scopeLine: 67, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
!26 = !DISubroutineType(types: !27)
!27 = !{!11, !11, !28}
!28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !29, size: 64, align: 64)
!29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !30, size: 64, align: 64)
!30 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
!31 = !{!"clang version 3.9.0 (git@github.com:llvm-mirror/clang.git 4880b6df49a5b87f8d8412bf929e95bf9feecc17) (git@github.com:llvm-mirror/llvm.git a60f524c803cf3c5b035a398e8f6906b293a7295)"}
!32 = !{i32 2, !"Dwarf Version", i32 4}
!33 = !{i32 2, !"Debug Info Version", i32 3}
!34 = !DILocalVariable(name: "v", arg: 1, scope: !4, file: !1, line: 12, type: !7)
!35 = !DIExpression()
!36 = !DILocation(line: 12, column: 26, scope: !4)
!37 = !DILocalVariable(name: "w", arg: 2, scope: !4, file: !1, line: 12, type: !7)
!38 = !DILocation(line: 12, column: 45, scope: !4)
!39 = !DILocation(line: 13, column: 11, scope: !4)
!40 = !DILocation(line: 13, column: 14, scope: !4)
!41 = !DILocation(line: 13, column: 3, scope: !4)
!42 = !DILocation(line: 13, column: 6, scope: !4)
!43 = !DILocation(line: 13, column: 8, scope: !4)
!44 = !DILocation(line: 14, column: 11, scope: !4)
!45 = !DILocation(line: 14, column: 14, scope: !4)
!46 = !DILocation(line: 14, column: 3, scope: !4)
!47 = !DILocation(line: 14, column: 6, scope: !4)
!48 = !DILocation(line: 14, column: 8, scope: !4)
!49 = !DILocation(line: 15, column: 11, scope: !4)
!50 = !DILocation(line: 15, column: 14, scope: !4)
!51 = !DILocation(line: 15, column: 3, scope: !4)
!52 = !DILocation(line: 15, column: 6, scope: !4)
!53 = !DILocation(line: 15, column: 8, scope: !4)
!54 = !DILocation(line: 16, column: 1, scope: !4)
!55 = !DILocalVariable(name: "dst", arg: 1, scope: !14, file: !1, line: 18, type: !7)
!56 = !DILocation(line: 18, column: 27, scope: !14)
!57 = !DILocalVariable(name: "src", arg: 2, scope: !14, file: !1, line: 18, type: !7)
!58 = !DILocation(line: 18, column: 48, scope: !14)
!59 = !DILocation(line: 19, column: 10, scope: !14)
!60 = !DILocation(line: 19, column: 3, scope: !14)
!61 = !DILocation(line: 19, column: 15, scope: !14)
!62 = !DILocation(line: 20, column: 1, scope: !14)
!63 = !DILocalVariable(name: "a", arg: 1, scope: !15, file: !1, line: 22, type: !7)
!64 = !DILocation(line: 22, column: 27, scope: !15)
!65 = !DILocalVariable(name: "b", arg: 2, scope: !15, file: !1, line: 22, type: !7)
!66 = !DILocation(line: 22, column: 46, scope: !15)
!67 = !DILocalVariable(name: "x", scope: !15, file: !1, line: 23, type: !11)
!68 = !DILocation(line: 23, column: 7, scope: !15)
!69 = !DILocation(line: 23, column: 11, scope: !15)
!70 = !DILocation(line: 23, column: 14, scope: !15)
!71 = !DILocalVariable(name: "y", scope: !15, file: !1, line: 24, type: !11)
!72 = !DILocation(line: 24, column: 7, scope: !15)
!73 = !DILocation(line: 24, column: 11, scope: !15)
!74 = !DILocation(line: 24, column: 14, scope: !15)
!75 = !DILocalVariable(name: "z", scope: !15, file: !1, line: 25, type: !11)
!76 = !DILocation(line: 25, column: 7, scope: !15)
!77 = !DILocation(line: 25, column: 11, scope: !15)
!78 = !DILocation(line: 25, column: 14, scope: !15)
!79 = !DILocation(line: 27, column: 10, scope: !15)
!80 = !DILocation(line: 27, column: 13, scope: !15)
!81 = !DILocation(line: 27, column: 3, scope: !15)
!82 = !DILocation(line: 27, column: 6, scope: !15)
!83 = !DILocation(line: 27, column: 8, scope: !15)
!84 = !DILocation(line: 28, column: 10, scope: !15)
!85 = !DILocation(line: 28, column: 13, scope: !15)
!86 = !DILocation(line: 28, column: 3, scope: !15)
!87 = !DILocation(line: 28, column: 6, scope: !15)
!88 = !DILocation(line: 28, column: 8, scope: !15)
!89 = !DILocation(line: 29, column: 10, scope: !15)
!90 = !DILocation(line: 29, column: 13, scope: !15)
!91 = !DILocation(line: 29, column: 3, scope: !15)
!92 = !DILocation(line: 29, column: 6, scope: !15)
!93 = !DILocation(line: 29, column: 8, scope: !15)
!94 = !DILocation(line: 31, column: 10, scope: !15)
!95 = !DILocation(line: 31, column: 3, scope: !15)
!96 = !DILocation(line: 31, column: 6, scope: !15)
!97 = !DILocation(line: 31, column: 8, scope: !15)
!98 = !DILocation(line: 32, column: 10, scope: !15)
!99 = !DILocation(line: 32, column: 3, scope: !15)
!100 = !DILocation(line: 32, column: 6, scope: !15)
!101 = !DILocation(line: 32, column: 8, scope: !15)
!102 = !DILocation(line: 33, column: 10, scope: !15)
!103 = !DILocation(line: 33, column: 3, scope: !15)
!104 = !DILocation(line: 33, column: 6, scope: !15)
!105 = !DILocation(line: 33, column: 8, scope: !15)
!106 = !DILocation(line: 34, column: 1, scope: !15)
!107 = !DILocalVariable(name: "vs", arg: 1, scope: !16, file: !1, line: 38, type: !7)
!108 = !DILocation(line: 38, column: 37, scope: !16)
!109 = !DILocalVariable(name: "N", arg: 2, scope: !16, file: !1, line: 38, type: !11)
!110 = !DILocation(line: 38, column: 45, scope: !16)
!111 = !DILocalVariable(name: "i", scope: !112, file: !1, line: 39, type: !11)
!112 = distinct !DILexicalBlock(scope: !16, file: !1, line: 39, column: 3)
!113 = !DILocation(line: 39, column: 12, scope: !112)
!114 = !DILocation(line: 39, column: 8, scope: !112)
!115 = !DILocation(line: 39, column: 19, scope: !116)
!116 = !DILexicalBlockFile(scope: !117, file: !1, discriminator: 1)
!117 = distinct !DILexicalBlock(scope: !112, file: !1, line: 39, column: 3)
!118 = !DILocation(line: 39, column: 23, scope: !116)
!119 = !DILocation(line: 39, column: 21, scope: !116)
!120 = !DILocation(line: 39, column: 3, scope: !116)
!121 = !DILocalVariable(name: "idx", scope: !122, file: !1, line: 40, type: !11)
!122 = distinct !DILexicalBlock(scope: !117, file: !1, line: 39, column: 31)
!123 = !DILocation(line: 40, column: 9, scope: !122)
!124 = !DILocation(line: 40, column: 28, scope: !122)
!125 = !DILocation(line: 40, column: 32, scope: !122)
!126 = !DILocation(line: 40, column: 35, scope: !122)
!127 = !DILocation(line: 40, column: 15, scope: !122)
!128 = !DILocation(line: 41, column: 14, scope: !122)
!129 = !DILocation(line: 41, column: 11, scope: !122)
!130 = !DILocation(line: 41, column: 24, scope: !122)
!131 = !DILocation(line: 41, column: 21, scope: !122)
!132 = !DILocation(line: 41, column: 5, scope: !122)
!133 = !DILocation(line: 42, column: 3, scope: !122)
!134 = !DILocation(line: 39, column: 27, scope: !135)
!135 = !DILexicalBlockFile(scope: !117, file: !1, discriminator: 2)
!136 = !DILocation(line: 39, column: 3, scope: !135)
!137 = !DILocation(line: 43, column: 1, scope: !16)
!138 = !DILocalVariable(name: "vs", arg: 1, scope: !19, file: !1, line: 45, type: !7)
!139 = !DILocation(line: 45, column: 34, scope: !19)
!140 = !DILocalVariable(name: "start", arg: 2, scope: !19, file: !1, line: 45, type: !11)
!141 = !DILocation(line: 45, column: 42, scope: !19)
!142 = !DILocalVariable(name: "N", arg: 3, scope: !19, file: !1, line: 45, type: !11)
!143 = !DILocation(line: 45, column: 53, scope: !19)
!144 = !DILocalVariable(name: "smallest", scope: !19, file: !1, line: 46, type: !11)
!145 = !DILocation(line: 46, column: 7, scope: !19)
!146 = !DILocation(line: 46, column: 21, scope: !19)
!147 = !DILocation(line: 46, column: 18, scope: !19)
!148 = !DILocation(line: 46, column: 28, scope: !19)
!149 = !DILocalVariable(name: "idx", scope: !19, file: !1, line: 47, type: !11)
!150 = !DILocation(line: 47, column: 7, scope: !19)
!151 = !DILocation(line: 47, column: 13, scope: !19)
!152 = !DILocalVariable(name: "i", scope: !153, file: !1, line: 48, type: !11)
!153 = distinct !DILexicalBlock(scope: !19, file: !1, line: 48, column: 3)
!154 = !DILocation(line: 48, column: 12, scope: !153)
!155 = !DILocation(line: 48, column: 16, scope: !153)
!156 = !DILocation(line: 48, column: 8, scope: !153)
!157 = !DILocation(line: 48, column: 23, scope: !158)
!158 = !DILexicalBlockFile(scope: !159, file: !1, discriminator: 1)
!159 = distinct !DILexicalBlock(scope: !153, file: !1, line: 48, column: 3)
!160 = !DILocation(line: 48, column: 27, scope: !158)
!161 = !DILocation(line: 48, column: 25, scope: !158)
!162 = !DILocation(line: 48, column: 3, scope: !158)
!163 = !DILocation(line: 49, column: 12, scope: !164)
!164 = distinct !DILexicalBlock(scope: !165, file: !1, line: 49, column: 9)
!165 = distinct !DILexicalBlock(scope: !159, file: !1, line: 48, column: 35)
!166 = !DILocation(line: 49, column: 9, scope: !164)
!167 = !DILocation(line: 49, column: 15, scope: !164)
!168 = !DILocation(line: 49, column: 19, scope: !164)
!169 = !DILocation(line: 49, column: 17, scope: !164)
!170 = !DILocation(line: 49, column: 9, scope: !165)
!171 = !DILocation(line: 50, column: 13, scope: !172)
!172 = distinct !DILexicalBlock(scope: !164, file: !1, line: 49, column: 29)
!173 = !DILocation(line: 50, column: 11, scope: !172)
!174 = !DILocation(line: 51, column: 21, scope: !172)
!175 = !DILocation(line: 51, column: 18, scope: !172)
!176 = !DILocation(line: 51, column: 24, scope: !172)
!177 = !DILocation(line: 51, column: 16, scope: !172)
!178 = !DILocation(line: 52, column: 5, scope: !172)
!179 = !DILocation(line: 53, column: 3, scope: !165)
!180 = !DILocation(line: 48, column: 30, scope: !181)
!181 = !DILexicalBlockFile(scope: !159, file: !1, discriminator: 2)
!182 = !DILocation(line: 48, column: 3, scope: !181)
!183 = !DILocation(line: 54, column: 10, scope: !19)
!184 = !DILocation(line: 54, column: 3, scope: !19)
!185 = !DILocalVariable(name: "N", arg: 1, scope: !22, file: !1, line: 57, type: !11)
!186 = !DILocation(line: 57, column: 37, scope: !22)
!187 = !DILocalVariable(name: "arr", scope: !22, file: !1, line: 58, type: !7)
!188 = !DILocation(line: 58, column: 19, scope: !22)
!189 = !DILocation(line: 58, column: 55, scope: !22)
!190 = !DILocation(line: 58, column: 54, scope: !22)
!191 = !DILocation(line: 58, column: 25, scope: !22)
!192 = !DILocalVariable(name: "i", scope: !193, file: !1, line: 59, type: !11)
!193 = distinct !DILexicalBlock(scope: !22, file: !1, line: 59, column: 3)
!194 = !DILocation(line: 59, column: 12, scope: !193)
!195 = !DILocation(line: 59, column: 8, scope: !193)
!196 = !DILocation(line: 59, column: 19, scope: !197)
!197 = !DILexicalBlockFile(scope: !198, file: !1, discriminator: 1)
!198 = distinct !DILexicalBlock(scope: !193, file: !1, line: 59, column: 3)
!199 = !DILocation(line: 59, column: 23, scope: !197)
!200 = !DILocation(line: 59, column: 21, scope: !197)
!201 = !DILocation(line: 59, column: 3, scope: !197)
!202 = !DILocation(line: 60, column: 16, scope: !203)
!203 = distinct !DILexicalBlock(scope: !198, file: !1, line: 59, column: 31)
!204 = !DILocation(line: 60, column: 23, scope: !203)
!205 = !DILocation(line: 60, column: 9, scope: !203)
!206 = !DILocation(line: 60, column: 5, scope: !203)
!207 = !DILocation(line: 60, column: 12, scope: !203)
!208 = !DILocation(line: 60, column: 14, scope: !203)
!209 = !DILocation(line: 61, column: 16, scope: !203)
!210 = !DILocation(line: 61, column: 23, scope: !203)
!211 = !DILocation(line: 61, column: 9, scope: !203)
!212 = !DILocation(line: 61, column: 5, scope: !203)
!213 = !DILocation(line: 61, column: 12, scope: !203)
!214 = !DILocation(line: 61, column: 14, scope: !203)
!215 = !DILocation(line: 62, column: 16, scope: !203)
!216 = !DILocation(line: 62, column: 23, scope: !203)
!217 = !DILocation(line: 62, column: 9, scope: !203)
!218 = !DILocation(line: 62, column: 5, scope: !203)
!219 = !DILocation(line: 62, column: 12, scope: !203)
!220 = !DILocation(line: 62, column: 14, scope: !203)
!221 = !DILocation(line: 63, column: 3, scope: !203)
!222 = !DILocation(line: 59, column: 26, scope: !223)
!223 = !DILexicalBlockFile(scope: !198, file: !1, discriminator: 2)
!224 = !DILocation(line: 59, column: 3, scope: !223)
!225 = !DILocation(line: 64, column: 10, scope: !22)
!226 = !DILocation(line: 64, column: 3, scope: !22)
!227 = !DILocalVariable(name: "argc", arg: 1, scope: !25, file: !1, line: 67, type: !11)
!228 = !DILocation(line: 67, column: 14, scope: !25)
!229 = !DILocalVariable(name: "argv", arg: 2, scope: !25, file: !1, line: 67, type: !28)
!230 = !DILocation(line: 67, column: 27, scope: !25)
!231 = !DILocation(line: 68, column: 25, scope: !25)
!232 = !DILocation(line: 68, column: 3, scope: !25)
!233 = !DILocation(line: 69, column: 28, scope: !25)
!234 = !DILocation(line: 69, column: 3, scope: !25)
!235 = !DILocalVariable(name: "x", scope: !25, file: !1, line: 71, type: !11)
!236 = !DILocation(line: 71, column: 7, scope: !25)
!237 = !DILocation(line: 72, column: 3, scope: !25)
!238 = !DILocation(line: 74, column: 9, scope: !25)
!239 = !DILocation(line: 74, column: 3, scope: !240)
!240 = !DILexicalBlockFile(scope: !25, file: !1, discriminator: 1)
!241 = !DILocalVariable(name: "arr", scope: !25, file: !1, line: 75, type: !7)
!242 = !DILocation(line: 75, column: 19, scope: !25)
!243 = !DILocation(line: 75, column: 25, scope: !25)
!244 = !DILocalVariable(name: "arr2", scope: !25, file: !1, line: 76, type: !7)
!245 = !DILocation(line: 76, column: 19, scope: !25)
!246 = !DILocation(line: 76, column: 26, scope: !25)
!247 = !DILocalVariable(name: "a", scope: !25, file: !1, line: 77, type: !7)
!248 = !DILocation(line: 77, column: 19, scope: !25)
!249 = !DILocation(line: 77, column: 24, scope: !25)
!250 = !DILocalVariable(name: "b", scope: !25, file: !1, line: 78, type: !7)
!251 = !DILocation(line: 78, column: 19, scope: !25)
!252 = !DILocation(line: 78, column: 24, scope: !25)
!253 = !DILocalVariable(name: "c", scope: !25, file: !1, line: 79, type: !7)
!254 = !DILocation(line: 79, column: 19, scope: !25)
!255 = !DILocation(line: 79, column: 24, scope: !25)
!256 = !DILocation(line: 81, column: 7, scope: !257)
!257 = distinct !DILexicalBlock(scope: !25, file: !1, line: 81, column: 7)
!258 = !DILocation(line: 81, column: 12, scope: !257)
!259 = !DILocation(line: 81, column: 7, scope: !25)
!260 = !DILocation(line: 82, column: 9, scope: !261)
!261 = distinct !DILexicalBlock(scope: !257, file: !1, line: 81, column: 18)
!262 = !DILocation(line: 82, column: 12, scope: !261)
!263 = !DILocation(line: 82, column: 5, scope: !261)
!264 = !DILocation(line: 83, column: 3, scope: !261)
!265 = !DILocation(line: 84, column: 9, scope: !266)
!266 = distinct !DILexicalBlock(scope: !257, file: !1, line: 83, column: 10)
!267 = !DILocation(line: 84, column: 12, scope: !266)
!268 = !DILocation(line: 84, column: 5, scope: !266)
!269 = !DILocation(line: 85, column: 9, scope: !266)
!270 = !DILocation(line: 85, column: 12, scope: !266)
!271 = !DILocation(line: 85, column: 5, scope: !266)
!272 = !DILocation(line: 88, column: 18, scope: !25)
!273 = !DILocation(line: 88, column: 3, scope: !25)
!274 = !DILocation(line: 89, column: 18, scope: !25)
!275 = !DILocation(line: 89, column: 3, scope: !25)
!276 = !DILocation(line: 91, column: 42, scope: !25)
!277 = !DILocation(line: 91, column: 45, scope: !25)
!278 = !DILocation(line: 91, column: 48, scope: !25)
!279 = !DILocation(line: 91, column: 51, scope: !25)
!280 = !DILocation(line: 91, column: 54, scope: !25)
!281 = !DILocation(line: 91, column: 57, scope: !25)
!282 = !DILocation(line: 91, column: 3, scope: !25)
!283 = !DILocation(line: 92, column: 42, scope: !25)
!284 = !DILocation(line: 92, column: 50, scope: !25)
!285 = !DILocation(line: 92, column: 53, scope: !25)
!286 = !DILocation(line: 92, column: 61, scope: !25)
!287 = !DILocation(line: 92, column: 64, scope: !25)
!288 = !DILocation(line: 92, column: 72, scope: !25)
!289 = !DILocation(line: 92, column: 3, scope: !25)
!290 = !DILocation(line: 95, column: 3, scope: !25)
*** IR Dump After Interprocedural Sparse Conditional Constant Propagation ***; ModuleID = 'ld-temp.o'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.vector3 = type { i32, i32, i32 }
@.str = private unnamed_addr constant [11 x i8] c"argc = %i\0A\00", align 1
@.str.1 = private unnamed_addr constant [14 x i8] c"argv[0] = %s\0A\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"&x = %p\0A\00", align 1
@.str.3 = private unnamed_addr constant [28 x i8] c"should be random: %i %i %i\0A\00", align 1
@.str.4 = private unnamed_addr constant [28 x i8] c"should be sorted: %i %i %i\0A\00", align 1
; Function Attrs: nounwind uwtable
define internal void @add(%struct.vector3* %v, %struct.vector3* %w) #0 !dbg !4 {
entry:
%v.addr = alloca %struct.vector3*, align 8
%w.addr = alloca %struct.vector3*, align 8
store %struct.vector3* %v, %struct.vector3** %v.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %v.addr, metadata !34, metadata !35), !dbg !36
store %struct.vector3* %w, %struct.vector3** %w.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %w.addr, metadata !37, metadata !35), !dbg !38
%0 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !39
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %0, i32 0, i32 0, !dbg !40
%1 = load i32, i32* %x, align 4, !dbg !40
%2 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !41
%x1 = getelementptr inbounds %struct.vector3, %struct.vector3* %2, i32 0, i32 0, !dbg !42
%3 = load i32, i32* %x1, align 4, !dbg !43
%add = add nsw i32 %3, %1, !dbg !43
store i32 %add, i32* %x1, align 4, !dbg !43
%4 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !44
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i32 0, i32 1, !dbg !45
%5 = load i32, i32* %y, align 4, !dbg !45
%6 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !46
%y2 = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i32 0, i32 1, !dbg !47
%7 = load i32, i32* %y2, align 4, !dbg !48
%add3 = add nsw i32 %7, %5, !dbg !48
store i32 %add3, i32* %y2, align 4, !dbg !48
%8 = load %struct.vector3*, %struct.vector3** %w.addr, align 8, !dbg !49
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i32 0, i32 2, !dbg !50
%9 = load i32, i32* %z, align 4, !dbg !50
%10 = load %struct.vector3*, %struct.vector3** %v.addr, align 8, !dbg !51
%z4 = getelementptr inbounds %struct.vector3, %struct.vector3* %10, i32 0, i32 2, !dbg !52
%11 = load i32, i32* %z4, align 4, !dbg !53
%add5 = add nsw i32 %11, %9, !dbg !53
store i32 %add5, i32* %z4, align 4, !dbg !53
ret void, !dbg !54
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind uwtable
define internal void @copy(%struct.vector3* %dst, %struct.vector3* %src) #0 !dbg !14 {
entry:
unreachable
}
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #2
; Function Attrs: nounwind uwtable
define internal void @swap(%struct.vector3* %a, %struct.vector3* %b) #0 !dbg !15 {
entry:
%a.addr = alloca %struct.vector3*, align 8
%b.addr = alloca %struct.vector3*, align 8
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
store %struct.vector3* %a, %struct.vector3** %a.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %a.addr, metadata !55, metadata !35), !dbg !56
store %struct.vector3* %b, %struct.vector3** %b.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %b.addr, metadata !57, metadata !35), !dbg !58
call void @llvm.dbg.declare(metadata i32* %x, metadata !59, metadata !35), !dbg !60
%0 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !61
%x1 = getelementptr inbounds %struct.vector3, %struct.vector3* %0, i32 0, i32 0, !dbg !62
%1 = load i32, i32* %x1, align 4, !dbg !62
store i32 %1, i32* %x, align 4, !dbg !60
call void @llvm.dbg.declare(metadata i32* %y, metadata !63, metadata !35), !dbg !64
%2 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !65
%y2 = getelementptr inbounds %struct.vector3, %struct.vector3* %2, i32 0, i32 1, !dbg !66
%3 = load i32, i32* %y2, align 4, !dbg !66
store i32 %3, i32* %y, align 4, !dbg !64
call void @llvm.dbg.declare(metadata i32* %z, metadata !67, metadata !35), !dbg !68
%4 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !69
%z3 = getelementptr inbounds %struct.vector3, %struct.vector3* %4, i32 0, i32 2, !dbg !70
%5 = load i32, i32* %z3, align 4, !dbg !70
store i32 %5, i32* %z, align 4, !dbg !68
%6 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !71
%x4 = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i32 0, i32 0, !dbg !72
%7 = load i32, i32* %x4, align 4, !dbg !72
%8 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !73
%x5 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i32 0, i32 0, !dbg !74
store i32 %7, i32* %x5, align 4, !dbg !75
%9 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !76
%y6 = getelementptr inbounds %struct.vector3, %struct.vector3* %9, i32 0, i32 1, !dbg !77
%10 = load i32, i32* %y6, align 4, !dbg !77
%11 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !78
%y7 = getelementptr inbounds %struct.vector3, %struct.vector3* %11, i32 0, i32 1, !dbg !79
store i32 %10, i32* %y7, align 4, !dbg !80
%12 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !81
%z8 = getelementptr inbounds %struct.vector3, %struct.vector3* %12, i32 0, i32 2, !dbg !82
%13 = load i32, i32* %z8, align 4, !dbg !82
%14 = load %struct.vector3*, %struct.vector3** %a.addr, align 8, !dbg !83
%z9 = getelementptr inbounds %struct.vector3, %struct.vector3* %14, i32 0, i32 2, !dbg !84
store i32 %13, i32* %z9, align 4, !dbg !85
%15 = load i32, i32* %x, align 4, !dbg !86
%16 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !87
%x10 = getelementptr inbounds %struct.vector3, %struct.vector3* %16, i32 0, i32 0, !dbg !88
store i32 %15, i32* %x10, align 4, !dbg !89
%17 = load i32, i32* %y, align 4, !dbg !90
%18 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !91
%y11 = getelementptr inbounds %struct.vector3, %struct.vector3* %18, i32 0, i32 1, !dbg !92
store i32 %17, i32* %y11, align 4, !dbg !93
%19 = load i32, i32* %z, align 4, !dbg !94
%20 = load %struct.vector3*, %struct.vector3** %b.addr, align 8, !dbg !95
%z12 = getelementptr inbounds %struct.vector3, %struct.vector3* %20, i32 0, i32 2, !dbg !96
store i32 %19, i32* %z12, align 4, !dbg !97
ret void, !dbg !98
}
; Function Attrs: nounwind uwtable
define internal void @selection_sort(%struct.vector3* %vs, i32 %N) #0 !dbg !16 {
entry:
%vs.addr = alloca %struct.vector3*, align 8
%N.addr = alloca i32, align 4
%i = alloca i32, align 4
%idx = alloca i32, align 4
store %struct.vector3* %vs, %struct.vector3** %vs.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %vs.addr, metadata !99, metadata !35), !dbg !100
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !101, metadata !35), !dbg !102
call void @llvm.dbg.declare(metadata i32* %i, metadata !103, metadata !35), !dbg !105
store i32 0, i32* %i, align 4, !dbg !105
br label %for.cond, !dbg !106
for.cond: ; preds = %for.inc, %entry
%0 = load i32, i32* %i, align 4, !dbg !107
%1 = load i32, i32* %N.addr, align 4, !dbg !110
%cmp = icmp slt i32 %0, %1, !dbg !111
br i1 %cmp, label %for.body, label %for.end, !dbg !112
for.body: ; preds = %for.cond
call void @llvm.dbg.declare(metadata i32* %idx, metadata !113, metadata !35), !dbg !115
%2 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !116
%3 = load i32, i32* %i, align 4, !dbg !117
%4 = load i32, i32* %N.addr, align 4, !dbg !118
%call = call i32 @get_smallest(%struct.vector3* %2, i32 %3, i32 %4), !dbg !119
store i32 %call, i32* %idx, align 4, !dbg !115
%5 = load i32, i32* %idx, align 4, !dbg !120
%idxprom = sext i32 %5 to i64, !dbg !121
%6 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !121
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %6, i64 %idxprom, !dbg !121
%7 = load i32, i32* %i, align 4, !dbg !122
%idxprom1 = sext i32 %7 to i64, !dbg !123
%8 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !123
%arrayidx2 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i64 %idxprom1, !dbg !123
call void @swap(%struct.vector3* %arrayidx, %struct.vector3* %arrayidx2), !dbg !124
br label %for.inc, !dbg !125
for.inc: ; preds = %for.body
%9 = load i32, i32* %i, align 4, !dbg !126
%inc = add nsw i32 %9, 1, !dbg !126
store i32 %inc, i32* %i, align 4, !dbg !126
br label %for.cond, !dbg !128
for.end: ; preds = %for.cond
ret void, !dbg !129
}
; Function Attrs: nounwind uwtable
define internal i32 @get_smallest(%struct.vector3* %vs, i32 %start, i32 %N) #0 !dbg !19 {
entry:
%vs.addr = alloca %struct.vector3*, align 8
%start.addr = alloca i32, align 4
%N.addr = alloca i32, align 4
%smallest = alloca i32, align 4
%idx = alloca i32, align 4
%i = alloca i32, align 4
store %struct.vector3* %vs, %struct.vector3** %vs.addr, align 8
call void @llvm.dbg.declare(metadata %struct.vector3** %vs.addr, metadata !130, metadata !35), !dbg !131
store i32 %start, i32* %start.addr, align 4
call void @llvm.dbg.declare(metadata i32* %start.addr, metadata !132, metadata !35), !dbg !133
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !134, metadata !35), !dbg !135
call void @llvm.dbg.declare(metadata i32* %smallest, metadata !136, metadata !35), !dbg !137
%0 = load i32, i32* %start.addr, align 4, !dbg !138
%idxprom = sext i32 %0 to i64, !dbg !139
%1 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !139
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %1, i64 %idxprom, !dbg !139
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx, i32 0, i32 0, !dbg !140
%2 = load i32, i32* %x, align 4, !dbg !140
store i32 %2, i32* %smallest, align 4, !dbg !137
call void @llvm.dbg.declare(metadata i32* %idx, metadata !141, metadata !35), !dbg !142
%3 = load i32, i32* %start.addr, align 4, !dbg !143
store i32 %3, i32* %idx, align 4, !dbg !142
call void @llvm.dbg.declare(metadata i32* %i, metadata !144, metadata !35), !dbg !146
%4 = load i32, i32* %start.addr, align 4, !dbg !147
store i32 %4, i32* %i, align 4, !dbg !146
br label %for.cond, !dbg !148
for.cond: ; preds = %for.inc, %entry
%5 = load i32, i32* %i, align 4, !dbg !149
%6 = load i32, i32* %N.addr, align 4, !dbg !152
%cmp = icmp slt i32 %5, %6, !dbg !153
br i1 %cmp, label %for.body, label %for.end, !dbg !154
for.body: ; preds = %for.cond
%7 = load i32, i32* %i, align 4, !dbg !155
%idxprom1 = sext i32 %7 to i64, !dbg !158
%8 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !158
%arrayidx2 = getelementptr inbounds %struct.vector3, %struct.vector3* %8, i64 %idxprom1, !dbg !158
%x3 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx2, i32 0, i32 0, !dbg !159
%9 = load i32, i32* %x3, align 4, !dbg !159
%10 = load i32, i32* %smallest, align 4, !dbg !160
%cmp4 = icmp slt i32 %9, %10, !dbg !161
br i1 %cmp4, label %if.then, label %if.end, !dbg !162
if.then: ; preds = %for.body
%11 = load i32, i32* %i, align 4, !dbg !163
store i32 %11, i32* %idx, align 4, !dbg !165
%12 = load i32, i32* %i, align 4, !dbg !166
%idxprom5 = sext i32 %12 to i64, !dbg !167
%13 = load %struct.vector3*, %struct.vector3** %vs.addr, align 8, !dbg !167
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %13, i64 %idxprom5, !dbg !167
%x7 = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx6, i32 0, i32 0, !dbg !168
%14 = load i32, i32* %x7, align 4, !dbg !168
store i32 %14, i32* %smallest, align 4, !dbg !169
br label %if.end, !dbg !170
if.end: ; preds = %if.then, %for.body
br label %for.inc, !dbg !171
for.inc: ; preds = %if.end
%15 = load i32, i32* %i, align 4, !dbg !172
%inc = add nsw i32 %15, 1, !dbg !172
store i32 %inc, i32* %i, align 4, !dbg !172
br label %for.cond, !dbg !174
for.end: ; preds = %for.cond
%16 = load i32, i32* %idx, align 4, !dbg !175
ret i32 %16, !dbg !176
}
; Function Attrs: nounwind uwtable
define internal %struct.vector3* @make_random_arr(i32 %N) #0 !dbg !22 {
entry:
%N.addr = alloca i32, align 4
%arr = alloca %struct.vector3*, align 8
%i = alloca i32, align 4
store i32 %N, i32* %N.addr, align 4
call void @llvm.dbg.declare(metadata i32* %N.addr, metadata !177, metadata !35), !dbg !178
call void @llvm.dbg.declare(metadata %struct.vector3** %arr, metadata !179, metadata !35), !dbg !180
%0 = load i32, i32* %N.addr, align 4, !dbg !181
%conv = sext i32 %0 to i64, !dbg !181
%mul = mul i64 12, %conv, !dbg !182
%call = call noalias i8* @malloc(i64 %mul) #4, !dbg !183
%1 = bitcast i8* %call to %struct.vector3*, !dbg !183
store %struct.vector3* %1, %struct.vector3** %arr, align 8, !dbg !180
call void @llvm.dbg.declare(metadata i32* %i, metadata !184, metadata !35), !dbg !186
store i32 0, i32* %i, align 4, !dbg !186
br label %for.cond, !dbg !187
for.cond: ; preds = %for.inc, %entry
%2 = load i32, i32* %i, align 4, !dbg !188
%3 = load i32, i32* %N.addr, align 4, !dbg !191
%cmp = icmp slt i32 %2, %3, !dbg !192
br i1 %cmp, label %for.body, label %for.end, !dbg !193
for.body: ; preds = %for.cond
%call2 = call i32 @rand() #4, !dbg !194
%rem = srem i32 %call2, 100, !dbg !196
%4 = load i32, i32* %i, align 4, !dbg !197
%idxprom = sext i32 %4 to i64, !dbg !198
%5 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !198
%arrayidx = getelementptr inbounds %struct.vector3, %struct.vector3* %5, i64 %idxprom, !dbg !198
%x = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx, i32 0, i32 0, !dbg !199
store i32 %rem, i32* %x, align 4, !dbg !200
%call3 = call i32 @rand() #4, !dbg !201
%rem4 = srem i32 %call3, 100, !dbg !202
%6 = load i32, i32* %i, align 4, !dbg !203
%idxprom5 = sext i32 %6 to i64, !dbg !204
%7 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !204
%arrayidx6 = getelementptr inbounds %struct.vector3, %struct.vector3* %7, i64 %idxprom5, !dbg !204
%y = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx6, i32 0, i32 1, !dbg !205
store i32 %rem4, i32* %y, align 4, !dbg !206
%call7 = call i32 @rand() #4, !dbg !207
%rem8 = srem i32 %call7, 100, !dbg !208
%8 = load i32, i32* %i, align 4, !dbg !209
%idxprom9 = sext i32 %8 to i64, !dbg !210
%9 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !210
%arrayidx10 = getelementptr inbounds %struct.vector3, %struct.vector3* %9, i64 %idxprom9, !dbg !210
%z = getelementptr inbounds %struct.vector3, %struct.vector3* %arrayidx10, i32 0, i32 2, !dbg !211
store i32 %rem8, i32* %z, align 4, !dbg !212
br label %for.inc, !dbg !213
for.inc: ; preds = %for.body
%10 = load i32, i32* %i, align 4, !dbg !214
%inc = add nsw i32 %10, 1, !dbg !214
store i32 %inc, i32* %i, align 4, !dbg !214
br label %for.cond, !dbg !216
for.end: ; preds = %for.cond
%11 = load %struct.vector3*, %struct.vector3** %arr, align 8, !dbg !217
ret %struct.vector3* %11, !dbg !218
}
; Function Attrs: nounwind
declare noalias i8* @malloc(i64) #3
; Function Attrs: nounwind
declare i32 @rand() #3
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** %argv) #0 !dbg !25 {
entry: