xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
double *make2Darray(int nrow, int ncol) {
  int len = nrow * ncol;
  double *array = (double *)malloc(len * sizeof(double));
  if (array == NULL) {
    printf("make2Darray failed in malloc");
  }
  return array;
}


x86 assembly (clang, -O0):
<make2Darray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1162 <make2Darray+0x42>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make2Darray>:
push   %rbx
imul   %esi,%edi
shl    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <make2Darray+0x20>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"make2Darray failed in malloc\00"
define double* @make2Darray(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 8
%13 = trunc i64 %12 to i32
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to double*
store double* %15, double** %6
%16 = load double*, double** %6
%17 = icmp eq double* %16, null
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %2
%21 = load double*, double** %6
ret double* %21
}

LLVM IR (-O2):
@.str = [29 x i8] c"make2Darray failed in malloc\00"
define double* @make2Darray(i32 %0, i32 %1) {
%3 = shl i32 %0, 3
%4 = mul i32 %3, %1
%5 = tail call i64 @malloc(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = inttoptr i64 %5 to double*
ret double* %10
}
test10(int x) {
  {
    int test10(int);
    do
      test10(x);
    while (x);
  }
  { return test10(x); }
}


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <test10@plt>
cmpl   $0x0,-0x4(%rbp)
jne    111b <test10+0xb>
mov    -0x4(%rbp),%edi
call   1030 <test10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
push   %rbx
mov    %edi,%ebx
call   1030 <test10@plt>
test   %ebx,%ebx
je     1122 <test10+0x12>
nopl   0x0(%rax)
jmp    1120 <test10+0x10>
xor    %edi,%edi
call   1030 <test10@plt>

LLVM IR (-O0):
define i32 @test10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = call i32 @test10(i32 %4)
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i32 @test10(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @test10(i32 %0) {
%2 = tail call i32 @test10(i32 %0)
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @test10(i32 0)
unreachable
6: ; preds = %1, %6
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_case_teardown(void **state) { printf("\n"); }


x86 assembly (clang, -O0):
<test_case_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_case_teardown>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @test_case_teardown(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @test_case_teardown(i8** nocapture readnone %0) {
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void syntax() { err(2, "syntax error"); }


x86 assembly (clang, -O0):
<syntax>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
call   1030 <err@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syntax>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <err@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"syntax error\00"
define void @syntax() {
%1 = call i32 @err(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"syntax error\00"
define void @syntax() {
%1 = tail call i32 @err(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int luvit_main(int, char **);
int main(int argc, char *argv[]) { return luvit_main(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <luvit_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <luvit_main@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @luvit_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @luvit_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
float cblas_scasum(int const, void const *, int const);
void acc_scasum_(const int *N, const void *X, const int *incX, float *result) {
  *result = cblas_scasum(*N, X, *incX);
}


x86 assembly (clang, -O0):
<acc_scasum_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <cblas_scasum@plt>
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acc_scasum_>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
call   1030 <cblas_scasum@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @acc_scasum_(i32* %0, i8* %1, i32* %2, float* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca float*
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store float* %3, float** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i8*, i8** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = call float @cblas_scasum(i32 %10, i8* %11, i32 %13)
%15 = load float*, float** %8
store float %14, float* %15
ret void
}

LLVM IR (-O2):
define void @acc_scasum_(i32* nocapture %0, i8* %1, i32* nocapture %2, float* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call float @cblas_scasum(i32 %5, i8* %1, i32 %6)
store float %7, float* %3
ret void
}
/* Variables and functions */
float asinf(float);
float libm_asinf(float x) { return asinf(x); }


x86 assembly (clang, -O0):
<libm_asinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libm_asinf>:
jmp    1030 <asinf@plt>

LLVM IR (-O0):
define float @libm_asinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @asinf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @libm_asinf(float %0) {
%2 = tail call float @asinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ print_backtrace();
int test_backtrace(int level) {
  if (--level == 0)
    print_backtrace();
  else
    test_backtrace(level);
  return 0;
}


x86 assembly (clang, -O0):
<test_backtrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1149 <test_backtrace+0x29>
mov    $0x0,%al
call   1030 <print_backtrace@plt>
jmp    1151 <test_backtrace+0x31>
mov    -0x4(%rbp),%edi
call   1040 <test_backtrace@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_backtrace>:
push   %rax
xor    %eax,%eax
call   1030 <print_backtrace@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_backtrace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @print_backtrace()
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @test_backtrace(i32 %9)
br label %11
11: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
define i32 @test_backtrace(i32 %0) {
%2 = tail call i32 (...) @print_backtrace()
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
};
struct event {
  int dummy;
};

/* Variables and functions */
int event_add(struct event *, struct timeval *);
int /*<<< orphan*/ timerclear(struct timeval *);
int bufferevent_add(struct event *ev, int timeout) {
  struct timeval tv, *ptv = NULL;
  if (timeout) {
    timerclear(&tv);
    tv.tv_sec = timeout;
    ptv = &tv;
  }
  return (event_add(ev, ptv));
}


x86 assembly (clang, -O0):
<bufferevent_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1158 <bufferevent_add+0x38>
lea    -0x10(%rbp),%rdi
call   1040 <timerclear@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <event_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufferevent_add>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
test   %esi,%esi
je     1144 <bufferevent_add+0x24>
mov    %esi,%ebp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <timerclear@plt>
mov    %ebp,0x8(%rsp)
jmp    1146 <bufferevent_add+0x26>
xor    %ebx,%ebx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <event_add@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.event = type { i32 }
%struct.timeval = type { i32 }
define i32 @bufferevent_add(%struct.event* %0, i32 %1) {
%3 = alloca %struct.event*
%4 = alloca i32
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval*
store %struct.event* %0, %struct.event** %3
store i32 %1, i32* %4
store %struct.timeval* null, %struct.timeval** %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @timerclear(%struct.timeval* %5)
%11 = load i32, i32* %4
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i32 %11, i32* %12
store %struct.timeval* %5, %struct.timeval** %6
br label %13
13: ; preds = %9, %2
%14 = load %struct.event*, %struct.event** %3
%15 = load %struct.timeval*, %struct.timeval** %6
%16 = call i32 @event_add(%struct.event* %14, %struct.timeval* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.event = type { i32 }
%struct.timeval = type { i32 }
define i32 @bufferevent_add(%struct.event* %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = icmp eq i32 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = call i32 @timerclear(%struct.timeval* %3)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 %1, i32* %8
br label %9
9: ; preds = %6, %2
%10 = phi %struct.timeval* [ %3, %6 ], [ null, %2 ]
%11 = call i32 @event_add(%struct.event* %0, %struct.timeval* %10)
ret i32 %11
}
/* Variables and functions */
int strlen(const char *str) {
  int i;
  for (i = 0; str[i]; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <strlen+0x34>
jmp    1126 <strlen+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %4
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
struct h2get_h2_header {
  int dummy;
};
struct h2get_ctx {
  int dummy;
};
struct h2get_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ h2get_buf_printf(struct h2get_buf *, char *, char *);
void h2get_frame_render_priority(struct h2get_ctx *ctx, struct h2get_buf *out,
                                 struct h2get_h2_header *h, char *p,
                                 size_t plen) {
  h2get_buf_printf(out, "\n%s",
                   "h2get_frame_"
                   "priority"
                   "_render");
}


x86 assembly (clang, -O0):
<h2get_frame_render_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    0xec6(%rip),%rdx
call   1030 <h2get_buf_printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2get_frame_render_priority>:
mov    %rsi,%rdi
lea    0xee6(%rip),%rsi
lea    0xee3(%rip),%rdx
jmp    1030 <h2get_buf_printf@plt>

LLVM IR (-O0):
%struct.h2get_ctx = type { i32 }
%struct.h2get_buf = type { i32 }
%struct.h2get_h2_header = type { i32 }
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [28 x i8] c"h2get_frame_priority_render\00"
define void @h2get_frame_render_priority(%struct.h2get_ctx* %0, %struct.h2get_buf* %1, %struct.h2get_h2_header* %2, i8* %3, i64 %4) {
%6 = alloca %struct.h2get_ctx*
%7 = alloca %struct.h2get_buf*
%8 = alloca %struct.h2get_h2_header*
%9 = alloca i8*
%10 = alloca i64
store %struct.h2get_ctx* %0, %struct.h2get_ctx** %6
store %struct.h2get_buf* %1, %struct.h2get_buf** %7
store %struct.h2get_h2_header* %2, %struct.h2get_h2_header** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load %struct.h2get_buf*, %struct.h2get_buf** %7
%12 = call i32 @h2get_buf_printf(%struct.h2get_buf* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.h2get_ctx = type { i32 }
%struct.h2get_buf = type { i32 }
%struct.h2get_h2_header = type { i32 }
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [28 x i8] c"h2get_frame_priority_render\00"
define void @h2get_frame_render_priority(%struct.h2get_ctx* nocapture readnone %0, %struct.h2get_buf* %1, %struct.h2get_h2_header* nocapture readnone %2, i8* nocapture readnone %3, i64 %4) {
%6 = tail call i32 @h2get_buf_printf(%struct.h2get_buf* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int IPC_EXCL;
int semget(int /*<<< orphan*/, int, int);
int sem_create(key_t key) {
  int sem;
  if ((sem = semget(key, 1, IPC_CREAT | IPC_EXCL | 0755)) == -1) {
    return -1;
  }
  return sem;
}


x86 assembly (clang, -O0):
<sem_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
mov    0x2ec2(%rip),%rax
or     (%rax),%edx
or     $0x1ed,%edx
mov    $0x1,%esi
call   1030 <semget@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1158 <sem_create+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <sem_create+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_create>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    0x2ed0(%rip),%rax
or     (%rax),%edx
or     $0x1ed,%edx
mov    $0x1,%esi
jmp    1030 <semget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
define i32 @sem_create(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @IPC_CREAT
%7 = load i32, i32* @IPC_EXCL
%8 = or i32 %6, %7
%9 = or i32 %8, 493
%10 = call i32 @semget(i32 %5, i32 1, i32 %9)
store i32 %10, i32* %4
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %15
13: ; preds = %1
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
define i32 @sem_create(i32 %0) {
%2 = load i32, i32* @IPC_CREAT
%3 = load i32, i32* @IPC_EXCL
%4 = or i32 %2, %3
%5 = or i32 %4, 493
%6 = tail call i32 @semget(i32 %0, i32 1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ RLIMIT_FSIZE;
int /*<<< orphan*/ cdecl_func__RLIMIT_FSIZE(int /*<<< orphan*/);
void cdecl_expr__RLIMIT_FSIZE() { cdecl_func__RLIMIT_FSIZE(RLIMIT_FSIZE); }


x86 assembly (clang, -O0):
<cdecl_expr__RLIMIT_FSIZE>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <cdecl_func__RLIMIT_FSIZE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdecl_expr__RLIMIT_FSIZE>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <cdecl_func__RLIMIT_FSIZE@plt>

LLVM IR (-O0):
@RLIMIT_FSIZE = global i32 0
define void @cdecl_expr__RLIMIT_FSIZE() {
%1 = load i32, i32* @RLIMIT_FSIZE
%2 = call i32 @cdecl_func__RLIMIT_FSIZE(i32 %1)
ret void
}

LLVM IR (-O2):
@RLIMIT_FSIZE = global i32 0
define void @cdecl_expr__RLIMIT_FSIZE() {
%1 = load i32, i32* @RLIMIT_FSIZE
%2 = tail call i32 @cdecl_func__RLIMIT_FSIZE(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int main() { print_int(2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <print_int@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @print_int(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_int(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ csendopen(char *);
void sing(char *idle) { csendopen(idle); }


x86 assembly (clang, -O0):
<sing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <csendopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sing>:
jmp    1030 <csendopen@plt>

LLVM IR (-O0):
define void @sing(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @csendopen(i8* %3)
ret void
}

LLVM IR (-O2):
define void @sing(i8* %0) {
%2 = tail call i32 @csendopen(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addFirst(char);
int /*<<< orphan*/ addLast(char);
char getLast();
int /*<<< orphan*/ removeLast();
scalar_t__ size();
void right(char ch) {
  if (size() > 0) {
    if (getLast() == ch) {
      removeLast();
    } else {
      addLast(ch);
    }
  } else {
    addFirst(ch);
  }
}


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <size@plt>
cmp    $0x0,%rax
jle    119f <right+0x4f>
mov    $0x0,%al
call   1060 <getLast@plt>
movsbl %al,%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1191 <right+0x41>
mov    $0x0,%al
call   1050 <removeLast@plt>
jmp    119a <right+0x4a>
movsbl -0x1(%rbp),%edi
call   1040 <addLast@plt>
jmp    11a8 <right+0x58>
movsbl -0x1(%rbp),%edi
call   1070 <addFirst@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <size@plt>
test   %rax,%rax
jle    1172 <right+0x22>
xor    %eax,%eax
call   1060 <getLast@plt>
cmp    %bl,%al
jne    117b <right+0x2b>
xor    %eax,%eax
pop    %rbx
jmp    1050 <removeLast@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1070 <addFirst@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1040 <addLast@plt>

LLVM IR (-O0):
define void @right(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i64 (...) @size()
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %17
5: ; preds = %1
%6 = call signext i8 (...) @getLast()
%7 = sext i8 %6 to i32
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = call i32 (...) @removeLast()
br label %16
13: ; preds = %5
%14 = load i8, i8* %2
%15 = call i32 @addLast(i8 signext %14)
br label %16
16: ; preds = %13, %11
br label %20
17: ; preds = %1
%18 = load i8, i8* %2
%19 = call i32 @addFirst(i8 signext %18)
br label %20
20: ; preds = %17, %16
ret void
}

LLVM IR (-O2):
define void @right(i8 signext %0) {
%2 = tail call i64 (...) @size()
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call signext i8 (...) @getLast()
%6 = icmp eq i8 %5, %0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @removeLast()
br label %13
9: ; preds = %4
%10 = tail call i32 @addLast(i8 signext %0)
br label %13
11: ; preds = %1
%12 = tail call i32 @addFirst(i8 signext %0)
br label %13
13: ; preds = %7, %9, %11
ret void
}
unsigned int sleep(unsigned int seconds) {
  ;
  return -1;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 -1
}

LLVM IR (-O2):
define i32 @sleep(i32 %0) {
ret i32 -1
}
int main() {
  int **matrix;
  int n, m, no_steps = 2;
  if (read_matrix(&matrix, &n, &m))
    return 9;
  print_matrix(matrix, n, m);
  return 0;
  for (int k = 0; k < no_steps; k++) {
    int min_i, min_j, max_i, max_j;
    find_min(matrix, n, m, &min_i, &min_j);
    find_max(matrix, n, m, &max_i, &max_j);
    printf("Lowest value: %d (%d %d) \n", matrix[min_i][min_j], min_i + 1,
           min_j + 1);
    printf("Highest value: %d (%d %d) \n", matrix[max_i][max_j], max_i + 1,
           max_j + 1);
    if (min_j == max_j) {
      delete_row(matrix, &n, max_i);
      delete_column(matrix, n, &m, min_j);
      print_matrix(matrix, n, m);
    } else {
      printf(
          "\n The lowest and the highest value are not on the same jj.\n \n");
    }
  }
  for (int i = 0; i < n; i++) {
    free(matrix[i]);
  }
  free(matrix);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x1c(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <read_matrix@plt>
cmp    $0x0,%eax
je     115e <main+0x3e>
movl   $0x9,-0x4(%rbp)
jmp    1176 <main+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    $0x0,%al
call   1040 <print_matrix@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1030 <read_matrix@plt>
mov    %eax,%ecx
mov    $0x9,%eax
test   %ecx,%ecx
je     114a <main+0x2a>
add    $0x18,%rsp
ret
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
xor    %eax,%eax
call   1040 <print_matrix@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %5
%6 = call i32 (i32***, i32*, i32*, ...) bitcast (i32 (...)* @read_matrix to i32 (i32***, i32*, i32*, ...)*)(i32*** %2, i32* %3, i32* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 9, i32* %1
br label %14
9: ; preds = %0
%10 = load i32**, i32*** %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 (i32**, i32, i32, ...) bitcast (i32 (...)* @print_matrix to i32 (i32**, i32, i32, ...)*)(i32** %10, i32 %11, i32 %12)
store i32 0, i32* %1
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32**
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32*** %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 (i32***, i32*, i32*, ...) bitcast (i32 (...)* @read_matrix to i32 (i32***, i32*, i32*, ...)*)(i32*** %1, i32* %2, i32* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i32**, i32*** %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i32**, i32, i32, ...) bitcast (i32 (...)* @print_matrix to i32 (i32**, i32, i32, ...)*)(i32** %10, i32 %11, i32 %12)
br label %14
14: ; preds = %0, %9
%15 = phi i32 [ 0, %9 ], [ 9, %0 ]
ret i32 %15
}
int sliding_scale(int dividend, int factor, int divisor) {
  double d = dividend;
  if (divisor) {
    d = (d * (double)factor) / (double)divisor;
    return (int)(d + 0.5);
  }
  return 0;
}


x86 assembly (clang, -O0):
<sliding_scale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1156 <sliding_scale+0x56>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebb(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <sliding_scale+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sliding_scale>:
test   %edx,%edx
je     1128 <sliding_scale+0x28>
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  %xmm0,%xmm1
addsd  0xedd(%rip),%xmm1
cvttsd2si %xmm1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sliding_scale(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
store double %10, double* %8
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %3
%14 = load double, double* %8
%15 = load i32, i32* %6
%16 = sitofp i32 %15 to double
%17 = fmul double %14, %16
%18 = load i32, i32* %7
%19 = sitofp i32 %18 to double
%20 = fdiv double %17, %19
store double %20, double* %8
%21 = load double, double* %8
%22 = fadd double %21, 5.000000e-01
%23 = fptosi double %22 to i32
store i32 %23, i32* %4
br label %25
24: ; preds = %3
store i32 0, i32* %4
br label %25
25: ; preds = %24, %13
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @sliding_scale(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = sitofp i32 %0 to double
%7 = sitofp i32 %1 to double
%8 = fmul double %6, %7
%9 = sitofp i32 %2 to double
%10 = fdiv double %8, %9
%11 = fadd double %10, 5.000000e-01
%12 = fptosi double %11 to i32
br label %13
13: ; preds = %3, %5
%14 = phi i32 [ %12, %5 ], [ 0, %3 ]
ret i32 %14
}
float findtfrom_a_vi_vf(float a, float vi, float vf) { return (vf - vi) / a; }


x86 assembly (clang, -O0):
<findtfrom_a_vi_vf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<findtfrom_a_vi_vf>:
subss  %xmm1,%xmm2
divss  %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @findtfrom_a_vi_vf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %5
%9 = fsub float %7, %8
%10 = load float, float* %4
%11 = fdiv float %9, %10
ret float %11
}

LLVM IR (-O2):
define float @findtfrom_a_vi_vf(float %0, float %1, float %2) {
%4 = fsub float %2, %1
%5 = fdiv float %4, %0
ret float %5
}
int f6(int x[][2][2]) { return x[2][3][1]; }


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    0x3c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f6([2 x [2 x i32]]* %0) {
%2 = alloca [2 x [2 x i32]]*
store [2 x [2 x i32]]* %0, [2 x [2 x i32]]** %2
%3 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %2
%4 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 2
%5 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 3
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f6([2 x [2 x i32]]* nocapture %0) {
%2 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %0, i64 2, i64 3, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int prefix_cmp(const char *s, const char *prefix) {
  return (strncmp(s, prefix, strlen(prefix)) == 0);
}


x86 assembly (clang, -O0):
<prefix_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_cmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @prefix_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @prefix_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void errh(char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<errh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errh>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @errh(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @errh(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void printUCharArray(unsigned char *array, int n) {
  int i;
  for (i = 0; i < n; ++i) {
    printf("%u,", array[i]);
  }
}


x86 assembly (clang, -O0):
<printUCharArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <printUCharArray+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printUCharArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUCharArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <printUCharArray+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printUCharArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u,\00"
define void @printUCharArray(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u,\00"
define void @printUCharArray(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ saxpy_(int *, float *, float *, int *, float *, int *);
void SAXPY(int ntot, float coeff, float *copy_from, int inc1, float *copy_to,
           int inc2) {
  saxpy_(&ntot, &coeff, copy_from, &inc1, copy_to, &inc2);
}


x86 assembly (clang, -O0):
<SAXPY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    -0x24(%rbp),%r9
call   1030 <saxpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SAXPY>:
sub    $0x18,%rsp
mov    %rcx,%r10
mov    %rsi,%rax
mov    %edi,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    %r8d,0x8(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r9
mov    %rax,%rdx
mov    %r10,%r8
call   1030 <saxpy_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @SAXPY(i32 %0, float %1, float* %2, i32 %3, float* %4, i32 %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float*
%10 = alloca i32
%11 = alloca float*
%12 = alloca i32
store i32 %0, i32* %7
store float %1, float* %8
store float* %2, float** %9
store i32 %3, i32* %10
store float* %4, float** %11
store i32 %5, i32* %12
%13 = load float*, float** %9
%14 = load float*, float** %11
%15 = call i32 @saxpy_(i32* %7, float* %8, float* %13, i32* %10, float* %14, i32* %12)
ret void
}

LLVM IR (-O2):
define void @SAXPY(i32 %0, float %1, float* %2, i32 %3, float* %4, i32 %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %7
store float %1, float* %8
store i32 %3, i32* %9
store i32 %5, i32* %10
%11 = call i32 @saxpy_(i32* %7, float* %8, float* %2, i32* %9, float* %4, i32* %10)
ret void
}
int do_148() { return 148; }


x86 assembly (clang, -O0):
<do_148>:
push   %rbp
mov    %rsp,%rbp
mov    $0x94,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_148>:
mov    $0x94,%eax
ret

LLVM IR (-O0):
define i32 @do_148() {
ret i32 148
}

LLVM IR (-O2):
define i32 @do_148() {
ret i32 148
}
/* Variables and functions */
int /*<<< orphan*/ glEnd();
void qglEnd(void) { glEnd(); }


x86 assembly (clang, -O0):
<qglEnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <glEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<qglEnd>:
xor    %eax,%eax
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
define void @qglEnd() {
%1 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
define void @qglEnd() {
%1 = tail call i32 (...) @glEnd()
ret void
}
void v2i_GENERAL_NAME_ex(void) {}


x86 assembly (clang, -O0):
<v2i_GENERAL_NAME_ex>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2i_GENERAL_NAME_ex>:
ret

LLVM IR (-O0):
define void @v2i_GENERAL_NAME_ex() {
ret void
}

LLVM IR (-O2):
define void @v2i_GENERAL_NAME_ex() {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1 && 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutStrokeString(void *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, float);
void glutStrokeFloat(void *fontface, float i) {
  char buf[64];
  snprintf(buf, 64, "%.2f", i);
  glutStrokeString(fontface, buf);
}


x86 assembly (clang, -O0):
<glutStrokeFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    $0x40,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <glutStrokeString@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glutStrokeFloat>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
lea    0xecf(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <glutStrokeString@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.2f\00"
define void @glutStrokeFloat(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca [64 x i8]
store i8* %0, i8** %3
store float %1, float* %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = load float, float* %4
%8 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = call i32 @glutStrokeString(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define void @glutStrokeFloat(i8* %0, float %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %1)
%6 = call i32 @glutStrokeString(i8* %0, i8* %4)
ret void
}
int compare_hex_id(const void *a, const void *b) {
  return (*(unsigned long int *)a - *(unsigned long int *)b);
}


x86 assembly (clang, -O0):
<compare_hex_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_hex_id>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_hex_id(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare_hex_id(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
int dummy_test1(int a, int b) { return (a + b); }


x86 assembly (clang, -O0):
<dummy_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_test1>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @dummy_test1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @dummy_test1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int main(void) {
  int a = a;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
store i32 %3, i32* %2
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
int strlen(char *);
char *last_char(char string[]) { return string + (strlen(string) - 1); }


x86 assembly (clang, -O0):
<last_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_char>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @last_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @last_char(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %5
}
cbuf22(f, n) int f, n;
{ cbuf(f, n, 22); }


x86 assembly (clang, -O0):
<cbuf22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x16,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf22>:
mov    $0x16,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf22(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 22)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf22(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 22)
ret i32 undef
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
void do_stuff() { printf("Thread %d: do_stuff\n", omp_get_thread_num()); }


x86 assembly (clang, -O0):
<do_stuff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stuff>:
push   %rax
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Thread %d: do_stuff\0A\00"
define void @do_stuff() {
%1 = call i32 (...) @omp_get_thread_num()
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Thread %d: do_stuff\0A\00"
define void @do_stuff() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
double SuperLU_timer_() {
  double tmp;
  tmp = 0.0;
  return (double)(tmp) / 60;
}


x86 assembly (clang, -O0):
<SuperLU_timer_>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee7(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SuperLU_timer_>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @SuperLU_timer_() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = load double, double* %1
%3 = fdiv double %2, 6.000000e+01
ret double %3
}

LLVM IR (-O2):
define double @SuperLU_timer_() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ terminal_writestring(char const *);
void kprint(const char *str) { terminal_writestring(str); }


x86 assembly (clang, -O0):
<kprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <terminal_writestring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprint>:
jmp    1030 <terminal_writestring@plt>

LLVM IR (-O0):
define void @kprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @terminal_writestring(i8* %3)
ret void
}

LLVM IR (-O2):
define void @kprint(i8* %0) {
%2 = tail call i32 @terminal_writestring(i8* %0)
ret void
}
/* Variables and functions */
char const *convert_significant_digits(int /*<<< orphan*/, long *const);
int /*<<< orphan*/ skip_zeroes(char const *);
const char *convert_digits(const char *s, long *const result) {
  return convert_significant_digits(skip_zeroes(s), result);
}


x86 assembly (clang, -O0):
<convert_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_zeroes@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <convert_significant_digits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_digits>:
push   %rbx
mov    %rsi,%rbx
call   1040 <skip_zeroes@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <convert_significant_digits@plt>

LLVM IR (-O0):
define i8* @convert_digits(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i8*, i8** %3
%6 = call i32 @skip_zeroes(i8* %5)
%7 = load i64*, i64** %4
%8 = call i8* @convert_significant_digits(i32 %6, i64* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @convert_digits(i8* %0, i64* %1) {
%3 = tail call i32 @skip_zeroes(i8* %0)
%4 = tail call i8* @convert_significant_digits(i32 %3, i64* %1)
ret i8* %4
}