xunge/DecIR huggingface dataset:
int fun1(char *a) {
  if (*a)
    return fun1(a + 1) + 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <fun1+0x31>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <fun1@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <fun1+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
cmpb   $0x0,(%rdi)
je     111c <fun1+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <fun1+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fun1(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* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
struct allocate_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ merge_postfix(struct allocate_info *,
                                 struct allocate_info *);
int /*<<< orphan*/ merge_prefix(struct allocate_info *, struct allocate_info *);
void merge_free_blocks(struct allocate_info *head,
                       struct allocate_info *current) {
  merge_postfix(head, current);
  merge_prefix(head, current);
}


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

x86 assembly (clang, -O2):
<merge_free_blocks>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <merge_postfix@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <merge_prefix@plt>

LLVM IR (-O0):
%struct.allocate_info = type { i32 }
define void @merge_free_blocks(%struct.allocate_info* %0, %struct.allocate_info* %1) {
%3 = alloca %struct.allocate_info*
%4 = alloca %struct.allocate_info*
store %struct.allocate_info* %0, %struct.allocate_info** %3
store %struct.allocate_info* %1, %struct.allocate_info** %4
%5 = load %struct.allocate_info*, %struct.allocate_info** %3
%6 = load %struct.allocate_info*, %struct.allocate_info** %4
%7 = call i32 @merge_postfix(%struct.allocate_info* %5, %struct.allocate_info* %6)
%8 = load %struct.allocate_info*, %struct.allocate_info** %3
%9 = load %struct.allocate_info*, %struct.allocate_info** %4
%10 = call i32 @merge_prefix(%struct.allocate_info* %8, %struct.allocate_info* %9)
ret void
}

LLVM IR (-O2):
%struct.allocate_info = type { i32 }
define void @merge_free_blocks(%struct.allocate_info* %0, %struct.allocate_info* %1) {
%3 = tail call i32 @merge_postfix(%struct.allocate_info* %0, %struct.allocate_info* %1)
%4 = tail call i32 @merge_prefix(%struct.allocate_info* %0, %struct.allocate_info* %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xproperty;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xproperty_type(void *_p) {
  return (int)((XEvent *)_p)->xproperty.type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xproperty_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xproperty_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void swap(int *x, int *y) {
  int tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
double __attribute__((const)) lw6sys_dmax(double a, double b) {
  return (a > b) ? a : b;
}


x86 assembly (clang, -O0):
<lw6sys_dmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <lw6sys_dmax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <lw6sys_dmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw6sys_dmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lw6sys_dmax(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 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @lw6sys_dmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int fun690() { return 690; }


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

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

LLVM IR (-O0):
define i32 @fun690() {
ret i32 690
}

LLVM IR (-O2):
define i32 @fun690() {
ret i32 690
}
/* Variables and functions */
int /*<<< orphan*/ go_south_east(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int print_lon_lat() {
  int latitude = 32;
  int longitude = -64;
  go_south_east(&latitude, &longitude);
  printf("Avast! Now at: [%i, %i]\n", latitude, longitude);
  return 0;
}


x86 assembly (clang, -O0):
<print_lon_lat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x20,-0x4(%rbp)
movl   $0xffffffc0,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <go_south_east@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_lon_lat>:
push   %rax
movl   $0x20,0x4(%rsp)
movl   $0xffffffc0,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <go_south_east@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Avast! Now at: [%i, %i]\0A\00"
define i32 @print_lon_lat() {
%1 = alloca i32
%2 = alloca i32
store i32 32, i32* %1
store i32 -64, i32* %2
%3 = call i32 @go_south_east(i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Avast! Now at: [%i, %i]\0A\00"
define i32 @print_lon_lat() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 32, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 -64, i32* %2
%5 = call i32 @go_south_east(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
signed int convert_signed_char_to_signed_int(signed char x) { return x; }


x86 assembly (clang, -O0):
<convert_signed_char_to_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @convert_signed_char_to_signed_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @convert_signed_char_to_signed_int(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void QEIIntUnregister(unsigned long ulBase) {
  unsigned long ulInt;
  ;
  ulInt = (ulBase == 0x4002C000) ? 29 : 54;
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<QEIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x36,%eax
mov    $0x1d,%ecx
cmp    $0x4002c000,%rdx
cmove  %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntUnregister>:
push   %rbx
cmp    $0x4002c000,%rdi
mov    $0x1d,%eax
mov    $0x36,%ebx
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @QEIIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 1073922048
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 29, i32 54
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i32 @IntDisable(i64 %9)
%11 = load i64, i64* %3
%12 = call i32 @IntUnregister(i64 %11)
ret void
}

LLVM IR (-O2):
define void @QEIIntUnregister(i64 %0) {
%2 = icmp eq i64 %0, 1073922048
%3 = select i1 %2, i64 29, i64 54
%4 = tail call i32 @IntDisable(i64 %3)
%5 = tail call i32 @IntUnregister(i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int popen_plus_terminate_with_id(int process_id) {
  char command[64];
  sprintf(command, "kill -TERM %d", process_id);
  system(command);
  return 0;
}


x86 assembly (clang, -O0):
<popen_plus_terminate_with_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popen_plus_terminate_with_id>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"kill -TERM %d\00"
define i32 @popen_plus_terminate_with_id(i32 %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"kill -TERM %d\00"
define i32 @popen_plus_terminate_with_id(i32 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @system(i8* %3)
ret i32 0
}
extern __attribute__((always_)) int
__compare_and_swap(long int *p, long int oldval, long int newval) {
  char ret;
  long int readval;
  __asm__ __volatile__("lock; cmpxchgq %3, %1; sete %0"
                       : "=q"(ret), "=m"(*p), "=a"(readval)
                       : "r"(newval), "m"(*p), "a"(oldval)
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<__compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
lock cmpxchg %rdx,(%rcx)
sete   %cl
mov    %cl,-0x19(%rbp)
mov    %rax,-0x28(%rbp)
movsbl -0x19(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__compare_and_swap>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
sete   %cl
movsbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @__compare_and_swap(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8
%8 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64*, i64** %4
%10 = load i64, i64* %6
%11 = load i64*, i64** %4
%12 = load i64, i64* %5
%13 = call { i8, i64 } asm sideeffect "lock; cmpxchgq $3, $1; sete $0", "=q,=*m,={ax},r,*m,{ax},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %9, i64 %10, i64* elementtype(i64) %11, i64 %12)
%14 = extractvalue { i8, i64 } %13, 0
%15 = extractvalue { i8, i64 } %13, 1
store i8 %14, i8* %7
store i64 %15, i64* %8
%16 = load i8, i8* %7
%17 = sext i8 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @__compare_and_swap(i64* %0, i64 %1, i64 %2) {
%4 = tail call { i8, i64 } asm sideeffect "lock; cmpxchgq $3, $1; sete $0", "=q,=*m,={ax},r,*m,{ax},~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %2, i64* elementtype(i64) %0, i64 %1)
%5 = extractvalue { i8, i64 } %4, 0
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void os_thread_msleep(int ms) {
  struct timespec ts;
  ts.tv_sec = ms / 1000;
  ts.tv_nsec = (ms % 1000) * 1000000;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<os_thread_msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_thread_msleep>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @os_thread_msleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = mul nsw i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @os_thread_msleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call_me(int /*<<< orphan*/);
int main(void) {
  call_me(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @call_me(i32 0)
ret i32 0
}
int max(const int a, const int b) { return (a < b) ? b : a; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void uart5_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @uart5_iomux_config() {
ret void
}
/* Variables and functions */
scalar_t__ ceil(double);
float ceilf(float x) { return (float)ceil((double)x); }


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

x86 assembly (clang, -O2):
<ceilf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <ceil@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ceilf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @ceil(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @ceil(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
void BootActivate(void) {
  (*((volatile unsigned long *)0xE0000004)) = 1024;
  (*((volatile unsigned char *)0xE0000000)) = (0x01) | (0x02);
  (*((volatile unsigned char *)0xE0000008)) = 0xAA;
  (*((volatile unsigned char *)0xE0000008)) = 0x55;
  (*((volatile unsigned char *)0xE0000008)) = 0xAA;
  (*((volatile unsigned char *)0xE0000008)) = 0x00;
}


x86 assembly (clang, -O0):
<BootActivate>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0000004,%eax
movq   $0x400,(%rax)
mov    $0xe0000000,%eax
movb   $0x3,(%rax)
mov    $0xe0000008,%eax
movb   $0xaa,(%rax)
mov    $0xe0000008,%eax
movb   $0x55,(%rax)
mov    $0xe0000008,%eax
movb   $0xaa,(%rax)
mov    $0xe0000008,%eax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BootActivate>:
mov    $0xe0000008,%eax
movq   $0x400,-0x4(%rax)
movb   $0x3,-0x8(%rax)
movb   $0xaa,(%rax)
movb   $0x55,(%rax)
movb   $0xaa,(%rax)
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @BootActivate() {
store volatile i64 1024, i64* inttoptr (i64 3758096388 to i64*)
store volatile i8 3, i8* inttoptr (i64 3758096384 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3758096392 to i8*)
store volatile i8 85, i8* inttoptr (i64 3758096392 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3758096392 to i8*)
store volatile i8 0, i8* inttoptr (i64 3758096392 to i8*)
ret void
}

LLVM IR (-O2):
define void @BootActivate() {
store volatile i64 1024, i64* inttoptr (i64 3758096388 to i64*)
store volatile i8 3, i8* inttoptr (i64 3758096384 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3758096392 to i8*)
store volatile i8 85, i8* inttoptr (i64 3758096392 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3758096392 to i8*)
store volatile i8 0, i8* inttoptr (i64 3758096392 to i8*)
ret void
}
void g_log_set_always_fatal() {}


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

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

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

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

/* Variables and functions */
int utimensat(int, char const *, struct timespec const *, int);
__attribute__((__weak__, __always___)) int
softboundcets_utimensat(int dirfd, const char *pathname,
                        const struct timespec times[2], int flags) {
  return utimensat(dirfd, pathname, times, flags);
}


x86 assembly (clang, -O0):
<softboundcets_utimensat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <utimensat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_utimensat>:
jmp    1030 <utimensat@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define weak i32 @softboundcets_utimensat(i32 %0, i8* %1, %struct.timespec* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.timespec*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.timespec* %2, %struct.timespec** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load %struct.timespec*, %struct.timespec** %7
%12 = load i32, i32* %8
%13 = call i32 @utimensat(i32 %9, i8* %10, %struct.timespec* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define weak i32 @softboundcets_utimensat(i32 %0, i8* %1, %struct.timespec* %2, i32 %3) {
%5 = tail call i32 @utimensat(i32 %0, i8* %1, %struct.timespec* %2, i32 %3)
ret i32 %5
}
void test117_ArrayReturn_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test117_ArrayReturn_targetInit__I() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long subwindow;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
void set_XMotionEvent_subwindow(void *_p, unsigned long _v) {
  ((XMotionEvent *)_p)->subwindow = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XMotionEvent_subwindow(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XMotionEvent_subwindow(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
char *pipe2string(char *);
char *security_mysql_version(void) {
  static char *version = {0};
  if (!version) {
    version = pipe2string("mysql_version.sh");
  }
  return version;
}


x86 assembly (clang, -O0):
<security_mysql_version>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f14(%rip)
jne    1135 <security_mysql_version+0x25>
lea    0xed7(%rip),%rdi
call   1030 <pipe2string@plt>
mov    %rax,0x2efb(%rip)
mov    0x2ef4(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<security_mysql_version>:
push   %rax
mov    0x2f18(%rip),%rax
test   %rax,%rax
je     111f <security_mysql_version+0xf>
pop    %rcx
ret
lea    0xeda(%rip),%rdi
call   1030 <pipe2string@plt>
mov    %rax,0x2efe(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@security_mysql_version.version = internal global i8* null
@.str = [17 x i8] c"mysql_version.sh\00"
define i8* @security_mysql_version() {
%1 = load i8*, i8** @security_mysql_version.version
%2 = icmp ne i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i8* @pipe2string(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** @security_mysql_version.version
br label %5
5: ; preds = %3, %0
%6 = load i8*, i8** @security_mysql_version.version
ret i8* %6
}

LLVM IR (-O2):
@security_mysql_version.version = internal unnamed_addr global i8* null
@.str = [17 x i8] c"mysql_version.sh\00"
define i8* @security_mysql_version() {
%1 = load i8*, i8** @security_mysql_version.version
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* @pipe2string(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** @security_mysql_version.version
br label %5
5: ; preds = %3, %0
%6 = phi i8* [ %4, %3 ], [ %1, %0 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int e(int m, int n) {
  int x[n];
  f(x);
  return x[m];
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <f@plt>
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    %esi,%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <f@plt>
movslq %r14d,%rax
mov    (%rbx,%rax,4),%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @e(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i32, i64 %8
store i64 %8, i64* %6
%11 = call i32 @f(i32* %10)
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load i32, i32* %14
%16 = load i8*, i8** %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @e(i32 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i32, i64 %3
%5 = call i32 @f(i32* %4)
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds i32, i32* %4, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ ksubstr(char *, char *);
char *cmdline_find(char *cmdline, char *txt) {
  while (*cmdline) {
    if (ksubstr(cmdline, txt))
      return cmdline;
    cmdline++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmdline_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <cmdline_find+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ksubstr@plt>
cmp    $0x0,%rax
je     1151 <cmdline_find+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <cmdline_find+0x5a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <cmdline_find+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_find>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113a <cmdline_find+0x2a>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ksubstr@plt>
test   %rax,%rax
jne    113c <cmdline_find+0x2c>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <cmdline_find+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @cmdline_find(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = tail call i64 @ksubstr(i8* %6, i8* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%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 %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ null, %2 ], [ null, %9 ], [ %6, %5 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ vga_put_char(char);
void *vga_writer(void *ud, char c) {
  (*(int *)ud)++;
  vga_put_char(c);
  return ud;
}


x86 assembly (clang, -O0):
<vga_writer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movsbl -0x9(%rbp),%edi
call   1030 <vga_put_char@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_writer>:
push   %rbx
mov    %rdi,%rbx
addl   $0x1,(%rdi)
mov    %esi,%edi
call   1030 <vga_put_char@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @vga_writer(i8* %0, i8 signext %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 i32*
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = load i8, i8* %4
%10 = call i32 @vga_put_char(i8 signext %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @vga_writer(i8* returned %0, i8 signext %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = tail call i32 @vga_put_char(i8 signext %1)
ret i8* %0
}
int show_bar() { return 0; }


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

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

LLVM IR (-O0):
define i32 @show_bar() {
ret i32 0
}

LLVM IR (-O2):
define i32 @show_bar() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PTHREAD_CANCEL_DISABLE;
int pthread_setcancelstate(int /*<<< orphan*/, void *);
int _pthread_disableCancel() {
  return pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, ((void *)0));
}


x86 assembly (clang, -O0):
<_pthread_disableCancel>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_setcancelstate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pthread_disableCancel>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <pthread_setcancelstate@plt>

LLVM IR (-O0):
@PTHREAD_CANCEL_DISABLE = global i32 0
define i32 @_pthread_disableCancel() {
%1 = load i32, i32* @PTHREAD_CANCEL_DISABLE
%2 = call i32 @pthread_setcancelstate(i32 %1, i8* null)
ret i32 %2
}

LLVM IR (-O2):
@PTHREAD_CANCEL_DISABLE = global i32 0
define i32 @_pthread_disableCancel() {
%1 = load i32, i32* @PTHREAD_CANCEL_DISABLE
%2 = tail call i32 @pthread_setcancelstate(i32 %1, i8* null)
ret i32 %2
}
long long_fetch_and_acquire(long *ptr, long value) {
  return __atomic_fetch_and(ptr, value, 2);
}


x86 assembly (clang, -O0):
<long_fetch_and_acquire>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
and    %rsi,%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
mov    %rax,-0x40(%rbp)
test   $0x1,%cl
mov    %rax,-0x28(%rbp)
jne    115b <long_fetch_and_acquire+0x5b>
jmp    112b <long_fetch_and_acquire+0x2b>
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_fetch_and_acquire>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rcx
and    %rsi,%rcx
lock cmpxchg %rcx,(%rdi)
jne    1110 <long_fetch_and_acquire+0x10>
ret

LLVM IR (-O0):
define i64 @long_fetch_and_acquire(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = load i64*, i64** %3
%8 = load i64, i64* %4
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = atomicrmw and i64* %7, i64 %9 acquire
store i64 %10, i64* %6
%11 = load i64, i64* %6
ret i64 %11
}

LLVM IR (-O2):
define i64 @long_fetch_and_acquire(i64* nocapture %0, i64 %1) {
%3 = atomicrmw and i64* %0, i64 %1 acquire
ret i64 %3
}
char *cleaneol(char *s) {
  char *t = s;
  if (s) {
    while (*t) {
      if (*t == '\r' || *t == '\n') {
        *t = '\0';
        break;
      }
      t++;
    }
  }
  return s;
}


x86 assembly (clang, -O0):
<cleaneol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116f <cleaneol+0x6f>
jmp    1120 <cleaneol+0x20>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <cleaneol+0x6a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     114d <cleaneol+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1159 <cleaneol+0x59>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    116a <cleaneol+0x6a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <cleaneol+0x20>
jmp    116f <cleaneol+0x6f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleaneol>:
mov    %rdi,%rax
test   %rdi,%rdi
je     112a <cleaneol+0x2a>
mov    %rax,%rcx
nopl   0x0(%rax,%rax,1)
movzbl (%rcx),%edx
test   %dl,%dl
je     112a <cleaneol+0x2a>
cmp    $0xd,%dl
je     1127 <cleaneol+0x27>
cmp    $0xa,%dl
je     1127 <cleaneol+0x27>
add    $0x1,%rcx
jmp    1110 <cleaneol+0x10>
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define i8* @cleaneol(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 13, label %6
i8 10, label %6
]
6: ; preds = %3, %3
store i8 0, i8* %4
br label %9
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3, %6, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ vfc_call_stack_free();
int /*<<< orphan*/ vfc_func_table_quit();
void vfc_quit_func_inst() {
  vfc_call_stack_free();
  vfc_func_table_quit();
}


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

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

LLVM IR (-O0):
define void @vfc_quit_func_inst() {
%1 = call i32 (...) @vfc_call_stack_free()
%2 = call i32 (...) @vfc_func_table_quit()
ret void
}

LLVM IR (-O2):
define void @vfc_quit_func_inst() {
%1 = tail call i32 (...) @vfc_call_stack_free()
%2 = tail call i32 (...) @vfc_func_table_quit()
ret void
}
/* Variables and functions */
int str_to_decimal(char const *, long long *, int, void *);
int check_str_bytes(const char *p, long long *val, void *data) {
  return str_to_decimal(p, val, 1, data);
}


x86 assembly (clang, -O0):
<check_str_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <str_to_decimal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_str_bytes>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <str_to_decimal@plt>

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

LLVM IR (-O2):
define i32 @check_str_bytes(i8* %0, i64* %1, i8* %2) {
%4 = tail call i32 @str_to_decimal(i8* %0, i64* %1, i32 1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char bufferoverflow[4];
  strcpy(bufferoverflow, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int writeSerial(int, char *, int);
int writePacket(int fd, char control, char *data, int size) {
  char packet[255];
  int status;
  packet[0] = control;
  packet[1] = size;
  memcpy(&(packet[2]), data, size);
  status = writeSerial(fd, packet, size + 2);
  return status;
}


x86 assembly (clang, -O0):
<writePacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x120(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x11f(%rbp)
lea    -0x120(%rbp),%rdi
add    $0x2,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x2,%edx
call   1040 <writeSerial@plt>
mov    %eax,-0x124(%rbp)
mov    -0x124(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writePacket>:
push   %rbp
push   %rbx
sub    $0x108,%rsp
mov    %ecx,%ebx
mov    %edi,%ebp
mov    %sil,(%rsp)
mov    %bl,0x1(%rsp)
lea    0x2(%rsp),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    $0x2,%ebx
mov    %rsp,%rsi
mov    %ebp,%edi
mov    %ebx,%edx
call   1040 <writeSerial@plt>
add    $0x108,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @writePacket(i32 %0, i8 signext %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [255 x i8]
%10 = alloca i32
store i32 %0, i32* %5
store i8 %1, i8* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i8, i8* %6
%12 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
store i8 %11, i8* %12
%13 = load i32, i32* %8
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 1
store i8 %14, i8* %15
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 2
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
%20 = load i32, i32* %5
%21 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 2
%24 = call i32 @writeSerial(i32 %20, i8* %21, i32 %23)
store i32 %24, i32* %10
%25 = load i32, i32* %10
ret i32 %25
}

LLVM IR (-O2):
define i32 @writePacket(i32 %0, i8 signext %1, i8* %2, i32 %3) {
%5 = alloca [255 x i8]
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
store i8 %1, i8* %6
%7 = trunc i32 %3 to i8
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 1
store i8 %7, i8* %8
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 2
%10 = call i32 @memcpy(i8* %9, i8* %2, i32 %3)
%11 = add nsw i32 %3, 2
%12 = call i32 @writeSerial(i32 %0, i8* %6, i32 %11)
ret i32 %12
}
void WideTimer2B_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<WideTimer2B_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <WideTimer2B_Handler+0x9>
jmp    1109 <WideTimer2B_Handler+0x9>

x86 assembly (clang, -O2):
<WideTimer2B_Handler>:
jmp    1100 <WideTimer2B_Handler>

LLVM IR (-O0):
define void @WideTimer2B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @WideTimer2B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct plot_value {
  int dummy;
};

/* Variables and functions */
struct plot_value *plot_new_pair(struct plot_value *, struct plot_value *);
struct plot_value *cons(struct plot_value *l, struct plot_value *r) {
  return plot_new_pair(l, r);
}


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

x86 assembly (clang, -O2):
<cons>:
jmp    1030 <plot_new_pair@plt>

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

LLVM IR (-O2):
%struct.plot_value = type { i32 }
define %struct.plot_value* @cons(%struct.plot_value* %0, %struct.plot_value* %1) {
%3 = tail call %struct.plot_value* @plot_new_pair(%struct.plot_value* %0, %struct.plot_value* %1)
ret %struct.plot_value* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ p264_pixel_avg_w8_mmxext(int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *, int, int);
void p264_pixel_avg_8x8_mmxext(uint8_t *dst, int i_dst, uint8_t *src,
                               int i_src) {
  p264_pixel_avg_w8_mmxext(dst, i_dst, dst, i_dst, src, i_src, 8);
}


x86 assembly (clang, -O0):
<p264_pixel_avg_8x8_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
movl   $0x8,(%rsp)
call   1030 <p264_pixel_avg_w8_mmxext@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_pixel_avg_8x8_mmxext>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
movl   $0x8,(%rsp)
mov    %rdi,%rdx
mov    %esi,%ecx
call   1030 <p264_pixel_avg_w8_mmxext@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @p264_pixel_avg_8x8_mmxext(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @p264_pixel_avg_w8_mmxext(i32* %0, i32 %1, i32* %0, i32 %1, i32* %2, i32 %3, i32 8)
ret void
}