xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Haha();
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char *buffer;
  buffer = (char *)malloc(64);
  strcpy(buffer, "abc");
  printf("%s\n", buffer);
  Haha();
  printf("returned from haha & bar.\n");
  free(buffer);
  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    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <Haha@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <Haha@plt>
lea    0xe81(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [27 x i8] c"returned from haha & bar.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @malloc(i32 64)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 (...) @Haha()
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@str = [26 x i8] c"returned from haha & bar.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 64)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
%7 = tail call i32 (...) @Haha()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @free(i8* %4)
ret i32 0
}
double df(double x) { return 2 * (x + 4); }


x86 assembly (clang, -O0):
<df>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<df>:
addsd  0xef8(%rip),%xmm0
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @df(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 4.000000e+00
%5 = fmul double 2.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @df(double %0) {
%2 = fadd double %0, 4.000000e+00
%3 = fmul double %2, 2.000000e+00
ret double %3
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *lskip(const char *s) {
  while (*s && isspace(*s))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<lskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <lskip+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <lskip+0x47>
jmp    1168 <lskip+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lskip+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lskip>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <lskip+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <lskip+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lskip+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @lskip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @lskip(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
void loadClkCtrlDriver(void) {}


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

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

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

LLVM IR (-O2):
define void @loadClkCtrlDriver() {
ret void
}
/* Variables and functions */
void *itop(intptr_t i) { return (void *)i; }


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

x86 assembly (clang, -O2):
<itop>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @itop(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @itop(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ sig_unblock(int /*<<< orphan*/);
extern void sig_pipe_unblock(void) { sig_unblock(SIGPIPE); }


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

x86 assembly (clang, -O2):
<sig_pipe_unblock>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_unblock@plt>

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

LLVM IR (-O2):
@SIGPIPE = global i32 0
define void @sig_pipe_unblock() {
%1 = load i32, i32* @SIGPIPE
%2 = tail call i32 @sig_unblock(i32 %1)
ret void
}
int exact_spuare(int n) {
  int i = 1, b, c = 0;
  while (c == 0 || i <= n) {
    b = i * i;
    if (b == n) {
      c = 1;
    }
    i++;
  }
  return c;
}


x86 assembly (clang, -O0):
<exact_spuare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1130 <exact_spuare+0x30>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1140 <exact_spuare+0x40>
jmp    116b <exact_spuare+0x6b>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    115d <exact_spuare+0x5d>
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <exact_spuare+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @exact_spuare(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 0, i32* %5
br label %6
6: ; preds = %23, %1
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp sle i32 %10, %11
br label %13
13: ; preds = %9, %6
%14 = phi i1 [ true, %6 ], [ %12, %9 ]
br i1 %14, label %15, label %26
15: ; preds = %13
%16 = load i32, i32* %3
%17 = load i32, i32* %3
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = load i32, i32* %2
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %15
store i32 1, i32* %5
br label %23
23: ; preds = %22, %15
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %6
26: ; preds = %13
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @exact_spuare(i32 %0) {
ret i32 1
}
int compare_int_keys(void *key1, void *key2) {
  int key1_v = *((int *)key1);
  int key2_v = *((int *)key2);
  if (key1_v <= key2_v)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_int_keys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1136 <compare_int_keys+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <compare_int_keys+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int_keys>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @compare_int_keys(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sle i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
#define SIGCHLD 133
#define SIGHUP 132
#define SIGINT 131
#define SIGPIPE 130
#define SIGQUIT 129
#define SIGTERM 128
bool blocked_signal(int num) {
  switch (num) {
  case SIGINT:
  case SIGHUP:
  case SIGQUIT:
  case SIGTERM:
  case SIGPIPE:
  case SIGCHLD:
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<blocked_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x5,%eax
ja     1127 <blocked_signal+0x27>
jmp    111b <blocked_signal+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <blocked_signal+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blocked_signal>:
add    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x6,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @blocked_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 131, label %5
i32 132, label %5
i32 129, label %5
i32 128, label %5
i32 130, label %5
i32 133, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @blocked_signal(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 6
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ test_case();
scalar_t__ test_case2();
scalar_t__ test_default();
int test() {
  if (test_case() != 0)
    return 1;
  if (test_case2() != 0)
    return 1;
  if (test_default() != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <test_case@plt>
cmp    $0x0,%rax
je     1155 <test+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1196 <test+0x66>
mov    $0x0,%al
call   1040 <test_case2@plt>
cmp    $0x0,%rax
je     1172 <test+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1196 <test+0x66>
mov    $0x0,%al
call   1050 <test_default@plt>
cmp    $0x0,%rax
je     118f <test+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1196 <test+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
xor    %eax,%eax
call   1030 <test_case@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115d <test+0x2d>
xor    %eax,%eax
call   1040 <test_case2@plt>
test   %rax,%rax
jne    115d <test+0x2d>
xor    %eax,%eax
call   1050 <test_default@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i64 (...) @test_case()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 (...) @test_case2()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 (...) @test_default()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %0 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
void *pattern_search(void const *, int, int, int, int);
void *push_r4_r7_lr_search_up(const void *start_addr, int len) {
  return pattern_search(start_addr, len, 0x0000B5F0, 0x0000FFFF, -2);
}


x86 assembly (clang, -O0):
<push_r4_r7_lr_search_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xb5f0,%edx
mov    $0xffff,%ecx
mov    $0xfffffffe,%r8d
call   1030 <pattern_search@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_r4_r7_lr_search_up>:
mov    $0xb5f0,%edx
mov    $0xffff,%ecx
mov    $0xfffffffe,%r8d
jmp    1030 <pattern_search@plt>

LLVM IR (-O0):
define i8* @push_r4_r7_lr_search_up(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 i8* @pattern_search(i8* %5, i32 %6, i32 46576, i32 65535, i32 -2)
ret i8* %7
}

LLVM IR (-O2):
define i8* @push_r4_r7_lr_search_up(i8* %0, i32 %1) {
%3 = tail call i8* @pattern_search(i8* %0, i32 %1, i32 46576, i32 65535, i32 -2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  struct {
  } a;
  if (0 != sizeof a)
    abort();
}


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

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

LLVM IR (-O0):
%struct.anon = type {}
define i32 @main() {
%1 = alloca %struct.anon
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type {}
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ the_static_function();
void the_function() { the_static_function(); }


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

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

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

LLVM IR (-O2):
define void @the_function() {
%1 = tail call i32 (...) @the_static_function()
ret void
}
unsigned int PCGetContainerUpdateID(const char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PCGetContainerUpdateID(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int random();
int dice(int number, int size) {
  int r;
  int sum = 0;
  assert(size >= 1);
  for (r = 1; r <= number; r++)
    sum += ((random() % size) + 1);
  return (sum);
}


x86 assembly (clang, -O0):
<dice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     117d <dice+0x5d>
mov    $0x0,%al
call   1040 <random@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <dice+0x2d>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dice>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %edi,%edi
test   %esi,%esi
setg   %dil
call   1030 <assert@plt>
xor    %ebx,%ebx
test   %ebp,%ebp
jle    1155 <dice+0x35>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <random@plt>
cltd
idiv   %r14d
add    %edx,%ebx
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1140 <dice+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dice(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
store i32 1, i32* %5
br label %11
11: ; preds = %22, %2
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = call i32 (...) @random()
%17 = load i32, i32* %4
%18 = srem i32 %16, %17
%19 = add nsw i32 %18, 1
%20 = load i32, i32* %6
%21 = add nsw i32 %20, %19
store i32 %21, i32* %6
br label %22
22: ; preds = %15
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %11
25: ; preds = %11
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
define i32 @dice(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp slt i32 %0, 1
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %13, %7 ], [ 0, %2 ]
%9 = phi i32 [ %14, %7 ], [ 1, %2 ]
%10 = tail call i32 (...) @random()
%11 = srem i32 %10, %1
%12 = add i32 %8, 1
%13 = add i32 %12, %11
%14 = add nuw i32 %9, 1
%15 = icmp eq i32 %9, %0
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i32 [ 0, %2 ], [ %13, %7 ]
ret i32 %17
}
int nn_xpair_ispeer(int socktype) { return socktype == (1 * 16 + 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<nn_xpair_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x10,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_xpair_ispeer>:
xor    %eax,%eax
cmp    $0x10,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @nn_xpair_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 16
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @nn_xpair_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 16
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setstacksize(pthread_attr_t *__attr, size_t __stacksize) {
  ;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_setstacksize(i32* nocapture readnone %0, i64 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ send(char const);
void send_string(const char *s) {
  if (0)
    send(*s & 255);
  else
    for (; *s; ++s)
      send(*s & 255);
}


x86 assembly (clang, -O0):
<send_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <send_string+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
movsbl %al,%edi
call   1030 <send@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <send_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <send_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <send@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <send_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @send_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @send(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void trace(void *v, const char *sql) { printf("TRACE: %s\n", sql); }


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

x86 assembly (clang, -O2):
<trace>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"TRACE: %s\0A\00"
define void @trace(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void redecl3() {}


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

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

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

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

/* Variables and functions */
void encode_32(u_int8_t *cp, u_int32_t x) {
  *cp++ = x >> 24;
  *cp++ = (x >> 16) & 0xff;
  *cp++ = (x >> 8) & 0xff;
  *cp = x & 0xff;
}


x86 assembly (clang, -O0):
<encode_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
sar    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @encode_32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %3
store i32 %6, i32* %7
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %3
store i32 %11, i32* %12
%14 = load i32, i32* %4
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %3
store i32 %16, i32* %17
%19 = load i32, i32* %4
%20 = and i32 %19, 255
%21 = load i32*, i32** %3
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @encode_32(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %0
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %4
%8 = lshr i32 %1, 8
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %9, i32* %7
%11 = and i32 %1, 255
store i32 %11, i32* %10
ret void
}
void disable_button_interrupt(void) {
  (*(volatile unsigned long *)(((0xFFFFF000) + 0x014))) = 0x08000;
  (*(volatile unsigned long *)((0xE002C000))) =
      ((*(volatile unsigned long *)((0xE002C000))) & ~0x30000000);
  (*(volatile unsigned long *)((0xE01FC140))) = 0x2;
}


x86 assembly (clang, -O0):
<disable_button_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff014,%eax
movq   $0x8000,(%rax)
mov    $0xe002c000,%eax
mov    (%rax),%rcx
and    $0xffffffffcfffffff,%rcx
mov    $0xe002c000,%eax
mov    %rcx,(%rax)
mov    $0xe01fc140,%eax
movq   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_button_interrupt>:
mov    $0xe002c000,%eax
movq   $0x8000,0x1ffd3014(%rax)
andq   $0xffffffffcfffffff,(%rax)
movq   $0x2,0x1d0140(%rax)
ret

LLVM IR (-O0):
define void @disable_button_interrupt() {
store volatile i64 32768, i64* inttoptr (i64 4294963220 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 3758276608 to i64*)
%2 = and i64 %1, -805306369
store volatile i64 %2, i64* inttoptr (i64 3758276608 to i64*)
store volatile i64 2, i64* inttoptr (i64 3760177472 to i64*)
ret void
}

LLVM IR (-O2):
define void @disable_button_interrupt() {
store volatile i64 32768, i64* inttoptr (i64 4294963220 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 3758276608 to i64*)
%2 = and i64 %1, -805306369
store volatile i64 %2, i64* inttoptr (i64 3758276608 to i64*)
store volatile i64 2, i64* inttoptr (i64 3760177472 to i64*)
ret void
}
/* Variables and functions */
int __simc(int, int, int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int simc_open(const char *file, int flags, int mode) {
  return __simc(5, (int)file, flags, mode, 0, 0);
}


x86 assembly (clang, -O0):
<simc_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x5,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <__simc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simc_open>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x5,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <__simc@plt>

LLVM IR (-O0):
define i32 @simc_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @__simc(i32 5, i32 %8, i32 %9, i32 %10, i32 0, i32 0)
ret i32 %11
}

LLVM IR (-O2):
define i32 @simc_open(i8* %0, i32 %1, i32 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @__simc(i32 5, i32 %5, i32 %1, i32 %2, i32 0, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t const);
size_t strlen(char const *);
char *strcpy(char *__restrict dst, const char *__restrict src) {
  const size_t length = strlen(src);
  memcpy(dst, src, length + 1);
  return dst;
}


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

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <memcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned %0, i8* noalias %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add i64 %3, 1
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %4)
ret i8* %0
}
void g_key_file_get_start_group() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_get_start_group() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(_Bool);
void verify_assume(_Bool expression) { assert(expression); }


x86 assembly (clang, -O0):
<verify_assume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_assume>:
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @verify_assume(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = call i32 @assert(i1 zeroext %5)
ret void
}

LLVM IR (-O2):
define void @verify_assume(i1 zeroext %0) {
%2 = tail call i32 @assert(i1 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void abort(void) {
  printf("Aborted.");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <abort+0x10>

x86 assembly (clang, -O2):
<abort>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
jmp    1120 <abort+0x10>

LLVM IR (-O0):
@.str = [9 x i8] c"Aborted.\00"
define void @abort() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [9 x i8] c"Aborted.\00"
define void @abort() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setMIDIDrawBar(struct b_tonegen *, int, unsigned char);
void setDrawbar5(void *d, unsigned char v) {
  setMIDIDrawBar((struct b_tonegen *)d, 5, v);
}


x86 assembly (clang, -O0):
<setDrawbar5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
movzbl -0x9(%rbp),%edx
call   1030 <setMIDIDrawBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDrawbar5>:
mov    %esi,%edx
mov    $0x5,%esi
jmp    1030 <setMIDIDrawBar@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setDrawbar5(i8* %0, i8 zeroext %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 %struct.b_tonegen*
%7 = load i8, i8* %4
%8 = call i32 @setMIDIDrawBar(%struct.b_tonegen* %6, i32 5, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setDrawbar5(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = tail call i32 @setMIDIDrawBar(%struct.b_tonegen* %3, i32 5, i8 zeroext %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_cancel(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, void **);
void cancel_log_thread(pthread_t thread) {
  void *join_retval;
  int ret;
  ret = pthread_cancel(thread);
  if (ret) {
    return;
  }
  pthread_join(thread, &join_retval);
}


x86 assembly (clang, -O0):
<cancel_log_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pthread_cancel@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1145 <cancel_log_thread+0x25>
jmp    1151 <cancel_log_thread+0x31>
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <pthread_join@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cancel_log_thread>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
call   1040 <pthread_cancel@plt>
test   %eax,%eax
jne    113c <cancel_log_thread+0x1c>
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
call   1030 <pthread_join@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cancel_log_thread(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = tail call i32 @pthread_cancel(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @pthread_join(i32 %0, i8** %2)
br label %8
8: ; preds = %1, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_SET_HUM_PWR_PIN();
void HUMIDITY_SET_PWR() { TOSH_SET_HUM_PWR_PIN(); }


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_SET_PWR() {
%1 = tail call i32 (...) @TOSH_SET_HUM_PWR_PIN()
ret void
}
int test06(int *a, char *b, int c, int d) {
  if (*a & *b)
    return c;
  return d;
}


x86 assembly (clang, -O0):
<test06>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1135 <test06+0x35>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <test06+0x3b>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test06>:
mov    %edx,%eax
movsbl (%rsi),%edx
test   %edx,(%rdi)
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test06(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i8*, i8** %7
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = and i32 %11, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = load i32, i32* %8
store i32 %18, i32* %5
br label %21
19: ; preds = %4
%20 = load i32, i32* %9
store i32 %20, i32* %5
br label %21
21: ; preds = %19, %17
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @test06(i32* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = load i32, i32* %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %5, %7
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 %3, i32 %2
ret i32 %10
}
int cairo_code_draw_casCellFrame_get_height() { return 482; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casCellFrame_get_height() {
ret i32 482
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casCellFrame_get_height() {
ret i32 482
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_137() {
  Assert_real((isqrt(137) == 11),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              690, ("Integer square root of 137 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_137>:
push   %rbp
mov    %rsp,%rbp
mov    $0x89,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x2b2,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_137>:
push   %rax
mov    $0x89,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2b2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 137 should be 11\00"
define void @t_sqrt_137() {
%1 = call i32 @isqrt(i32 137)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 137 should be 11\00"
define void @t_sqrt_137() {
%1 = tail call i32 @isqrt(i32 137)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_drawoval(int, int, int, int, int);
void j_drawoval(int arg0, int arg1, int arg2, int arg3, int arg4) {
  japi_drawoval(arg0, arg1, arg2, arg3, arg4);
}


x86 assembly (clang, -O0):
<j_drawoval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <japi_drawoval@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_drawoval>:
jmp    1030 <japi_drawoval@plt>

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

LLVM IR (-O2):
define void @j_drawoval(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @japi_drawoval(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
double yp(double x, double y) { return (x * y + x); }


x86 assembly (clang, -O0):
<yp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<yp>:
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @yp(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 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double %5, double %6, double %7)
ret double %8
}

LLVM IR (-O2):
define double @yp(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %0)
ret double %3
}
int d_cmp(const void *v1, const void *v2) {
  double d1, d2;
  d1 = *((double *)v1);
  d2 = *((double *)v2);
  if (d1 < d2) {
    return (-1);
  } else if (d1 > d2) {
    return (1);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<d_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <d_cmp+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <d_cmp+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <d_cmp+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <d_cmp+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_cmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @d_cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @d_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tryfree(void *str) {
  if (str != NULL) {
    free(str);
    str = NULL;
  }
}


x86 assembly (clang, -O0):
<tryfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <tryfree+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tryfree>:
test   %rdi,%rdi
je     111a <tryfree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @tryfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
unsigned int read_sysctl_int(char *);
int get_pressure_level(unsigned int *current_level) {
  *current_level = 0;
  *current_level = read_sysctl_int("kern.memorystatus_vm_pressure_level");
  return 0;
}


x86 assembly (clang, -O0):
<get_pressure_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
lea    0xed3(%rip),%rdi
call   1030 <read_sysctl_int@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pressure_level>:
push   %rbx
mov    %rdi,%rbx
movl   $0x0,(%rdi)
lea    0xedf(%rip),%rdi
call   1030 <read_sysctl_int@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"kern.memorystatus_vm_pressure_level\00"
define i32 @get_pressure_level(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 0, i32* %3
%4 = call i32 @read_sysctl_int(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
store i32 %4, i32* %5
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"kern.memorystatus_vm_pressure_level\00"
define i32 @get_pressure_level(i32* nocapture writeonly %0) {
store i32 0, i32* %0
%2 = tail call i32 @read_sysctl_int(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %0
ret i32 0
}
int test_imm_63uint16_mem(unsigned short *val) {
  return ((*val) & (-0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_63uint16_mem>:
movzwl (%rdi),%eax
test   $0xff9d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_63uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -99
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_63uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -99
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ARGBColorMatrixRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBColorMatrixRow_SSSE3() {
ret void
}