xunge/DecIR huggingface dataset:
void set_bit(unsigned *x, unsigned n, unsigned v) {
  if (v)
    *x = (*x) | (1 << n);
  else
    *x = (*x) & ~(1 << n);
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     113b <set_bit+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x14(%rbp),%ecx
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    115c <set_bit+0x5c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x18(%rbp),%ecx
xor    $0xffffffff,%eax
and    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    (%rdi),%eax
mov    %eax,%ecx
btr    %esi,%ecx
bts    %esi,%eax
test   %edx,%edx
cmove  %ecx,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_bit(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = load i32, i32* %0
%6 = shl nuw i32 1, %1
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
%9 = or i32 %5, %6
%10 = select i1 %4, i32 %8, i32 %9
store i32 %10, i32* %0
ret void
}
void smacUartDebug_init() {}


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

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

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

LLVM IR (-O2):
define void @smacUartDebug_init() {
ret void
}
int get_num_lines(char **paragraph) {
  int i;
  for (i = 0; *(paragraph + i) != '\0'; i++) {
  }
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @get_num_lines(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c))
    return (c - 'A' + 'a');
  else
    return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <tolower+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <tolower+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _intsrestore(unsigned long);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
void mon_intsrestore(unsigned long msr) {
  monLock();
  _intsrestore(msr);
  monUnlock();
}


x86 assembly (clang, -O0):
<mon_intsrestore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
call   1050 <_intsrestore@plt>
mov    $0x0,%al
call   1040 <monUnlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_intsrestore>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
call   1050 <_intsrestore@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <monUnlock@plt>

LLVM IR (-O0):
define void @mon_intsrestore(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @monLock()
%4 = load i64, i64* %2
%5 = call i32 @_intsrestore(i64 %4)
%6 = call i32 (...) @monUnlock()
ret void
}

LLVM IR (-O2):
define void @mon_intsrestore(i64 %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call i32 @_intsrestore(i64 %0)
%4 = tail call i32 (...) @monUnlock()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ wcstold(int /*<<< orphan*/ const *, int /*<<< orphan*/ **);
float wcstof(const wchar_t *str, wchar_t **endptr) {
  return (float)wcstold(str, endptr);
}


x86 assembly (clang, -O0):
<wcstof>:
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 <wcstold@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstof>:
push   %rax
call   1030 <wcstold@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @wcstof(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 = call i64 @wcstold(i32* %5, i32** %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @wcstof(i32* %0, i32** %1) {
%3 = tail call i64 @wcstold(i32* %0, i32** %1)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int, void (*)(int));
void catch_alarm(int sig) {
  printf("Alarm event\n");
  signal(sig, catch_alarm);
}


x86 assembly (clang, -O0):
<catch_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2e97(%rip),%rsi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catch_alarm>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea2(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <signal@plt>

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

LLVM IR (-O2):
@str = [12 x i8] c"Alarm event\00"
define void @catch_alarm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @signal(i32 %0, void (i32)* @catch_alarm)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ lrand48();
uint64_t rte_rand(void) {
  uint64_t val;
  val = (uint64_t)lrand48();
  val <<= 32;
  val += (uint64_t)lrand48();
  return val;
}


x86 assembly (clang, -O0):
<rte_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lrand48@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_rand>:
push   %rax
xor    %eax,%eax
call   1030 <lrand48@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <lrand48@plt>

LLVM IR (-O0):
define i32 @rte_rand() {
%1 = alloca i32
%2 = call i64 (...) @lrand48()
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = shl i32 %4, 32
store i32 %5, i32* %1
%6 = call i64 (...) @lrand48()
%7 = trunc i64 %6 to i32
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @rte_rand() {
%1 = tail call i64 (...) @lrand48()
%2 = tail call i64 (...) @lrand48()
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ bef_push(int);
int ins_nm1() {
  bef_push(1);
  return 1;
}


x86 assembly (clang, -O0):
<ins_nm1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <bef_push@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ins_nm1>:
push   %rax
mov    $0x1,%edi
call   1030 <bef_push@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ins_nm1() {
%1 = call i32 @bef_push(i32 1)
ret i32 1
}

LLVM IR (-O2):
define i32 @ins_nm1() {
%1 = tail call i32 @bef_push(i32 1)
ret i32 1
}
/* Type definitions */
struct inOutBuff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ intToString(char *, unsigned int);
int /*<<< orphan*/ writeBuffString(struct inOutBuff *, int /*<<< orphan*/);
void writeBuffInt(struct inOutBuff *write, unsigned int val) {
  char buff[10];
  writeBuffString(write, intToString(buff, val));
}


x86 assembly (clang, -O0):
<writeBuffInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x16(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <intToString@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <writeBuffString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeBuffInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x6(%rsp),%rdi
call   1030 <intToString@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <writeBuffString@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.inOutBuff = type { i32 }
define void @writeBuffInt(%struct.inOutBuff* %0, i32 %1) {
%3 = alloca %struct.inOutBuff*
%4 = alloca i32
%5 = alloca [10 x i8]
store %struct.inOutBuff* %0, %struct.inOutBuff** %3
store i32 %1, i32* %4
%6 = load %struct.inOutBuff*, %struct.inOutBuff** %3
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %4
%9 = call i32 @intToString(i8* %7, i32 %8)
%10 = call i32 @writeBuffString(%struct.inOutBuff* %6, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.inOutBuff = type { i32 }
define void @writeBuffInt(%struct.inOutBuff* %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @intToString(i8* %4, i32 %1)
%6 = call i32 @writeBuffString(%struct.inOutBuff* %0, i32 %5)
ret void
}
int link_nofollow(int on __attribute__((__unused__))) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @link_nofollow(i32 %0) {
ret i32 0
}
f(float f) {
  int i = 0;
  i += f;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 0, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = fadd float %7, %5
%9 = fptosi float %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(float %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ outb(char, int);
void eoi(char whichpic) { outb(whichpic | 0x00, 0x20); }


x86 assembly (clang, -O0):
<eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
or     $0x0,%eax
mov    $0x20,%esi
movsbl %al,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eoi>:
mov    $0x20,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @eoi(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = or i32 %4, 0
%6 = trunc i32 %5 to i8
%7 = call i32 @outb(i8 signext %6, i32 32)
ret void
}

LLVM IR (-O2):
define void @eoi(i8 signext %0) {
%2 = tail call i32 @outb(i8 signext %0, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int __string_decode_array_cleanup(char **s, int elements) {
  int element;
  for (element = 0; element < elements; element++)
    free(s[element]);
  return 0;
}


x86 assembly (clang, -O0):
<__string_decode_array_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <__string_decode_array_cleanup+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <__string_decode_array_cleanup+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__string_decode_array_cleanup>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <__string_decode_array_cleanup+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <__string_decode_array_cleanup+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @__string_decode_array_cleanup(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @free(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
int set_control() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @set_control() {
ret i32 0
}
int ibasic(int *a, int b, int *c) { return a[0] = b + c[0] + c[1]; }


x86 assembly (clang, -O0):
<ibasic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
mov    -0x18(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibasic>:
mov    %esi,%eax
add    (%rdx),%eax
add    0x4(%rdx),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @ibasic(i32* nocapture writeonly %0, i32 %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, %1
%6 = getelementptr inbounds i32, i32* %2, i64 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
store i32 %8, i32* %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ print_args(char *, char *, char *, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  print_args("Ira", "Jacob", "Woodring", NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed7(%rip),%rsi
lea    0xed6(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <print_args@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
lea    0xee4(%rip),%rdx
xor    %ecx,%ecx
call   1030 <print_args@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Ira\00"
@.str.1 = [6 x i8] c"Jacob\00"
@.str.2 = [9 x i8] c"Woodring\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @print_args(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"Ira\00"
@.str.1 = [6 x i8] c"Jacob\00"
@.str.2 = [9 x i8] c"Woodring\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print_args(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}
/* Variables and functions */
int compare_and_swap(long volatile *, long, long);
int SASCompareSwap(volatile long int *wordptr, long int match,
                   long int replace) {
  int temp;
  temp = compare_and_swap(wordptr, match, replace);
  return temp;
}


x86 assembly (clang, -O0):
<SASCompareSwap>:
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),%rdx
call   1030 <compare_and_swap@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SASCompareSwap>:
jmp    1030 <compare_and_swap@plt>

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

LLVM IR (-O2):
define i32 @SASCompareSwap(i64* %0, i64 %1, i64 %2) {
%4 = tail call i32 @compare_and_swap(i64* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int CheckFileExistence(char *filename) { return access(filename, F_OK) != -1; }


x86 assembly (clang, -O0):
<CheckFileExistence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckFileExistence>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @CheckFileExistence(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @CheckFileExistence(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double log(int /*<<< orphan*/);
int /*<<< orphan*/ ranf();
double expntl(double x) { return (-x * log(ranf())); }


x86 assembly (clang, -O0):
<expntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ranf@plt>
mov    %eax,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expntl>:
sub    $0x18,%rsp
xorpd  0xed4(%rip),%xmm0
movapd %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <ranf@plt>
mov    %eax,%edi
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @expntl(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 (...) @ranf()
%6 = call double @log(i32 %5)
%7 = fmul double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @expntl(double %0) {
%2 = fneg double %0
%3 = tail call i32 (...) @ranf()
%4 = tail call double @log(i32 %3)
%5 = fmul double %4, %2
ret double %5
}
void __DELETE_java_lang_String_CaseInsensitiveComparator(void *me,
                                                         void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_String_CaseInsensitiveComparator(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
char *char_to_string(int);
int /*<<< orphan*/ exit_minibuffer();
int /*<<< orphan*/ insert_string(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void exit_self_inserting(int c) {
  char *str = char_to_string(c);
  insert_string(str, strlen(str));
  exit_minibuffer();
}


x86 assembly (clang, -O0):
<exit_self_inserting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <char_to_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <insert_string@plt>
mov    $0x0,%al
call   1030 <exit_minibuffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_self_inserting>:
push   %rbx
call   1060 <char_to_string@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <insert_string@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <exit_minibuffer@plt>

LLVM IR (-O0):
define void @exit_self_inserting(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @char_to_string(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @insert_string(i8* %6, i32 %8)
%10 = call i32 (...) @exit_minibuffer()
ret void
}

LLVM IR (-O2):
define void @exit_self_inserting(i32 %0) {
%2 = tail call i8* @char_to_string(i32 %0)
%3 = tail call i32 @strlen(i8* %2)
%4 = tail call i32 @insert_string(i8* %2, i32 %3)
%5 = tail call i32 (...) @exit_minibuffer()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printMajority(int *, int);
int main(void) {
  int a[] = {1, 3, 3, 3, 2, 1, 1, 3, 6, 3, 3, 3, 3, 3};
  int size = sizeof(a) / sizeof(*a);
  printMajority(a, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x38,%edx
call   1030 <memcpy@plt>
movl   $0xe,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1040 <printMajority@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xf15(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xe,%esi
call   1030 <printMajority@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [14 x i32] [i32 1, i32 3, i32 3, i32 3, i32 2, i32 1, i32 1, i32 3, i32 6, i32 3, i32 3, i32 3, i32 3, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [14 x i32]* %2 to i8*
store i32 14, i32* %3
%5 = getelementptr inbounds [14 x i32], [14 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @printMajority(i32* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [14 x i32] [i32 1, i32 3, i32 3, i32 3, i32 2, i32 1, i32 1, i32 3, i32 6, i32 3, i32 3, i32 3, i32 3, i32 3]
define i32 @main() {
%1 = alloca [14 x i32]
%2 = bitcast [14 x i32]* %1 to i8*
%3 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%4 = call i32 @printMajority(i32* %3, i32 14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f4();
int /*<<< orphan*/ f5();
int /*<<< orphan*/ f6();
int /*<<< orphan*/ pf1();
int /*<<< orphan*/ pf2();
int /*<<< orphan*/ pf3();
int /*<<< orphan*/ pf4();
int /*<<< orphan*/ pf5();
int /*<<< orphan*/ pf6();
int main(void) {
  f4();
  f5();
  f6();
  pf1();
  pf2();
  pf3();
  pf4();
  pf5();
  pf6();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10b0 <f4@plt>
mov    $0x0,%al
call   1070 <f5@plt>
mov    $0x0,%al
call   1030 <f6@plt>
mov    $0x0,%al
call   1040 <pf1@plt>
mov    $0x0,%al
call   10a0 <pf2@plt>
mov    $0x0,%al
call   1060 <pf3@plt>
mov    $0x0,%al
call   1080 <pf4@plt>
mov    $0x0,%al
call   1050 <pf5@plt>
mov    $0x0,%al
call   1090 <pf6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10b0 <f4@plt>
xor    %eax,%eax
call   1070 <f5@plt>
xor    %eax,%eax
call   1030 <f6@plt>
xor    %eax,%eax
call   1040 <pf1@plt>
xor    %eax,%eax
call   10a0 <pf2@plt>
xor    %eax,%eax
call   1060 <pf3@plt>
xor    %eax,%eax
call   1080 <pf4@plt>
xor    %eax,%eax
call   1050 <pf5@plt>
xor    %eax,%eax
call   1090 <pf6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f4()
%3 = call i32 (...) @f5()
%4 = call i32 (...) @f6()
%5 = call i32 (...) @pf1()
%6 = call i32 (...) @pf2()
%7 = call i32 (...) @pf3()
%8 = call i32 (...) @pf4()
%9 = call i32 (...) @pf5()
%10 = call i32 (...) @pf6()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f4()
%2 = tail call i32 (...) @f5()
%3 = tail call i32 (...) @f6()
%4 = tail call i32 (...) @pf1()
%5 = tail call i32 (...) @pf2()
%6 = tail call i32 (...) @pf3()
%7 = tail call i32 (...) @pf4()
%8 = tail call i32 (...) @pf5()
%9 = tail call i32 (...) @pf6()
ret i32 0
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void avl_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<avl_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <avl_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avl_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @avl_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @avl_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C0_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void I2C0_IRQHandler(void) {
  I2C0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @I2C0_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @I2C0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @I2C0_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @I2C0_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char const *, char const *);
void usage(char const *progname) {
  {
    printf((char const
                *__restrict)"usage: %s Experimentspecification gaborimagedir "
                            "graph_directory output_directory maskfile\n",
           progname);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [91 x i8] c"usage: %s Experimentspecification gaborimagedir graph_directory output_directory maskfile\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [91 x i8] c"usage: %s Experimentspecification gaborimagedir graph_directory output_directory maskfile\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = argc - 1; i > 0; i--)
    reverse(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <reverse@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1146 <main+0x36>
mov    %rsi,%r14
mov    %edi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <reverse@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x2,%rbx
ja     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @reverse(i8* %11)
%13 = icmp ugt i64 %7, 2
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
float tanhf(float);
float plogisticf(float x) { return 0.5f * (1.0f + tanhf(x / 2.0f)); }


x86 assembly (clang, -O0):
<plogisticf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xede(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <tanhf@plt>
movss  0xec9(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xeb9(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plogisticf>:
push   %rax
mulss  0xee7(%rip),%xmm0
call   1030 <tanhf@plt>
addss  0xede(%rip),%xmm0
mulss  0xed2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @plogisticf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 2.000000e+00
%5 = call float @tanhf(float %4)
%6 = fadd float 1.000000e+00, %5
%7 = fmul float 5.000000e-01, %6
ret float %7
}

LLVM IR (-O2):
define float @plogisticf(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = tail call float @tanhf(float %2)
%4 = fadd float %3, 1.000000e+00
%5 = fmul float %4, 5.000000e-01
ret float %5
}
/* Type definitions */
typedef int __m64;

/* Variables and functions */
__m64 __attribute__((__always___, __nodebug__))
_mm_xor_si64(__m64 __m1, __m64 __m2) {
  return __m1 ^ __m2;
}


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

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

LLVM IR (-O0):
define i32 @_mm_xor_si64(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 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @_mm_xor_si64(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
void MUTEX_LOCK(struct brcmf_pub *drvr) {}


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

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

LLVM IR (-O0):
%struct.brcmf_pub = type opaque
define void @MUTEX_LOCK(%struct.brcmf_pub* %0) {
%2 = alloca %struct.brcmf_pub*
store %struct.brcmf_pub* %0, %struct.brcmf_pub** %2
ret void
}

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define void @MUTEX_LOCK(%struct.brcmf_pub* nocapture %0) {
ret void
}
/* Type definitions */
struct list_data {
  int dummy;
};

/* Variables and functions */
int remote_fetch_list_aux(int /*<<< orphan*/, struct list_data *, int);
int remote_fetch_pretty_list(struct list_data *d) {
  return remote_fetch_list_aux(0, d, 1);
}


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

x86 assembly (clang, -O2):
<remote_fetch_pretty_list>:
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0x1,%edx
jmp    1030 <remote_fetch_list_aux@plt>

LLVM IR (-O0):
%struct.list_data = type { i32 }
define i32 @remote_fetch_pretty_list(%struct.list_data* %0) {
%2 = alloca %struct.list_data*
store %struct.list_data* %0, %struct.list_data** %2
%3 = load %struct.list_data*, %struct.list_data** %2
%4 = call i32 @remote_fetch_list_aux(i32 0, %struct.list_data* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.list_data = type { i32 }
define i32 @remote_fetch_pretty_list(%struct.list_data* %0) {
%2 = tail call i32 @remote_fetch_list_aux(i32 0, %struct.list_data* %0, i32 1)
ret i32 %2
}
unsigned long getUnsignedLong(char *ptr) {
  long val = (unsigned char)ptr[0] + ((unsigned char)ptr[1] * 256) +
             ((unsigned char)ptr[2] * 256 * 256);
  return val;
}


x86 assembly (clang, -O0):
<getUnsignedLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUnsignedLong>:
movzwl (%rdi),%ecx
movzbl 0x2(%rdi),%eax
shl    $0x10,%rax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @getUnsignedLong(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
ret i64 %13
}
/* Type definitions */
struct sigaction {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;
typedef int pid_t;

/* Variables and functions */
int SIGUSR1;
int /*<<< orphan*/ SIG_IGN;
int getpid();
int /*<<< orphan*/ kill(int, int);
int /*<<< orphan*/ setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
int main() {
  sigset_t mask;
  struct sigaction sa;
  pid_t pid;
  signal(SIGUSR1, SIG_IGN);
  pid = getpid();
  setpgid(0, 0);
  kill(pid, SIGUSR1);
  kill(-1, -1);
  kill(pid, -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x14(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1060 <setpgid@plt>
mov    -0x14(%rbp),%edi
mov    0x2e65(%rip),%rax
mov    (%rax),%esi
call   1050 <kill@plt>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1050 <kill@plt>
mov    -0x14(%rbp),%edi
mov    $0xffffffff,%esi
call   1050 <kill@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%r14
mov    (%r14),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %edi,%edi
xor    %esi,%esi
call   1060 <setpgid@plt>
mov    (%r14),%esi
mov    %ebx,%edi
call   1050 <kill@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
call   1050 <kill@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
call   1050 <kill@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIGUSR1 = global i32 0
@SIG_IGN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sigaction
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @SIGUSR1
%6 = load i32, i32* @SIG_IGN
%7 = call i32 @signal(i32 %5, i32 %6)
%8 = call i32 (...) @getpid()
store i32 %8, i32* %4
%9 = call i32 @setpgid(i32 0, i32 0)
%10 = load i32, i32* %4
%11 = load i32, i32* @SIGUSR1
%12 = call i32 @kill(i32 %10, i32 %11)
%13 = call i32 @kill(i32 -1, i32 -1)
%14 = load i32, i32* %4
%15 = call i32 @kill(i32 %14, i32 -1)
ret i32 0
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@SIG_IGN = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGUSR1
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @setpgid(i32 0, i32 0)
%6 = load i32, i32* @SIGUSR1
%7 = tail call i32 @kill(i32 %4, i32 %6)
%8 = tail call i32 @kill(i32 -1, i32 -1)
%9 = tail call i32 @kill(i32 %4, i32 -1)
ret i32 0
}
/* Type definitions */
struct drand48_data {
  int /*<<< orphan*/ __x;
};

/* Variables and functions */
int __erand48_r(int /*<<< orphan*/, struct drand48_data *, double *);
int drand48_r(struct drand48_data *buffer, double *result) {
  return __erand48_r(buffer->__x, buffer, result);
}


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

x86 assembly (clang, -O2):
<drand48_r>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    (%rdi),%edi
jmp    1030 <__erand48_r@plt>

LLVM IR (-O0):
%struct.drand48_data = type { i32 }
define i32 @drand48_r(%struct.drand48_data* %0, double* %1) {
%3 = alloca %struct.drand48_data*
%4 = alloca double*
store %struct.drand48_data* %0, %struct.drand48_data** %3
store double* %1, double** %4
%5 = load %struct.drand48_data*, %struct.drand48_data** %3
%6 = getelementptr inbounds %struct.drand48_data, %struct.drand48_data* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.drand48_data*, %struct.drand48_data** %3
%9 = load double*, double** %4
%10 = call i32 @__erand48_r(i32 %7, %struct.drand48_data* %8, double* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.drand48_data = type { i32 }
define i32 @drand48_r(%struct.drand48_data* %0, double* %1) {
%3 = getelementptr inbounds %struct.drand48_data, %struct.drand48_data* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @__erand48_r(i32 %4, %struct.drand48_data* %0, double* %1)
ret i32 %5
}
/* Variables and functions */
size_t strxspn(char const *, char const *, int /*<<< orphan*/);
size_t strspn(const char *s, const char *accept) {
  return strxspn(s, accept, 0);
}


x86 assembly (clang, -O0):
<strspn>:
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 <strxspn@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @strspn(i8* %0, i8* %1) {
%3 = tail call i64 @strxspn(i8* %0, i8* %1, i32 0)
ret i64 %3
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int getuid() { return syscall(4, 0, 0); }


x86 assembly (clang, -O0):
<getuid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuid>:
mov    $0x4,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getuid() {
%1 = call i32 @syscall(i32 4, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getuid() {
%1 = tail call i32 @syscall(i32 4, i32 0, i32 0)
ret i32 %1
}
int eq_pointer(const void *p1, const void *p2) { return p1 == p2; }


x86 assembly (clang, -O0):
<eq_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_pointer>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @eq_pointer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @eq_pointer(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_ORI();
void do0xF6() { _I8080_ORI(); }


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

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

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

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