xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ stricmp(char *, char const *, int);
int search_2d(char **src, int num_entries, const char *str) {
  while (num_entries)
    if (!stricmp(src[--num_entries], str, 64))
      return num_entries;
  return -1;
}


x86 assembly (clang, -O0):
<search_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1168 <search_2d+0x58>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x40,%edx
call   1030 <stricmp@plt>
cmp    $0x0,%eax
jne    1163 <search_2d+0x53>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <search_2d+0x5f>
jmp    1123 <search_2d+0x13>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_2d>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
movslq %esi,%rbx
xchg   %ax,%ax
sub    $0x1,%rbx
jb     113d <search_2d+0x2d>
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
mov    $0x40,%edx
call   1030 <stricmp@plt>
test   %eax,%eax
jne    1120 <search_2d+0x10>
jmp    1142 <search_2d+0x32>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @search_2d(i8** nocapture %0, i32 %1, i8* %2) {
%4 = sext i32 %1 to i64
br label %5
5: ; preds = %8, %3
%6 = phi i64 [ %9, %8 ], [ %4, %3 ]
%7 = icmp eq i64 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %5
%9 = add nsw i64 %6, -1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @stricmp(i8* %11, i8* %2, i32 64)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %8
%15 = trunc i64 %9 to i32
br label %16
16: ; preds = %5, %14
%17 = phi i32 [ %15, %14 ], [ -1, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ bwputs(char *);
int /*<<< orphan*/ syscall();
void first(void) {
  bwputs("In user-mode: 1\n");
  syscall();
  bwputs("In user-mode: 2\n");
  syscall();
  return;
}


x86 assembly (clang, -O0):
<first>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <bwputs@plt>
mov    $0x0,%al
call   1040 <syscall@plt>
lea    0xed3(%rip),%rdi
call   1030 <bwputs@plt>
mov    $0x0,%al
call   1040 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<first>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <bwputs@plt>
xor    %eax,%eax
call   1040 <syscall@plt>
lea    0xed6(%rip),%rdi
call   1030 <bwputs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <syscall@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"In user-mode: 1\0A\00"
@.str.1 = [17 x i8] c"In user-mode: 2\0A\00"
define void @first() {
%1 = call i32 @bwputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @syscall()
%3 = call i32 @bwputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @syscall()
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"In user-mode: 1\0A\00"
@.str.1 = [17 x i8] c"In user-mode: 2\0A\00"
define void @first() {
%1 = tail call i32 @bwputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @syscall()
%3 = tail call i32 @bwputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @syscall()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XESetCloseDisplay() {
  printf("XESetCloseDisplay called\n");
  return 0;
}


x86 assembly (clang, -O0):
<XESetCloseDisplay>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XESetCloseDisplay>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"XESetCloseDisplay called\0A\00"
define i32 @XESetCloseDisplay() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"XESetCloseDisplay called\00"
define i32 @XESetCloseDisplay() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int foo(int arg) { return arg * 5; }


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

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, 5
ret i32 %2
}
void cpu_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @cpu_init() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_add_quaddobl_Laurent_term(int i, int n, int *exp, double *c) {
  int a[2], fail;
  a[0] = n;
  a[1] = i;
  fail = _ada_use_c2phc(566, a, exp, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_add_quaddobl_Laurent_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x236,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_add_quaddobl_Laurent_term>:
push   %rax
mov    %esi,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x236,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_add_quaddobl_Laurent_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca [2 x i32]
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%11 = load i32, i32* %6
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load i32*, i32** %7
%17 = load double*, double** %8
%18 = call i32 @_ada_use_c2phc(i32 566, i32* %15, i32* %16, double* %17)
store i32 %18, i32* %10
%19 = load i32, i32* %10
ret i32 %19
}

LLVM IR (-O2):
define i32 @syscon_add_quaddobl_Laurent_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %0, i32* %8
%9 = call i32 @_ada_use_c2phc(i32 566, i32* %7, i32* %2, double* %3)
ret i32 %9
}
int i(int n) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @i(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void wfree(void *ptr) {
  if (ptr)
    free(ptr);
  ptr = ((void *)0);
}


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

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

LLVM IR (-O0):
define void @wfree(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)
br label %8
8: ; preds = %5, %1
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
define void @wfree(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
}
void gpio_debug_print(void) { return; }


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

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

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

LLVM IR (-O2):
define void @gpio_debug_print() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ print_backtrace();
int /*<<< orphan*/ printf(char *, int);
void sig_handler(int sig) {
  printf("signal %d\n", sig);
  print_backtrace();
  exit(1);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <print_backtrace@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <print_backtrace@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @print_backtrace()
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @print_backtrace()
%4 = tail call i32 @exit(i32 1)
unreachable
}
void zero(s, n) float *s;
int n;
{
  while (n--) {
    s[0] = 0.0;
    s++;
  }
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     113b <zero+0x3b>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <zero+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
test   %esi,%esi
je     1126 <zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @zero(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 0
store float 0.000000e+00, float* %11
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i32 1
store float* %13, float** %3
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @zero(float* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage(const char *name) {
  if (name) {
    printf("Usage: %s [OPTIONS] <app name> <username> <password>\n"
           "Options:\n"
           "    -d    Display debug messages\n"
           "    -j    Decode images from JPEG\n",
           name);
  }
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <print_usage+0x27>
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
test   %rdi,%rdi
je     1124 <print_usage+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [130 x i8] c"Usage: %s [OPTIONS] <app name> <username> <password>\0AOptions:\0A -d Display debug messages\0A -j Decode images from JPEG\0A\00"
define void @print_usage(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 @printf(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [130 x i8] c"Usage: %s [OPTIONS] <app name> <username> <password>\0AOptions:\0A -d Display debug messages\0A -j Decode images from JPEG\0A\00"
define void @print_usage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t fib(uint64_t *first, uint64_t *second) {
  uint64_t temp = *first;
  *first = *second;
  return (*second += temp);
}


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

x86 assembly (clang, -O2):
<fib>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
add    (%rsi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define i64 @fib(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
store i64 %7, i64* %5
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = load i64*, i64** %3
store i64 %9, i64* %10
%11 = load i64, i64* %5
%12 = load i64*, i64** %4
%13 = load i64, i64* %12
%14 = add nsw i64 %13, %11
store i64 %14, i64* %12
ret i64 %14
}

LLVM IR (-O2):
define i64 @fib(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
store i64 %4, i64* %0
%5 = load i64, i64* %1
%6 = add nsw i64 %5, %3
store i64 %6, i64* %1
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void ETH_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @ETH_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @ETH_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
main(int argc, char **argv) {
  char *foo;
  puts(foo);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) undef)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int, int,
                           int);
void Write_Contact_Entry(FILE *Report, int Xmin, int Ymin, int Xmax, int Ymax,
                         int Area) {
  fprintf(Report, "   CE: (%3d,%3d) (%3d,%3d) %5d\n", Xmin, Ymin, Xmax, Ymax,
          Area);
}


x86 assembly (clang, -O0):
<Write_Contact_Entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%eax
lea    0xeb7(%rip),%rsi
mov    %eax,(%rsp)
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write_Contact_Entry>:
push   %rax
mov    %r8d,%eax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %r9d,(%rsp)
lea    0xeda(%rip),%rsi
mov    %eax,%r9d
call   1030 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c" CE: (%3d,%3d) (%3d,%3d) %5d\0A\00"
define void @Write_Contact_Entry(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c" CE: (%3d,%3d) (%3d,%3d) %5d\0A\00"
define void @Write_Contact_Entry(i32* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_T61STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_T61STRING_it;
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int i2d_ASN1_T61STRING(ASN1_T61STRING *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_T61STRING_it);
}


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

x86 assembly (clang, -O2):
<i2d_ASN1_T61STRING>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@ASN1_T61STRING_it = global i32 0
define i32 @i2d_ASN1_T61STRING(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @ASN1_T61STRING_it)
ret i32 %3
}
int fun152() { return 152; }


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

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

LLVM IR (-O0):
define i32 @fun152() {
ret i32 152
}

LLVM IR (-O2):
define i32 @fun152() {
ret i32 152
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/ *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ log_error(int, char *);
int pthread_mutex_lock(int /*<<< orphan*/ *);
void mutexLock(pthread_mutex_t *mutex) {
  ASSERT(mutex);
  int r = pthread_mutex_lock(mutex);
  if (r != 0) {
    log_error(r, "Error pthread_mutex_lock()");
    abort();
  }
}


x86 assembly (clang, -O0):
<mutexLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1060 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1181 <mutexLock+0x41>
mov    -0xc(%rbp),%edi
lea    0xe8b(%rip),%rsi
call   1040 <log_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutexLock>:
push   %rbx
mov    %rdi,%rbx
call   1050 <ASSERT@plt>
mov    %rbx,%rdi
call   1060 <pthread_mutex_lock@plt>
test   %eax,%eax
jne    1157 <mutexLock+0x17>
pop    %rbx
ret
lea    0xea2(%rip),%rsi
mov    %eax,%edi
call   1040 <log_error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Error pthread_mutex_lock()\00"
define void @mutexLock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @ASSERT(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @pthread_mutex_lock(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @log_error(i32 %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Error pthread_mutex_lock()\00"
define void @mutexLock(i32* %0) {
%2 = tail call i32 @ASSERT(i32* %0)
%3 = tail call i32 @pthread_mutex_lock(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @log_error(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tempString;

/* Variables and functions */
int setStandardProcedure(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int setMaxElevationLimit(int max) {
  char tempString[16];
  snprintf(tempString, sizeof(tempString), "#:So%02d*#", max);
  return (setStandardProcedure(tempString));
}


x86 assembly (clang, -O0):
<setMaxElevationLimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x10,%esi
lea    0xec2(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <setStandardProcedure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setMaxElevationLimit>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <setStandardProcedure@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"#:So%02d*#\00"
define i32 @setMaxElevationLimit(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i32 @setStandardProcedure(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"#:So%02d*#\00"
define i32 @setMaxElevationLimit(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @setStandardProcedure(i8* %3)
ret i32 %5
}
/* Variables and functions */
int foo(int);
int fn_42_b(int locked) {
  int i;
  if (locked)
    i = foo(0);
  else
    i = foo(1);

  if (i > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<fn_42_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1134 <fn_42_b+0x24>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %eax,-0xc(%rbp)
jmp    1141 <fn_42_b+0x31>
mov    $0x1,%edi
call   1030 <foo@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1157 <fn_42_b+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115e <fn_42_b+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_42_b>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
sete   %al
mov    %eax,%edi
call   1030 <foo@plt>
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fn_42_b(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @foo(i32 %3)
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int S_ISSOCK(int /*<<< orphan*/);
int s_issock(mode_t mode) { return S_ISSOCK(mode); }


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

x86 assembly (clang, -O2):
<s_issock>:
jmp    1030 <S_ISSOCK@plt>

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

LLVM IR (-O2):
define i32 @s_issock(i32 %0) {
%2 = tail call i32 @S_ISSOCK(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ttl;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IP_MULTICAST_IF;
int /*<<< orphan*/ IP_MULTICAST_TTL;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              char *, int);
void set_socket_multicast(int s, unsigned char ttl, unsigned long ip) {
  setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&ttl, sizeof(ttl));
  setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, (char *)&ip, sizeof(int));
}


x86 assembly (clang, -O0):
<set_socket_multicast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
lea    -0x5(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <setsockopt@plt>
mov    -0x4(%rbp),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_socket_multicast>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
mov    %sil,0xf(%rsp)
mov    %rdx,0x10(%rsp)
mov    0x2ebe(%rip),%r14
mov    (%r14),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    0xf(%rsp),%rcx
mov    $0x1,%r8d
call   1030 <setsockopt@plt>
mov    (%r14),%esi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rcx
mov    %ebx,%edi
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@IPPROTO_IP = global i32 0
@IP_MULTICAST_TTL = global i32 0
@IP_MULTICAST_IF = global i32 0
define void @set_socket_multicast(i32 %0, i8 zeroext %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i64
store i32 %0, i32* %4
store i8 %1, i8* %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i32, i32* @IPPROTO_IP
%9 = load i32, i32* @IP_MULTICAST_TTL
%10 = call i32 @setsockopt(i32 %7, i32 %8, i32 %9, i8* %5, i32 1)
%11 = load i32, i32* %4
%12 = load i32, i32* @IPPROTO_IP
%13 = load i32, i32* @IP_MULTICAST_IF
%14 = bitcast i64* %6 to i8*
%15 = call i32 @setsockopt(i32 %11, i32 %12, i32 %13, i8* %14, i32 4)
ret void
}

LLVM IR (-O2):
@IPPROTO_IP = global i32 0
@IP_MULTICAST_TTL = global i32 0
@IP_MULTICAST_IF = global i32 0
define void @set_socket_multicast(i32 %0, i8 zeroext %1, i64 %2) {
%4 = alloca i8
%5 = alloca i64
store i8 %1, i8* %4
store i64 %2, i64* %5
%6 = load i32, i32* @IPPROTO_IP
%7 = load i32, i32* @IP_MULTICAST_TTL
%8 = call i32 @setsockopt(i32 %0, i32 %6, i32 %7, i8* %4, i32 1)
%9 = load i32, i32* @IPPROTO_IP
%10 = load i32, i32* @IP_MULTICAST_IF
%11 = bitcast i64* %5 to i8*
%12 = call i32 @setsockopt(i32 %0, i32 %9, i32 %10, i8* %11, i32 4)
ret void
}
int gNand(int a, int b) {
  if (a && b)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<gNand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <gNand+0x2a>
cmpl   $0x0,-0xc(%rbp)
je     112a <gNand+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1131 <gNand+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gNand>:
test   %edi,%edi
sete   %al
test   %esi,%esi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @gNand(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ do_nothing();
int first();
int main() {
  do_nothing();
  return first();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <do_nothing@plt>
mov    $0x0,%al
call   1040 <first@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <do_nothing@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <first@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_nothing()
%2 = tail call i32 (...) @first()
ret i32 %2
}
/* Variables and functions */
int bbm_data(void *, unsigned short, unsigned char *, unsigned int);
signed int bbm_com_data(void *handle, unsigned short addr, unsigned char *data,
                        unsigned int size) {
  signed int res;
  res = bbm_data(handle, addr, data, size);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movzwl %ax,%esi
call   1030 <bbm_data@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_data>:
jmp    1030 <bbm_data@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_data(i8* %0, i16 zeroext %1, i8* %2, i32 %3) {
%5 = tail call i32 @bbm_data(i8* %0, i16 zeroext %1, i8* %2, i32 %3)
ret i32 %5
}
int is_sync(unsigned char *p) {
  int syncword = p[0];
  if (0x47 == syncword || 0xb8 == syncword)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_sync>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x47,%eax
cmp    -0x14(%rbp),%eax
je     112e <is_sync+0x2e>
mov    $0xb8,%eax
cmp    -0x14(%rbp),%eax
jne    113a <is_sync+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <is_sync+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sync>:
mov    (%rdi),%al
cmp    $0xb8,%al
sete   %cl
cmp    $0x47,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @is_sync(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -72
%4 = icmp eq i8 %2, 71
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct tcphdr {
  int /*<<< orphan*/ urg_ptr;
};

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t _tcphdr_urg_ptr_ntohs(struct tcphdr *h) { return ntohs(h->urg_ptr); }


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

x86 assembly (clang, -O2):
<_tcphdr_urg_ptr_ntohs>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_urg_ptr_ntohs(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_urg_ptr_ntohs(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
const char *my_queue_impl_type(void) { return ("pthread mutex"); }


x86 assembly (clang, -O0):
<my_queue_impl_type>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_queue_impl_type>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"pthread mutex\00"
define i8* @my_queue_impl_type() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"pthread mutex\00"
define i8* @my_queue_impl_type() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
void X509_NAME_ENTRY_set_object(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_ENTRY_set_object() {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int common_stat(char const *, struct stat *, int /*<<< orphan*/);
int virt_stat(const char *path, struct stat *buf) {
  return common_stat(path, buf, 0);
}


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

x86 assembly (clang, -O2):
<virt_stat>:
xor    %edx,%edx
jmp    1030 <common_stat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @virt_stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @common_stat(i8* %5, %struct.stat* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @virt_stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @common_stat(i8* %0, %struct.stat* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  assume(y == x);
  while (1) {
    x++;
    y++;
    assert(x == y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
mov    %al,-0xd(%rbp)
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1142 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @assert(i32 1)
br label %2
}
/* Variables and functions */
int __getpageshift();
int getpagesize();
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("getpagesize()    = %d\n"
         "__getpageshift() = %d\n",
         getpagesize(), __getpageshift());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <__getpageshift@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getpagesize@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <__getpageshift@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"getpagesize() = %d\0A__getpageshift() = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpagesize()
%3 = call i32 (...) @__getpageshift()
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"getpagesize() = %d\0A__getpageshift() = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpagesize()
%2 = tail call i32 (...) @__getpageshift()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int genrand64_int64();
__attribute__((unused)) long long genrand64_int63(void) {
  return (long long)(genrand64_int64() >> 1);
}


x86 assembly (clang, -O0):
<genrand64_int63>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand64_int64@plt>
sar    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand64_int63>:
push   %rax
xor    %eax,%eax
call   1030 <genrand64_int64@plt>
sar    %eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @genrand64_int63() {
%1 = call i32 (...) @genrand64_int64()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @genrand64_int63() {
%1 = tail call i32 (...) @genrand64_int64()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}
float degrees_radians(float radians) { return radians * 3.14 / 180; }


x86 assembly (clang, -O0):
<degrees_radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degrees_radians>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @degrees_radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 3.140000e+00
%6 = fdiv double %5, 1.800000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @degrees_radians(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 3.140000e+00
%4 = fdiv double %3, 1.800000e+02
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
double strtod(char *, char **);
int mystrtod(char **p, double *res) {
  char *start = *p;
  *res = strtod(*p, p);
  if (*p != start)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mystrtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
je     1160 <mystrtod+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1167 <mystrtod+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrtod>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strtod@plt>
movsd  %xmm0,(%r14)
xor    %eax,%eax
cmp    %r15,(%rbx)
setne  %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @mystrtod(i8** nocapture %0, double* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = tail call double @strtod(i8* %3, i8** %0)
store double %4, double* %1
%5 = load i8*, i8** %0
%6 = icmp ne i8* %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int const int32_t;

/* Variables and functions */
int32_t i32_from_p24(const uint8_t *packed24) {
  return (packed24[0] << 8) | (packed24[1] << 16) | (packed24[2] << 24);
}


x86 assembly (clang, -O0):
<i32_from_p24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i32_from_p24>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x8,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x18,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @i32_from_p24(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 24
%16 = or i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @i32_from_p24(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 24
%11 = or i32 %7, %10
ret i32 %11
}
/* Variables and functions */
int get_flag(int);
bool get_carry() { return get_flag(4); }


x86 assembly (clang, -O0):
<get_carry>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <get_flag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_carry>:
mov    $0x4,%edi
jmp    1030 <get_flag@plt>

LLVM IR (-O0):
define i32 @get_carry() {
%1 = call i32 @get_flag(i32 4)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_carry() {
%1 = tail call i32 @get_flag(i32 4)
ret i32 %1
}