xunge/DecIR huggingface dataset:
/* Variables and functions */
int asprintf(char **, char *, unsigned int);
char *strdup(char *);
char *print_number(unsigned int n) {
  char *tmp = NULL;
  if (asprintf(&tmp, "%u", n) < 1)
    return strdup("0");
  return tmp;
}


x86 assembly (clang, -O0):
<print_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <asprintf@plt>
cmp    $0x1,%eax
jge    1164 <print_number+0x44>
lea    0xead(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    116c <print_number+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_number>:
push   %rax
mov    %edi,%edx
movq   $0x0,(%rsp)
lea    0xece(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
test   %eax,%eax
jle    1144 <print_number+0x24>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xeb8(%rip),%rdi
call   1040 <strdup@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [2 x i8] c"0\00"
define i8* @print_number(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* null, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @asprintf(i8** %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i8* @strdup(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %2
br label %12
10: ; preds = %1
%11 = load i8*, i8** %4
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %8
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [2 x i8] c"0\00"
define i8* @print_number(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call dereferenceable_or_null(2) i8* @strdup(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = load i8*, i8** %2
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void strcpy_s(char *str, int length, char *cpy) {
  if (strlen(cpy) + 1 < length) {
    strcpy(str, cpy);
  } else {
    fprintf(stderr, "error copy oveflow: %s > %d", cpy, length);
  }
}


x86 assembly (clang, -O0):
<strcpy_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cmp    -0xc(%rbp),%eax
jge    116a <strcpy_s+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1186 <strcpy_s+0x56>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xe7f(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_s>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %rdx,%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cmp    %ebp,%eax
jge    115a <strcpy_s+0x2a>
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strcpy@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"error copy oveflow: %s > %d\00"
define void @strcpy_s(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = load i8*, i8** %6
%15 = call i32 @strcpy(i8* %13, i8* %14)
br label %21
16: ; preds = %3
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %6
%19 = load i32, i32* %5
%20 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %19)
br label %21
21: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"error copy oveflow: %s > %d\00"
define void @strcpy_s(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = add nsw i32 %4, 1
%6 = icmp slt i32 %5, %1
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @strcpy(i8* %0, i8* %2)
br label %12
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %1)
br label %12
12: ; preds = %9, %7
ret void
}
/* Type definitions */
typedef void *pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int /*<<< orphan*/ pthread_detach(void *);
void *pthread_self();
int /*<<< orphan*/ sleep(int);
void *job3(void *arg) {
  pthread_t pid = pthread_self();
  pthread_detach(pid);
  sleep(1);
  printf("job3: print %p\n", arg);
  printf("job3: pthread_self: %lu\n", pid);
  sleep(1);
  return arg;
}


x86 assembly (clang, -O0):
<job3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pthread_detach@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x8(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<job3>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <pthread_detach@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xe96(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"job3: print %p\0A\00"
@.str.1 = [25 x i8] c"job3: pthread_self: %lu\0A\00"
define i8* @job3(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* (...) @pthread_self()
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @pthread_detach(i8* %5)
%7 = call i32 @sleep(i32 1)
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 @sleep(i32 1)
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"job3: print %p\0A\00"
@.str.1 = [25 x i8] c"job3: pthread_self: %lu\0A\00"
define i8* @job3(i8* returned %0) {
%2 = tail call i8* (...) @pthread_self()
%3 = tail call i32 @pthread_detach(i8* %2)
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = tail call i32 @sleep(i32 1)
ret i8* %0
}
/* Variables and functions */
int *intersecao(int *a, size_t a_size, int *b, size_t b_size) { return NULL; }


x86 assembly (clang, -O0):
<intersecao>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intersecao>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @intersecao(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i64 %3, i64* %8
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @intersecao(i32* nocapture readnone %0, i64 %1, i32* nocapture readnone %2, i64 %3) {
ret i32* null
}
void test_cleanup_login_records(unsigned int *count, unsigned int *total) { ; }


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

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

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

LLVM IR (-O2):
define void @test_cleanup_login_records(i32* nocapture %0, i32* nocapture %1) {
ret void
}
int greater(double *a, double *b) { return (*a > *b); }


x86 assembly (clang, -O0):
<greater>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @greater(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp ogt double %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @greater(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ogt double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void pdrs_(x, y, z) short *x, *y, *z;
{ pdr((float)*x, (float)*y, (float)*z); }


x86 assembly (clang, -O0):
<pdrs_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <pdr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdrs_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
movswl (%rdx),%eax
cvtsi2sd %eax,%xmm2
mov    $0x3,%al
jmp    1030 <pdr@plt>

LLVM IR (-O0):
define void @pdrs_(i16* %0, i16* %1, i16* %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16*
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = sitofp i16 %8 to float
%10 = fpext float %9 to double
%11 = load i16*, i16** %5
%12 = load i16, i16* %11
%13 = sitofp i16 %12 to float
%14 = fpext float %13 to double
%15 = load i16*, i16** %6
%16 = load i16, i16* %15
%17 = sitofp i16 %16 to float
%18 = fpext float %17 to double
%19 = call i32 (double, double, double, ...) bitcast (i32 (...)* @pdr to i32 (double, double, double, ...)*)(double %10, double %14, double %18)
ret void
}

LLVM IR (-O2):
define void @pdrs_(i16* nocapture %0, i16* nocapture %1, i16* nocapture %2) {
%4 = load i16, i16* %0
%5 = sitofp i16 %4 to double
%6 = load i16, i16* %1
%7 = sitofp i16 %6 to double
%8 = load i16, i16* %2
%9 = sitofp i16 %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @pdr to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i;
  int max = atoi(argv[1]);
  for (i = 0; i < max; i++)
    printf("a%8.8d.example.com IN A\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1176 <main+0x56>
mov    -0x14(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
test   %eax,%eax
jle    1151 <main+0x31>
mov    %eax,%ebx
xor    %ebp,%ebp
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"a%8.8d.example.com IN A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %7
store i32 0, i32* %6
br label %12
12: ; preds = %19, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i32, i32* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %12
22: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"a%8.8d.example.com IN A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ 0, %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %5
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret i32 0
}
int fun_04(char *x) { return x[0] + x[1] + x[2] + x[3]; }


x86 assembly (clang, -O0):
<fun_04>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_04>:
movsbl (%rdi),%eax
movsbl 0x1(%rdi),%ecx
add    %eax,%ecx
movsbl 0x2(%rdi),%edx
add    %ecx,%edx
movsbl 0x3(%rdi),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @fun_04(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = add nsw i32 %6, %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = add nsw i32 %11, %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = add nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @fun_04(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, %3
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = add nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %0, i64 3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %11, %14
ret i32 %15
}
int fun615() { return 615; }


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

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

LLVM IR (-O0):
define i32 @fun615() {
ret i32 615
}

LLVM IR (-O2):
define i32 @fun615() {
ret i32 615
}
int control(int cmd, void *arg) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @control(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
void Mix_QuitMP3() {}


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

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

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

LLVM IR (-O2):
define void @Mix_QuitMP3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_name(char *name) {
  write("json-task.json", "\"name\":\"%s\", ", name);
}


x86 assembly (clang, -O0):
<function_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [14 x i8] c"\22name\22:\22%s\22, \00"
define void @function_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [14 x i8] c"\22name\22:\22%s\22, \00"
define void @function_name(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int libmesh_C_isnan_double(double a) { return (a != a); }


x86 assembly (clang, -O0):
<libmesh_C_isnan_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libmesh_C_isnan_double>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @libmesh_C_isnan_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @libmesh_C_isnan_double(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int topSubmissoes(FILE *f) { return 0; }


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

x86 assembly (clang, -O2):
<topSubmissoes>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @topSubmissoes(i32* nocapture readnone %0) {
ret i32 0
}
int _mpylir(int src1, int src2) {
  short s1 = src1;
  long long result = ((long long)src2) * s1 + (1 << 14);
  result >>= 15;
  return result;
}


x86 assembly (clang, -O0):
<_mpylir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,-0xa(%rbp)
movslq -0x8(%rbp),%rax
movswq -0xa(%rbp),%rcx
imul   %rcx,%rax
add    $0x4000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sar    $0xf,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpylir>:
movslq %esi,%rcx
movswq %di,%rax
imul   %rcx,%rax
add    $0x4000,%rax
shr    $0xf,%rax
ret

LLVM IR (-O0):
define i32 @_mpylir(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = trunc i32 %7 to i16
store i16 %8, i16* %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = load i16, i16* %5
%12 = sext i16 %11 to i64
%13 = mul nsw i64 %10, %12
%14 = add nsw i64 %13, 16384
store i64 %14, i64* %6
%15 = load i64, i64* %6
%16 = ashr i64 %15, 15
store i64 %16, i64* %6
%17 = load i64, i64* %6
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @_mpylir(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = shl i64 %3, 48
%6 = ashr exact i64 %5, 48
%7 = mul nsw i64 %6, %4
%8 = add nsw i64 %7, 16384
%9 = lshr i64 %8, 15
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Variables and functions */
int dbar(double, double);
int dv(double, double);
int sb(double, double);
int ubar(double, double);
double F2_cc_nu_p(double xx, double Q2) {
  return 2 * (dv(xx, Q2) + sb(xx, Q2) + dbar(xx, Q2) + ubar(xx, Q2));
}


x86 assembly (clang, -O0):
<F2_cc_nu_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <dv@plt>
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <sb@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1060 <dbar@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <ubar@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F2_cc_nu_p>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1050 <dv@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <sb@plt>
mov    %eax,%ebp
add    %ebx,%ebp
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1060 <dbar@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <ubar@plt>
add    %ebx,%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @F2_cc_nu_p(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @dv(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i32 @sb(double %8, double %9)
%11 = add nsw i32 %7, %10
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call i32 @dbar(double %12, double %13)
%15 = add nsw i32 %11, %14
%16 = load double, double* %3
%17 = load double, double* %4
%18 = call i32 @ubar(double %16, double %17)
%19 = add nsw i32 %15, %18
%20 = mul nsw i32 2, %19
%21 = sitofp i32 %20 to double
ret double %21
}

LLVM IR (-O2):
define double @F2_cc_nu_p(double %0, double %1) {
%3 = tail call i32 @dv(double %0, double %1)
%4 = tail call i32 @sb(double %0, double %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @dbar(double %0, double %1)
%7 = add nsw i32 %5, %6
%8 = tail call i32 @ubar(double %0, double %1)
%9 = add nsw i32 %7, %8
%10 = shl nsw i32 %9, 1
%11 = sitofp i32 %10 to double
ret double %11
}
void dropme1() {}


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

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

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

LLVM IR (-O2):
define void @dropme1() {
ret void
}
unsigned int Reverse3(unsigned int x) {
  return ((x & 0x0000ff00) << 8) | ((x & 0x00ff0000) >> 8) |
         ((x & 0xff000000) >> 24) | ((x & 0x000000ff) << 24);
}


x86 assembly (clang, -O0):
<Reverse3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reverse3>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @Reverse3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, -16777216
%12 = lshr i32 %11, 24
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @Reverse3(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ power_touch_panel(int);
void _backlight_on(void) {
  (*(volatile unsigned long *)0x80000330) |= 0x2;
  power_touch_panel(true);
}


x86 assembly (clang, -O0):
<_backlight_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000330,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0x80000330,%eax
mov    %rcx,(%rax)
mov    $0x1,%edi
call   1030 <power_touch_panel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_backlight_on>:
mov    $0x80000330,%eax
orq    $0x2,(%rax)
mov    $0x1,%edi
jmp    1030 <power_touch_panel@plt>

LLVM IR (-O0):
define void @_backlight_on() {
%1 = load volatile i64, i64* inttoptr (i64 2147484464 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 2147484464 to i64*)
%3 = call i32 @power_touch_panel(i32 1)
ret void
}

LLVM IR (-O2):
define void @_backlight_on() {
%1 = load volatile i64, i64* inttoptr (i64 2147484464 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 2147484464 to i64*)
%3 = tail call i32 @power_touch_panel(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, long);
long fibonacci2(int n) {
  long x = 0, y = 1, z;
  while (n) {
    z = x + y;
    x = y;
    y = z;
    n = n - 1;
    printf("%d: %ld\n", n, x);
  }
  return x;
}


x86 assembly (clang, -O0):
<fibonacci2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1172 <fibonacci2+0x62>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <fibonacci2+0x1b>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1152 <fibonacci2+0x42>
mov    %edi,%r15d
add    $0xffffffff,%r15d
mov    $0x1,%eax
xor    %ebx,%ebx
lea    0xed0(%rip),%r14
mov    %rax,%rbp
add    %rax,%rbx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rax
mov    %rbp,%rbx
add    $0xffffffff,%r15d
jb     1130 <fibonacci2+0x20>
jmp    1154 <fibonacci2+0x44>
xor    %ebp,%ebp
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d: %ld\0A\00"
define i64 @fibonacci2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 1, %1 ]
%6 = phi i64 [ %5, %3 ], [ 0, %1 ]
%7 = add nsw i64 %5, %6
%8 = add nsw i32 %4, -1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8, i64 %5)
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %5, %3 ]
ret i64 %12
}
/* Variables and functions */
char *cvector(size_t const);
int /*<<< orphan*/ memcpy(char *, char const *, size_t const);
char *clone_cvector(const char *v, const size_t n) {
  char *clone = cvector(n);
  memcpy(clone, v, n * sizeof(char));
  return clone;
}


x86 assembly (clang, -O0):
<clone_cvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cvector@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
shl    $0x0,%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clone_cvector>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <cvector@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @clone_cvector(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @cvector(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = mul i64 %10, 1
%12 = call i32 @memcpy(i8* %8, i8* %9, i64 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @clone_cvector(i8* %0, i64 %1) {
%3 = tail call i8* @cvector(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
void change_arr_str_other(char *arr, char replaceStr, int len) {
  int temp;
  for (temp = 0; temp < len; temp++) {
    arr[temp] = replaceStr;
  }
}


x86 assembly (clang, -O0):
<change_arr_str_other>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1140 <change_arr_str_other+0x40>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <change_arr_str_other+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_arr_str_other>:
test   %edx,%edx
jle    1124 <change_arr_str_other+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @change_arr_str_other(i8* nocapture writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
unsigned int fib(unsigned int n) {
  if (n == 0 || n == 1) {
    return n;
  }
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <fib+0x1f>
cmpl   $0x1,-0x8(%rbp)
jne    113a <fib+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <fib+0x4d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fib+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fib+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %19
11: ; preds = %6
%12 = load i32, i32* %3
%13 = sub i32 %12, 1
%14 = call i32 @fib(i32 %13)
%15 = load i32, i32* %3
%16 = sub i32 %15, 2
%17 = call i32 @fib(i32 %16)
%18 = add i32 %14, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %11, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add i32 %4, -2
%9 = add i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add i32 %13, %12
ret i32 %14
}
void sig_sigusr1() { return; }


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

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

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

LLVM IR (-O2):
define void @sig_sigusr1() {
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
int s_thread_pthreads_thread_self(void) { return (int)pthread_self(); }


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

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

LLVM IR (-O0):
define i32 @s_thread_pthreads_thread_self() {
%1 = call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @s_thread_pthreads_thread_self() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
size_t strlen(char *);
void strlen_constant_Bad() {
  int a[5];
  char *s = "hello";
  a[strlen(s)] = 0;
}


x86 assembly (clang, -O0):
<strlen_constant_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
movl   $0x0,-0x20(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define void @strlen_constant_Bad() {
%1 = alloca [5 x i32]
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %4
store i32 0, i32* %5
ret void
}

LLVM IR (-O2):
define void @strlen_constant_Bad() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ set_rounding(int /*<<< orphan*/ const *);
void mul_s(const uint32_t *fcr31, const float *source1, const float *source2,
           float *target) {
  set_rounding(fcr31);
  *target = *source1 * *source2;
}


x86 assembly (clang, -O0):
<mul_s>:
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),%rdi
call   1030 <set_rounding@plt>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mulss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_s>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
call   1030 <set_rounding@plt>
movss  (%rbx),%xmm0
mulss  (%r15),%xmm0
movss  %xmm0,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @mul_s(i32* %0, float* nocapture %1, float* nocapture %2, float* nocapture writeonly %3) {
%5 = tail call i32 @set_rounding(i32* %0)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fmul float %6, %7
store float %8, float* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g();
f(int a) {
  if (0) {
    int x;
    g();
  l:
    x = 3;
    return x;
  }
  if (a)
    goto l;
  return 5;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    112a <f+0x1a>
jmp    1143 <f+0x33>
mov    $0x0,%al
call   1030 <g@plt>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <f+0x49>
cmpl   $0x0,-0x8(%rbp)
je     1152 <f+0x42>
jmp    1131 <f+0x21>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
add    %eax,%eax
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 5, i32 3
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ core7_swap(char *, int);
void U_EMRMOVETOEX_swap(char *record, int torev) { core7_swap(record, torev); }


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

x86 assembly (clang, -O2):
<U_EMRMOVETOEX_swap>:
jmp    1030 <core7_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRMOVETOEX_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core7_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
size_t piece_y(char **piece) {
  int y;
  y = 0;
  while (piece[y])
    y++;
  return (y);
}


x86 assembly (clang, -O0):
<piece_y>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <piece_y+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <piece_y+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<piece_y>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <piece_y+0x10>
mov    %eax,%eax
ret

LLVM IR (-O0):
define i64 @piece_y(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %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, null
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
ret i64 %16
}

LLVM IR (-O2):
define i64 @piece_y(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, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ one;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IP_HDRINCL;
int /*<<< orphan*/ printf(char *);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
void socket_iphdrincl(int sd) {
  const int one = 1;
  if (setsockopt(sd, IPPROTO_IP, IP_HDRINCL, (char *)&one, sizeof(one)) == -1) {
    printf("[socket_broadcast] can't set IP_HDRINCL option\n");
  }
}


x86 assembly (clang, -O0):
<socket_iphdrincl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    116b <socket_iphdrincl+0x4b>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_iphdrincl>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     1152 <socket_iphdrincl+0x32>
pop    %rax
ret
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@.str = [48 x i8] c"[socket_broadcast] can't set IP_HDRINCL option\0A\00"
define void @socket_iphdrincl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_IP
%6 = load i32, i32* @IP_HDRINCL
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@str = [47 x i8] c"[socket_broadcast] can't set IP_HDRINCL option\00"
define void @socket_iphdrincl(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_IP
%5 = load i32, i32* @IP_HDRINCL
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
void test(void) {
  do {
    do {
      volatile double a = 1.5, b;
      b = __builtin_rint(a);
    } while (0);
    do {
      volatile float a = 1.5, b;
      b = __builtin_rintf(a);
    } while (0);
  } while (0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
jmp    112d <test+0xd>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <rint@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    114e <test+0x2e>
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <rintf@plt>
movss  %xmm0,-0x18(%rbp)
jmp    116f <test+0x4f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x18,%rsp
movabs $0x3ff8000000000000,%rax
mov    %rax,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <rint@plt>
movsd  %xmm0,0x10(%rsp)
movl   $0x3fc00000,0x8(%rsp)
3f
movss  0x8(%rsp),%xmm0
call   1040 <rintf@plt>
movss  %xmm0,0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca double
%2 = alloca double
%3 = alloca float
%4 = alloca float
br label %5
5: ; preds = %0
br label %6
6: ; preds = %5
store volatile double 1.500000e+00, double* %1
%7 = load volatile double, double* %1
%8 = call double @llvm.rint.f64(double %7)
store volatile double %8, double* %2
br label %9
9: ; preds = %6
br label %10
10: ; preds = %9
store volatile float 1.500000e+00, float* %3
%11 = load volatile float, float* %3
%12 = call float @llvm.rint.f32(float %11)
store volatile float %12, float* %4
br label %13
13: ; preds = %10
br label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca double
%2 = alloca double
%3 = alloca float
%4 = alloca float
%5 = bitcast double* %1 to i8*
store volatile double 1.500000e+00, double* %1
%6 = bitcast double* %2 to i8*
%7 = load volatile double, double* %1
%8 = tail call double @llvm.rint.f64(double %7)
store volatile double %8, double* %2
%9 = bitcast float* %3 to i8*
store volatile float 1.500000e+00, float* %3
%10 = bitcast float* %4 to i8*
%11 = load volatile float, float* %3
%12 = tail call float @llvm.rint.f32(float %11)
store volatile float %12, float* %4
ret void
}
/* Variables and functions */
char *arg(int);
int /*<<< orphan*/ result(int);
size() {
  int i;
  char *p;
  i = 0;
  p = arg(1);
  while (*p++ != 0)
    i++;
  result(i);
}


x86 assembly (clang, -O0):
<size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <arg@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <size+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <size+0x1d>
mov    -0x8(%rbp),%edi
call   1040 <result@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size>:
push   %rax
mov    $0x1,%edi
call   1030 <arg@plt>
cmpb   $0x0,(%rax)
je     1151 <size+0x31>
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,0x1(%rax,%rdi,1)
lea    0x1(%rdi),%rdi
jne    1140 <size+0x20>
pop    %rax
jmp    1040 <result@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <result@plt>

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

LLVM IR (-O2):
define i32 @size() {
%1 = tail call i8* @arg(i32 1)
%2 = load i8, i8* %1
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i8* [ %7, %4 ], [ %1, %0 ]
%6 = phi i32 [ %8, %4 ], [ 0, %0 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %0
%12 = phi i32 [ 0, %0 ], [ %8, %4 ]
%13 = tail call i32 @result(i32 %12)
ret i32 undef
}