xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void show_header() {
  printf("%-40.40s%-20.20s%-10.10s%-16.16s\n", "Address", "HWaddress", "HWType",
         "Iface");
}


x86 assembly (clang, -O0):
<show_header>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf00(%rip),%rsi
lea    0xf01(%rip),%rdx
lea    0xf04(%rip),%rcx
lea    0xf04(%rip),%r8
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_header>:
lea    0xee9(%rip),%rdi
lea    0xf04(%rip),%rsi
lea    0xf05(%rip),%rdx
lea    0xf08(%rip),%rcx
lea    0xf08(%rip),%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"%-40.40s%-20.20s%-10.10s%-16.16s\0A\00"
@.str.1 = [8 x i8] c"Address\00"
@.str.2 = [10 x i8] c"HWaddress\00"
@.str.3 = [7 x i8] c"HWType\00"
@.str.4 = [6 x i8] c"Iface\00"
define void @show_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"%-40.40s%-20.20s%-10.10s%-16.16s\0A\00"
@.str.1 = [8 x i8] c"Address\00"
@.str.2 = [10 x i8] c"HWaddress\00"
@.str.3 = [7 x i8] c"HWType\00"
@.str.4 = [6 x i8] c"Iface\00"
define void @show_header() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret void
}
short _swaps(short s) {
  short r[2];
  register char *p, *q;
  p = (char *)&r[1];
  q = (char *)&s;
  *--p = *q++;
  *--p = *q++;
  return r[0];
}


x86 assembly (clang, -O0):
<_swaps>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x6(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
movswl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swaps>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @_swaps(i16 signext %0) {
%2 = alloca i16
%3 = alloca [2 x i16]
%4 = alloca i8*
%5 = alloca i8*
store i16 %0, i16* %2
%6 = getelementptr inbounds [2 x i16], [2 x i16]* %3, i64 0, i64 1
%7 = bitcast i16* %6 to i8*
store i8* %7, i8** %4
%8 = bitcast i16* %2 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %5
%11 = load i8, i8* %9
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 -1
store i8* %13, i8** %4
store i8 %11, i8* %13
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %5
%16 = load i8, i8* %14
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 -1
store i8* %18, i8** %4
store i8 %16, i8* %18
%19 = getelementptr inbounds [2 x i16], [2 x i16]* %3, i64 0, i64 0
%20 = load i16, i16* %19
ret i16 %20
}

LLVM IR (-O2):
define signext i16 @_swaps(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
void string_free_split_command(char **split_command) {
  int i;
  if (split_command) {
    for (i = 0; split_command[i]; i++)
      free(split_command[i]);
    free(split_command);
  }
}


x86 assembly (clang, -O0):
<string_free_split_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <string_free_split_command+0x59>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1160 <string_free_split_command+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <string_free_split_command+0x1e>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_free_split_command>:
test   %rdi,%rdi
je     1150 <string_free_split_command+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <string_free_split_command+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <string_free_split_command+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @string_free_split_command(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %13, %1
ret void
}
double nAn(void) { return 0.0 / 0.0; }


x86 assembly (clang, -O0):
<nAn>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @nAn() {
ret double 0x7FF8000000000000
}

LLVM IR (-O2):
define double @nAn() {
ret double 0x7FF8000000000000
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
char *strchr(char *, char);
char *fgets_nonl(char *buf, int size, FILE *s) {
  char *nl;
  if (!fgets(buf, size, s))
    return NULL;
  nl = strchr(buf, '\n');
  if (nl == NULL)
    return NULL;
  *nl = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<fgets_nonl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fgets@plt>
cmp    $0x0,%eax
jne    1159 <fgets_nonl+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1192 <fgets_nonl+0x72>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1183 <fgets_nonl+0x63>
movq   $0x0,-0x8(%rbp)
jmp    1192 <fgets_nonl+0x72>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_nonl>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fgets@plt>
test   %eax,%eax
je     1144 <fgets_nonl+0x24>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1144 <fgets_nonl+0x24>
movb   $0x0,(%rax)
jmp    1146 <fgets_nonl+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @fgets_nonl(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %6
store i8 0, i8* %7
br label %10
10: ; preds = %6, %3, %9
%11 = phi i8* [ %0, %9 ], [ null, %3 ], [ null, %6 ]
ret i8* %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t inverse_adjust_seed_4(uint32_t seed) {
  return seed ^ (seed << 4) ^ (seed << 8) ^ (seed << 12) ^ (seed << 16) ^
         (seed << 20) ^ (seed << 24) ^ (seed << 28);
}


x86 assembly (clang, -O0):
<inverse_adjust_seed_4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x4,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0xc,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x14,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1c,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse_adjust_seed_4>:
mov    %edi,%eax
shl    $0x4,%eax
xor    %edi,%eax
mov    %edi,%ecx
shl    $0x8,%ecx
mov    %edi,%edx
shl    $0xc,%edx
xor    %ecx,%edx
xor    %eax,%edx
mov    %edi,%eax
shl    $0x10,%eax
mov    %edi,%ecx
shl    $0x14,%ecx
xor    %eax,%ecx
mov    %edi,%eax
shl    $0x18,%eax
xor    %ecx,%eax
xor    %edx,%eax
shl    $0x1c,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @inverse_adjust_seed_4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 4
%6 = xor i32 %3, %5
%7 = load i32, i32* %2
%8 = shl i32 %7, 8
%9 = xor i32 %6, %8
%10 = load i32, i32* %2
%11 = shl i32 %10, 12
%12 = xor i32 %9, %11
%13 = load i32, i32* %2
%14 = shl i32 %13, 16
%15 = xor i32 %12, %14
%16 = load i32, i32* %2
%17 = shl i32 %16, 20
%18 = xor i32 %15, %17
%19 = load i32, i32* %2
%20 = shl i32 %19, 24
%21 = xor i32 %18, %20
%22 = load i32, i32* %2
%23 = shl i32 %22, 28
%24 = xor i32 %21, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @inverse_adjust_seed_4(i32 %0) {
%2 = shl i32 %0, 4
%3 = xor i32 %2, %0
%4 = shl i32 %0, 8
%5 = xor i32 %3, %4
%6 = shl i32 %0, 12
%7 = xor i32 %5, %6
%8 = shl i32 %0, 16
%9 = xor i32 %7, %8
%10 = shl i32 %0, 20
%11 = xor i32 %9, %10
%12 = shl i32 %0, 24
%13 = xor i32 %11, %12
%14 = shl i32 %0, 28
%15 = xor i32 %13, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void _Unwind_DeleteException() { _unsupported(); }


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

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

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

LLVM IR (-O2):
define void @_Unwind_DeleteException() {
%1 = tail call i32 (...) @_unsupported()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_locked(char *, int);
int /*<<< orphan*/ lock_mem(int *);
int main(int argc, char *argv[]) {
  int a = 12;
  lock_mem(&a);
  check_locked(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/cme/toolbag/refs/heads/master/test_lock_mem.c",
      6);
  a = 13;
  check_locked(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/cme/toolbag/refs/heads/master/test_lock_mem.c",
      8);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xc,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <lock_mem@plt>
lea    0xeba(%rip),%rdi
mov    $0x6,%esi
call   1040 <check_locked@plt>
movl   $0xd,-0x14(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x8,%esi
call   1040 <check_locked@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xc,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <lock_mem@plt>
lea    0xec2(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <check_locked@plt>
movl   $0xd,0xc(%rsp)
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <check_locked@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cme/toolbag/refs/heads/master/test_lock_mem.c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 12, i32* %5
%6 = call i32 @lock_mem(i32* %5)
%7 = call i32 @check_locked(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 6)
store i32 13, i32* %5
%8 = call i32 @check_locked(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cme/toolbag/refs/heads/master/test_lock_mem.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 12, i32* %3
%5 = call i32 @lock_mem(i32* %3)
%6 = call i32 @check_locked(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 6)
store i32 13, i32* %3
%7 = call i32 @check_locked(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
const char *getSpec(void) { return "typ_spec { name=typ_OscType; }"; }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"typ_spec { name=typ_OscType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [31 x i8] c"typ_spec { name=typ_OscType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo1(int);
int /*<<< orphan*/ freeWakeLock(int /*<<< orphan*/);
int /*<<< orphan*/ getWakeLock(int);
void foo2(int i) {
  if (i == 0)
    return;
  foo1(i);
  if (i % 2 == 0)
    freeWakeLock(0);
  else
    getWakeLock(1);
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114a <foo2+0x1a>
jmp    117c <foo2+0x4c>
mov    -0x4(%rbp),%edi
call   1050 <foo1@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1172 <foo2+0x42>
xor    %edi,%edi
call   1040 <freeWakeLock@plt>
jmp    117c <foo2+0x4c>
mov    $0x1,%edi
call   1030 <getWakeLock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
test   %edi,%edi
je     1149 <foo2+0x19>
push   %rbx
mov    %edi,%ebx
call   1050 <foo1@plt>
test   $0x1,%bl
pop    %rbx
jne    114a <foo2+0x1a>
xor    %edi,%edi
jmp    1040 <freeWakeLock@plt>
ret
mov    $0x1,%edi
jmp    1030 <getWakeLock@plt>

LLVM IR (-O0):
define void @foo2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @foo1(i32 %7)
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 @freeWakeLock(i32 0)
br label %16
14: ; preds = %6
%15 = call i32 @getWakeLock(i32 1)
br label %16
16: ; preds = %5, %14, %12
ret void
}

LLVM IR (-O2):
define void @foo2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @foo1(i32 %0)
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @freeWakeLock(i32 0)
br label %11
9: ; preds = %3
%10 = tail call i32 @getWakeLock(i32 1)
br label %11
11: ; preds = %1, %9, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(double);
int main() {
  int i;
  for (i = 0; i < 100; i++)
    f(7.44);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    114b <main+0x3b>
movsd  0xec8(%rip),%xmm0
call   1030 <f@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
movsd  0xed8(%rip),%xmm0
call   1030 <f@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @f(double 7.440000e+00)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @f(double 7.440000e+00)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *BT_malloc(size_t uSize) { return malloc(uSize); }


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

x86 assembly (clang, -O2):
<BT_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @BT_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int strv_insert(char ***, int /*<<< orphan*/, char *);
int strv_push_prepend(char ***l, char *value) {
  return strv_insert(l, 0, value);
}


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

x86 assembly (clang, -O2):
<strv_push_prepend>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <strv_insert@plt>

LLVM IR (-O0):
define i32 @strv_push_prepend(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 i32 @strv_insert(i8*** %5, i32 0, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strv_push_prepend(i8*** %0, i8* %1) {
%3 = tail call i32 @strv_insert(i8*** %0, i32 0, i8* %1)
ret i32 %3
}
unsigned char inbyte(unsigned short _port) {
  unsigned char rv;
  __asm__ __volatile__("inb %1, %0" : "=a"(rv) : "dN"(_port));
  return rv;
}


x86 assembly (clang, -O0):
<inbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inbyte>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inbyte(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inbyte(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ troca(int *, int *);
void sort_2(int a[]) {
  if (a[0] > a[1])
    troca(&a[0], &a[1]);
}


x86 assembly (clang, -O0):
<sort_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jle    1140 <sort_2+0x30>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x4,%rsi
call   1030 <troca@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_2>:
mov    (%rdi),%eax
cmp    0x4(%rdi),%eax
jle    1120 <sort_2+0x10>
lea    0x4(%rdi),%rsi
jmp    1030 <troca@plt>
ret

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

LLVM IR (-O2):
define void @sort_2(i32* %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = icmp sgt i32 %2, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @troca(i32* %0, i32* %3)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *restrict s, const char *restrict delim) {
  static char *last;
  return strtok_r(s, delim, &last);
}


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

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.last = internal global i8* null
define i8* @strtok(i8* noalias %0, i8* noalias %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 i8* @strtok_r(i8* %5, i8* %6, i8** @strtok.last)
ret i8* %7
}

LLVM IR (-O2):
@strtok.last = internal global i8* null
define i8* @strtok(i8* noalias %0, i8* noalias nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.last)
ret i8* %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
pid_t _fork(void) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fork>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exgcd(long, long, long *, long *);
long inverse(long num, long mod) {
  long x, y;
  exgcd(num, mod, &x, &y);
  while (x < 0)
    x += mod, y -= num;
  return x;
}


x86 assembly (clang, -O0):
<inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <exgcd@plt>
cmpq   $0x0,-0x18(%rbp)
jge    1160 <inverse+0x50>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1135 <inverse+0x25>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rsp,%rdx
lea    0x8(%rsp),%rcx
call   1030 <exgcd@plt>
mov    (%rsp),%rax
test   %rax,%rax
jns    1135 <inverse+0x25>
xchg   %ax,%ax
add    %rbx,%rax
js     1130 <inverse+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @inverse(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
%9 = call i32 @exgcd(i64 %7, i64 %8, i64* %5, i64* %6)
br label %10
10: ; preds = %13, %2
%11 = load i64, i64* %5
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = add nsw i64 %15, %14
store i64 %16, i64* %5
%17 = load i64, i64* %3
%18 = load i64, i64* %6
%19 = sub nsw i64 %18, %17
store i64 %19, i64* %6
br label %10
20: ; preds = %10
%21 = load i64, i64* %5
ret i64 %21
}

LLVM IR (-O2):
define i64 @inverse(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = call i32 @exgcd(i64 %0, i64 %1, i64* %3, i64* %4)
%8 = load i64, i64* %3
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2, %10
%11 = phi i64 [ %12, %10 ], [ %8, %2 ]
%12 = add nsw i64 %11, %1
%13 = icmp slt i64 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10, %2
%15 = phi i64 [ %8, %2 ], [ %12, %10 ]
ret i64 %15
}
/* Variables and functions */
int vdb_printf(char *, float, float, float);
__attribute__((weak)) int vdb_color(float r, float g, float b) {
  return vdb_printf("c %f %f %f\n", r, g, b);
}


x86 assembly (clang, -O0):
<vdb_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <vdb_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"c %f %f %f\0A\00"
define weak i32 @vdb_color(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call i32 @vdb_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %7, float %8, float %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"c %f %f %f\0A\00"
define weak i32 @vdb_color(float %0, float %1, float %2) {
%4 = tail call i32 @vdb_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %0, float %1, float %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ display_usage(char **, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void display_help(char *argv[]) {
  display_usage(argv, stdout);
  printf("-h                      => this help message\n");
  printf("-w hostname:port => connect to _hostname_ on _port_ server port\n");
}


x86 assembly (clang, -O0):
<display_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1040 <display_usage@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_help>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1040 <display_usage@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [46 x i8] c"-h => this help message\0A\00"
@.str.1 = [65 x i8] c"-w hostname:port => connect to _hostname_ on _port_ server port\0A\00"
define void @display_help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i32, i32* @stdout
%5 = call i32 @display_usage(i8** %3, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [45 x i8] c"-h => this help message\00"
@str.2 = [64 x i8] c"-w hostname:port => connect to _hostname_ on _port_ server port\00"
define void @display_help(i8** %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @display_usage(i8** %0, i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CheckRunningInMainThread(char *);
void SetDialogBalloonHelpID(int balloonHelpID) {
  if (!CheckRunningInMainThread("SetDialogBalloonHelpID"))
    return;
}


x86 assembly (clang, -O0):
<SetDialogBalloonHelpID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1135 <SetDialogBalloonHelpID+0x25>
jmp    1135 <SetDialogBalloonHelpID+0x25>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"SetDialogBalloonHelpID\00"
define void @SetDialogBalloonHelpID(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"SetDialogBalloonHelpID\00"
define void @SetDialogBalloonHelpID(i32 %0) {
%2 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
long min(const long a, const long b) {
  if (a > b) {
    return b;
  } else if (b > a) {
    return a;
  } else if (b == a) {
    return 0;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <min+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <min+0x67>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1142 <min+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <min+0x67>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    115d <min+0x5d>
movq   $0x0,-0x8(%rbp)
jmp    1167 <min+0x67>
jmp    1162 <min+0x62>
jmp    1167 <min+0x67>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
xor    %eax,%eax
cmp    %rdi,%rsi
cmovg  %rdi,%rax
cmovl  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp sgt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %5
store i64 %10, i64* %3
br label %24
11: ; preds = %2
%12 = load i64, i64* %5
%13 = load i64, i64* %4
%14 = icmp sgt i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i64, i64* %4
store i64 %16, i64* %3
br label %24
17: ; preds = %11
%18 = load i64, i64* %5
%19 = load i64, i64* %4
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17
store i64 0, i64* %3
br label %24
22: ; preds = %17
br label %23
23: ; preds = %22
br label %24
24: ; preds = %9, %15, %21, %23
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = icmp sgt i64 %1, %0
%5 = select i1 %4, i64 %0, i64 0
%6 = select i1 %3, i64 %1, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ logger_fatal(char *, char const *, char const *,
                                unsigned int);
int /*<<< orphan*/ system_halt();
__attribute__((noreturn)) void
system_bug_on(const char *file, unsigned int line, const char *func) {
  logger_fatal("bug on @%s() (%s:%u)", func, file, line);
  system_halt();
}


x86 assembly (clang, -O0):
<system_bug_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xebb(%rip),%rdi
call   1030 <logger_fatal@plt>
mov    $0x0,%al
call   1040 <system_halt@plt>

x86 assembly (clang, -O2):
<system_bug_on>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rax
lea    0xed3(%rip),%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <logger_fatal@plt>
xor    %eax,%eax
call   1040 <system_halt@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"bug on @%s() (%s:%u)\00"
define void @system_bug_on(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @logger_fatal(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
%11 = call i32 (...) @system_halt()
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"bug on @%s() (%s:%u)\00"
define void @system_bug_on(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @logger_fatal(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i32 %1)
%5 = tail call i32 (...) @system_halt()
unreachable
}
txt_metaseq(num) {
  prtime();
  printf("Meta event, sequence number = %d\n", num);
}


x86 assembly (clang, -O0):
<txt_metaseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x8(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_metaseq>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Meta event, sequence number = %d\0A\00"
define i32 @txt_metaseq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @prtime()
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [34 x i8] c"Meta event, sequence number = %d\0A\00"
define i32 @txt_metaseq(i32 %0) {
%2 = tail call i32 (...) @prtime()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_inquiry_result_get_reserved1(const uint8_t *event) {
  return event[10];
}


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

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

LLVM IR (-O0):
define i32 @hci_event_inquiry_result_get_reserved1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 10
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_inquiry_result_get_reserved1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 10
%3 = load i32, i32* %2
ret i32 %3
}
void _mcs51_genXRAMCLEAR() {}


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

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

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

LLVM IR (-O2):
define void @_mcs51_genXRAMCLEAR() {
ret void
}
void conversion(int accumulator, int *remainder) {
  int i;
  i = accumulator / 64;
  *remainder = accumulator - (64 * i);
}


x86 assembly (clang, -O0):
<conversion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x14(%rbp),%eax
shl    $0x6,%eax
sub    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<conversion>:
lea    0x3f(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xffffffc0,%eax
sub    %eax,%edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @conversion(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 = sdiv i32 %6, 64
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = mul nsw i32 64, %9
%11 = sub nsw i32 %8, %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @conversion(i32 %0, i32* nocapture writeonly %1) {
%3 = srem i32 %0, 64
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aes_encr(unsigned char *, unsigned char *);
int /*<<< orphan*/ expandKey(unsigned char *, unsigned char *);
void aes_encrypt(unsigned char *state, unsigned char *key) {
  unsigned char expandedKey[176];
  expandKey(expandedKey, key);
  aes_encr(state, expandedKey);
}


x86 assembly (clang, -O0):
<aes_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xc0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <expandKey@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1030 <aes_encr@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_encrypt>:
push   %r14
push   %rbx
sub    $0xb8,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <expandKey@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <aes_encr@plt>
add    $0xb8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @aes_encrypt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [176 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [176 x i8], [176 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @expandKey(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [176 x i8], [176 x i8]* %5, i64 0, i64 0
%11 = call i32 @aes_encr(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @aes_encrypt(i8* %0, i8* %1) {
%3 = alloca [176 x i8]
%4 = getelementptr inbounds [176 x i8], [176 x i8]* %3, i64 0, i64 0
%5 = call i32 @expandKey(i8* %4, i8* %1)
%6 = call i32 @aes_encr(i8* %0, i8* %4)
ret void
}
double fhalf(double x) { return x / 2.0; }


x86 assembly (clang, -O0):
<fhalf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @fhalf(double %0) {
%2 = fmul double %0, 5.000000e-01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ environ_set_environment(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void set_database_environment(char *destination_application, char really_yn) {
  environ_set_environment("APPASERVER_DATABASE", destination_application);
  if (really_yn != 'y') {
    printf("<p>Setting environment: %s\n", destination_application);
  }
}


x86 assembly (clang, -O0):
<set_database_environment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <environ_set_environment@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x79,%eax
je     115f <set_database_environment+0x3f>
mov    -0x8(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_database_environment>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <environ_set_environment@plt>
cmp    $0x79,%bpl
jne    1144 <set_database_environment+0x24>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"APPASERVER_DATABASE\00"
@.str.1 = [28 x i8] c"<p>Setting environment: %s\0A\00"
define void @set_database_environment(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 = call i32 @environ_set_environment(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 121
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"APPASERVER_DATABASE\00"
@.str.1 = [28 x i8] c"<p>Setting environment: %s\0A\00"
define void @set_database_environment(i8* %0, i8 signext %1) {
%3 = tail call i32 @environ_set_environment(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = icmp eq i8 %1, 121
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;
typedef int __u32;

/* Variables and functions */
int /*<<< orphan*/ BPF_ANY;
int /*<<< orphan*/ bpf_update_elem(int, int *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/);
void clear_stats(int fd) {
  __u32 key;
  __u64 value = 0;
  for (key = 0; key < 100; key++)
    bpf_update_elem(fd, &key, &value, BPF_ANY);
}


x86 assembly (clang, -O0):
<clear_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    115a <clear_stats+0x4a>
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%ecx
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <bpf_update_elem@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <clear_stats+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_stats>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    0x2eb0(%rip),%r12
mov    %rsp,%r14
lea    0x4(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r12),%ecx
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <bpf_update_elem@plt>
mov    (%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsp)
cmp    $0x63,%eax
jl     1140 <clear_stats+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@BPF_ANY = global i32 0
define void @clear_stats(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* @BPF_ANY
%11 = call i32 @bpf_update_elem(i32 %9, i32* %3, i32* %4, i32 %10)
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
@BPF_ANY = global i32 0
define void @clear_stats(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
store i32 0, i32* %2
br label %6
6: ; preds = %1, %6
%7 = load i32, i32* @BPF_ANY
%8 = call i32 @bpf_update_elem(i32 %0, i32* %2, i32* %3, i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
%11 = icmp slt i32 %9, 99
br i1 %11, label %6, label %12
12: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char *argv[]) { printf("%c", **++argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
lea    0xec7(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rax
movsbl (%rax),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\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 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i32 1
store i8** %6, i8*** %4
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
int get_XNoExposeEvent_send_event(void *_p) {
  return (int)((XNoExposeEvent *)_p)->send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XNoExposeEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __CrestInit();
void __globinit_triangle(void) {
  { __CrestInit(); }
}


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

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

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

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