xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int);
void merge_sort(int ar[], int start, int n) {
  if (n > 1) {
    int half = n / 2;
    merge_sort(ar, start, half);
    merge_sort(ar, start + half, n - half);
    merge(ar, start, n);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jle    117d <merge_sort+0x5d>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    $0x1,%edx
jle    1167 <merge_sort+0x47>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%r15
mov    %edx,%ebx
shr    %ebx
mov    %ebx,%edx
call   1040 <merge_sort@plt>
mov    %ebp,%edx
sub    %ebx,%edx
add    %r14d,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <merge_sort@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <merge@plt>
ret

LLVM IR (-O0):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %27
10: ; preds = %3
%11 = load i32, i32* %6
%12 = sdiv i32 %11, 2
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = sub nsw i32 %20, %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = call i32 @merge(i32* %23, i32 %24, i32 %25)
br label %27
27: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 1
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = lshr i32 %2, 1
tail call void @merge_sort(i32* %0, i32 %1, i32 %7)
%8 = add nsw i32 %7, %1
%9 = sub nsw i32 %2, %7
tail call void @merge_sort(i32* %0, i32 %8, i32 %9)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, char const *);
void print_help(const char *progname) {
  const char *help_msg =
      "%s - help options\n"
      "       -m      memory  How much memory (MB) to allocate each VM\n"
      "       -p      prefix  Prefix of the image file names\n"
      "       -s      suffix  Suffix of the image file names\n"
      "       -v      vmdir   Path to directory containing VM images\n"
      "       -k      kernel  Path to the kernel\n"
      "       -i      initrd  Path to the initrd\n"
      "       -n      number  Number of VMS to boot\n"
      "       -q      qemu    Path to qemu binary (default: "
      "qemu-system-x86_64\n"
      "       -h      help    Print this help message\n";
  printf(help_msg, progname);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [501 x i8] c"%s - help options\0A -m memory How much memory (MB) to allocate each VM\0A -p prefix Prefix of the image file names\0A -s suffix Suffix of the image file names\0A -v vmdir Path to directory containing VM images\0A -k kernel Path to the kernel\0A -i initrd Path to the initrd\0A -n number Number of VMS to boot\0A -q qemu Path to qemu binary (default: qemu-system-x86_64\0A -h help Print this help message\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([501 x i8], [501 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [501 x i8] c"%s - help options\0A -m memory How much memory (MB) to allocate each VM\0A -p prefix Prefix of the image file names\0A -s suffix Suffix of the image file names\0A -v vmdir Path to directory containing VM images\0A -k kernel Path to the kernel\0A -i initrd Path to the initrd\0A -n number Number of VMS to boot\0A -q qemu Path to qemu binary (default: qemu-system-x86_64\0A -h help Print this help message\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([501 x i8], [501 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *get_continent_name_and_code(char const *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void geoip_set_continent(const char *continent, char *loc) {
  if (continent)
    sprintf(loc, "%s", get_continent_name_and_code(continent));
  else
    sprintf(loc, "%s", "Unknown");
}


x86 assembly (clang, -O0):
<geoip_set_continent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1164 <geoip_set_continent+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_continent_name_and_code@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xea6(%rip),%rsi
call   1040 <sprintf@plt>
jmp    117b <geoip_set_continent+0x5b>
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
lea    0xe8d(%rip),%rdx
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoip_set_continent>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     113a <geoip_set_continent+0x1a>
call   1040 <get_continent_name_and_code@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>
movabs $0x6e776f6e6b6e55,%rax
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"Unknown\00"
define void @geoip_set_continent(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = call i8* @get_continent_name_and_code(i8* %9)
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %15
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
define void @geoip_set_continent(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i8* @get_continent_name_and_code(i8* %0)
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %1, i8* dereferenceable(1) %5)
br label %9
7: ; preds = %2
%8 = bitcast i8* %1 to i64*
store i64 31093567915781717, i64* %8
br label %9
9: ; preds = %7, %4
ret void
}
int main() {
  char c = 0;
  int i = 1;
  if (sizeof(__builtin_choose_expr(1, c, i)) != sizeof(char)) {
    printf("Error %d\n", (int)1);
    exit(1);
  };
  if (sizeof(__builtin_choose_expr(0, c, i)) != sizeof(int)) {
    printf("Error %d\n", (int)2);
    exit(2);
  };
  int *p = __builtin_choose_expr(1, &i, 2.0);
  double d = __builtin_choose_expr(0, &i, 2.0);
  c = __builtin_choose_expr(1, c, i++);
  if (i != 1) {
    printf("Error %d\n", (int)3);
    exit(3);
  }
  c = __builtin_choose_expr(0, c, i++);
  if (i != 2) {
    printf("Error %d\n", (int)4);
    exit(4);
  }
  return __builtin_choose_expr(1, 0, 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movl   $0x1,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x5(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     117c <main+0x5c>
lea    0xea2(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    %al,-0x5(%rbp)
cmpl   $0x2,-0xc(%rbp)
je     11b1 <main+0x91>
lea    0xe6d(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double
store i32 0, i32* %1
store i8 0, i8* %2
store i32 1, i32* %3
store i32* %3, i32** %4
store double 2.000000e+00, double* %5
%6 = load i8, i8* %2
store i8 %6, i8* %2
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
unreachable
11: ; preds = %0
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
%14 = trunc i32 %12 to i8
store i8 %14, i8* %2
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 2
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
unreachable
19: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int _receive_eox(struct MIDIDevice *device) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.MIDIDevice = type opaque
define i32 @_receive_eox(%struct.MIDIDevice* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void abort(void) {
  raise(SIGABRT);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
jmp    1122 <abort+0x12>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
nop
jmp    1120 <abort+0x10>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
br label %3
3: ; preds = %3, %0
br label %3
}
int happyValue(int n) {
  int ret = 0;
  while (n) {
    ret += (n % 10) * (n % 10);
    n = n / 10;
  }
  return ret;
}


x86 assembly (clang, -O0):
<happyValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1150 <happyValue+0x50>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
imul   %edx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <happyValue+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<happyValue>:
xor    %eax,%eax
test   %edi,%edi
je     113e <happyValue+0x3e>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
imul   %esi,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <happyValue+0x10>
ret

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

LLVM IR (-O2):
define i32 @happyValue(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = mul nsw i32 %6, %6
%8 = add nuw nsw i32 %7, %4
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int vsnprintf_l(char *str, size_t size, locale_t l, const char *fmt,
                va_list args) {
  return vsnprintf(str, size, fmt, args);
}


x86 assembly (clang, -O0):
<vsnprintf_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <vsnprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf_l>:
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @vsnprintf_l(i8* nocapture %0, i64 %1, i32 %2, i8* nocapture %3, i32 %4) {
%6 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %3, i32 %4)
ret i32 %6
}
int *bar(int *x, int *y) { return y; }


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

x86 assembly (clang, -O2):
<bar>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i32* @bar(i32* nocapture readnone %0, i32* readnone returned %1) {
ret i32* %1
}
int parent(int i) { return (i - 1) / 2; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ kernvar(int /*<<< orphan*/, char *, char *, int);
void stop_tracing(void) { kernvar(O_WRONLY, "tracing_enabled", "0", 1); }


x86 assembly (clang, -O0):
<stop_tracing>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xee5(%rip),%rdx
mov    $0x1,%ecx
call   1030 <kernvar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_tracing>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xee9(%rip),%rdx
mov    $0x1,%ecx
jmp    1030 <kernvar@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@.str = [16 x i8] c"tracing_enabled\00"
@.str.1 = [2 x i8] c"0\00"
define void @stop_tracing() {
%1 = load i32, i32* @O_WRONLY
%2 = call i32 @kernvar(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@.str = [16 x i8] c"tracing_enabled\00"
@.str.1 = [2 x i8] c"0\00"
define void @stop_tracing() {
%1 = load i32, i32* @O_WRONLY
%2 = tail call i32 @kernvar(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_statusbar();
int /*<<< orphan*/ put_pixel(int, int, int);
void clear_screen(void) {
  for (int y = 0; y < 768; ++y)
    for (int x = 0; x < 1024; ++x)
      put_pixel(x, y, 0xFF000000);
  draw_statusbar();
}


x86 assembly (clang, -O0):
<clear_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x300,-0x4(%rbp)
jge    1181 <clear_screen+0x61>
movl   $0x0,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jge    116e <clear_screen+0x4e>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0xff000000,%edx
call   1040 <put_pixel@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <clear_screen+0x23>
jmp    1173 <clear_screen+0x53>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <clear_screen+0xf>
mov    $0x0,%al
call   1030 <draw_statusbar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0xff000000,%edx
call   1040 <put_pixel@plt>
add    $0x1,%ebp
cmp    $0x400,%ebp
jne    1140 <clear_screen+0x20>
add    $0x1,%ebx
cmp    $0x300,%ebx
jne    1130 <clear_screen+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <draw_statusbar@plt>

LLVM IR (-O0):
define void @clear_screen() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %18, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 768
br i1 %5, label %6, label %21
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %14, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1024
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %1
%13 = call i32 @put_pixel(i32 %11, i32 %12, i32 -16777216)
br label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %7
17: ; preds = %7
br label %18
18: ; preds = %17
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %3
21: ; preds = %3
%22 = call i32 (...) @draw_statusbar()
ret void
}

LLVM IR (-O2):
define void @clear_screen() {
br label %1
1: ; preds = %0, %5
%2 = phi i32 [ 0, %0 ], [ %6, %5 ]
br label %8
3: ; preds = %5
%4 = tail call i32 (...) @draw_statusbar()
ret void
5: ; preds = %8
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 768
br i1 %7, label %3, label %1
8: ; preds = %1, %8
%9 = phi i32 [ 0, %1 ], [ %11, %8 ]
%10 = tail call i32 @put_pixel(i32 %9, i32 %2, i32 -16777216)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, 1024
br i1 %12, label %5, label %8
}
int checkSym(char symbol) {
  if ((symbol >= '0' && symbol <= '9') || (symbol >= 'A' && symbol <= 'F')) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<checkSym>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <checkSym+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    113e <checkSym+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     114a <checkSym+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     114a <checkSym+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <checkSym+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkSym>:
lea    -0x3a(%rdi),%eax
cmp    $0xf6,%al
setb   %al
add    $0xb9,%dil
cmp    $0xfa,%dil
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @checkSym(i8 signext %0) {
%2 = add i8 %0, -58
%3 = icmp ult i8 %2, -10
%4 = add i8 %0, -71
%5 = icmp ult i8 %4, -6
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
OP(ed, d2) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
void store64(uint8_t *x, uint64_t u) {
  unsigned int i;
  for (i = 0; i < 8; ++i) {
    x[i] = u;
    u >>= 8;
  }
}


x86 assembly (clang, -O0):
<store64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jae    1140 <store64+0x40>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <store64+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<store64>:
mov    %esi,(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x8(%rdi)
movd   %esi,%xmm0
sar    $0x18,%esi
mov    %esi,0xc(%rdi)
pshufd $0x0,%xmm0,%xmm0
psrad  $0x1f,%xmm0
movdqu %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @store64(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = ashr i32 %1, 16
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
%7 = ashr i32 %1, 24
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %8
%9 = ashr i32 %1, 31
%10 = getelementptr inbounds i32, i32* %0, i64 4
%11 = insertelement <4 x i32> poison, i32 %9, i64 0
%12 = shufflevector <4 x i32> %11, <4 x i32> poison, <4 x i32> zeroinitializer
%13 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> %12, <4 x i32>* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall_halt();
int main() {
  syscall_halt();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @syscall_halt()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void TtlMarshal_uint8_t(uint8_t **cursor, const uint8_t *x) {
  **cursor = *x;
  *cursor += 1;
}


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

x86 assembly (clang, -O2):
<TtlMarshal_uint8_t>:
mov    (%rsi),%eax
mov    (%rdi),%rcx
mov    %eax,(%rcx)
add    $0x4,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define void @TtlMarshal_uint8_t(i32** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32*, i32** %0
store i32 %3, i32* %4
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32* %5, i32** %0
ret void
}
/* Variables and functions */
char *search_replace(char *, char *, char *);
char *search_replace_string(char *source_destination, char *search_string,
                            char *replace_string) {
  return search_replace(search_string, replace_string, source_destination);
}


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

x86 assembly (clang, -O2):
<search_replace_string>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <search_replace@plt>

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

LLVM IR (-O2):
define i8* @search_replace_string(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @search_replace(i8* %1, i8* %2, i8* %0)
ret i8* %4
}
float expf(float x) {}


x86 assembly (clang, -O0):
<expf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @expf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %2
ret float %4
}

LLVM IR (-O2):
define float @expf(float %0) {
ret float undef
}
unsigned int count_bits(const unsigned int val) {
  return __builtin_popcount(val);
}


x86 assembly (clang, -O0):
<count_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%ecx
mov    %ecx,%eax
and    $0x33333333,%eax
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

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

LLVM IR (-O2):
define i32 @count_bits(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
ret i32 %2
}
void writeBitmap(void) {}


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

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

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

LLVM IR (-O2):
define void @writeBitmap() {
ret void
}
/* Variables and functions */
int FindOldGameFor(int);
int /*<<< orphan*/ RemoveOldGame(int);
int ReallyRemoveOldGamesForPlayer(int p) {
  int g0;
  g0 = FindOldGameFor(p);
  if (g0 < 0)
    return 0;
  RemoveOldGame(g0);
  return 0;
}


x86 assembly (clang, -O0):
<ReallyRemoveOldGamesForPlayer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <FindOldGameFor@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <ReallyRemoveOldGamesForPlayer+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    115b <ReallyRemoveOldGamesForPlayer+0x3b>
mov    -0xc(%rbp),%edi
call   1030 <RemoveOldGame@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReallyRemoveOldGamesForPlayer>:
push   %rax
call   1040 <FindOldGameFor@plt>
test   %eax,%eax
js     1131 <ReallyRemoveOldGamesForPlayer+0x11>
mov    %eax,%edi
call   1030 <RemoveOldGame@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ReallyRemoveOldGamesForPlayer(i32 %0) {
%2 = tail call i32 @FindOldGameFor(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @RemoveOldGame(i32 %2)
br label %6
6: ; preds = %1, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
main() {
  long int a, b;
  a = 2;
  b = 1;
  printf("%ld\n", a);
  while (a != 0) {
    a = 2;
    b++;
    a = a * b;
    printf("%ld\n", a);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1180 <main+0x70>
movq   $0x2,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0x2f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    $0x2,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    $0x4,%ebx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x2,%rbx
jmp    1130 <main+0x20>

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 2, i64* %2
store i64 1, i64* %3
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
br label %6
6: ; preds = %9, %0
%7 = load i64, i64* %2
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %6
store i64 2, i64* %2
%10 = load i64, i64* %3
%11 = add nsw i64 %10, 1
store i64 %11, i64* %3
%12 = load i64, i64* %2
%13 = load i64, i64* %3
%14 = mul nsw i64 %12, %13
store i64 %14, i64* %2
%15 = load i64, i64* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %15)
br label %6
17: ; preds = %6
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 2)
br label %2
2: ; preds = %2, %0
%3 = phi i64 [ 1, %0 ], [ %4, %2 ]
%4 = add nuw nsw i64 %3, 1
%5 = shl nuw nsw i64 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %5)
br label %2
}
/* Variables and functions */
int hamming_distance(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *, char const *, int);
void testHamming(const char *str1, const char *str2) {
  printf("Distance between \"%s\" and \"%s\": %d\n", str1, str2,
         hamming_distance(str1, str2));
}


x86 assembly (clang, -O0):
<testHamming>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <hamming_distance@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testHamming>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <hamming_distance@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Distance between \22%s\22 and \22%s\22: %d\0A\00"
define void @testHamming(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 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @hamming_distance(i8* %7, i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Distance between \22%s\22 and \22%s\22: %d\0A\00"
define void @testHamming(i8* %0, i8* %1) {
%3 = tail call i32 @hamming_distance(i8* %0, i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %3)
ret void
}
foo(a, b) {
  if ((a & (1 << b)) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1130 <foo+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <foo+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%ecx
mov    %edi,%eax
not    %eax
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
void __attribute__((weak)) spi1_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<spi1_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi1_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.spi1_isr = [9 x i8] c"spi1_isr\00"
define weak void @spi1_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.spi1_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.spi1_isr = [9 x i8] c"spi1_isr\00"
define weak void @spi1_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.spi1_isr, i64 0, i64 0))
ret void
}
void ScaleRowDown34_1_Box_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_1_Box_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage() {
  printf("diffscan -h\n");
  printf("diffscan [-d] filename\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"diffscan -h\0A\00"
@.str.1 = [24 x i8] c"diffscan [-d] filename\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [12 x i8] c"diffscan -h\00"
@str.2 = [23 x i8] c"diffscan [-d] filename\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, long);
void platform_copy_string(char *destination, char *source, long max_length) {
  strncpy(destination, source, max_length);
}


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

x86 assembly (clang, -O2):
<platform_copy_string>:
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define void @platform_copy_string(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
short compareSection(int /*<<< orphan*/ *, int, int, char *);
short hasImageHexcode(FILE *file) {
  return compareSection(
      file, 0x1A6, 0x11,
      "\x78\xDA\xED\xDC\x5F\x48\x1C\x47\x18\x00\xF0\xF5\x0F\x1C\x82\x14\x1F");
}


x86 assembly (clang, -O0):
<hasImageHexcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1a6,%esi
mov    $0x11,%edx
lea    0xecf(%rip),%rcx
call   1030 <compareSection@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasImageHexcode>:
lea    0xee9(%rip),%rcx
mov    $0x1a6,%esi
mov    $0x11,%edx
jmp    1030 <compareSection@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"x\DA\ED\DC_H\1CG\18\00\F0\F5\0F\1C\82\14\1F\00"
define signext i16 @hasImageHexcode(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call signext i16 @compareSection(i32* %3, i32 422, i32 17, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i16 %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"x\DA\ED\DC_H\1CG\18\00\F0\F5\0F\1C\82\14\1F\00"
define signext i16 @hasImageHexcode(i32* %0) {
%2 = tail call signext i16 @compareSection(i32* %0, i32 422, i32 17, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i16 %2
}
void g(char *p, int n) {
  int i = 0;
  do
    *p = 0;
  while (++i < n);
  *p = 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmp    -0xc(%rbp),%eax
jl     1112 <g+0x12>
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movb   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @g(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 = %8, %2
%7 = load i8*, i8** %3
store i8 0, i8* %7
br label %8
8: ; preds = %6
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %6, label %13
13: ; preds = %8
%14 = load i8*, i8** %3
store i8 1, i8* %14
ret void
}

LLVM IR (-O2):
define void @g(i8* nocapture writeonly %0, i32 %1) {
store i8 1, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _delay_ms(unsigned int);
void delay_ms(unsigned int d) { _delay_ms(d); }


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

x86 assembly (clang, -O2):
<delay_ms>:
jmp    1030 <_delay_ms@plt>

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

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = tail call i32 @_delay_ms(i32 %0)
ret void
}
/* Variables and functions */
double exp10(double);
double Sleef_exp10_u10(double x) { return exp10(x); }


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

x86 assembly (clang, -O2):
<Sleef_exp10_u10>:
jmp    1030 <exp10@plt>

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

LLVM IR (-O2):
define double @Sleef_exp10_u10(double %0) {
%2 = tail call double @exp10(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
int my_printfv(char const *fmt, va_list vargs) {
  vfprintf(stderr, fmt, vargs);
  return 0;
}


x86 assembly (clang, -O0):
<my_printfv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_printfv>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <vfprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
define i32 @my_printfv(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret i32 0
}
void i915_debugfs_register(struct drm_i915_private *dev_priv) {}


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

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

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

LLVM IR (-O2):
%struct.drm_i915_private = type opaque
define void @i915_debugfs_register(%struct.drm_i915_private* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ bf_indent(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void bf_pp(FILE *out, int level, const char *text) {
  bf_indent(out, level);
  fputs(text, out);
  putc('\n', out);
}


x86 assembly (clang, -O0):
<bf_pp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <bf_indent@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1040 <putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_pp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1050 <bf_indent@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <putc@plt>

LLVM IR (-O0):
define void @bf_pp(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = call i32 @bf_indent(i32* %7, i32 %8)
%10 = load i8*, i8** %6
%11 = load i32*, i32** %4
%12 = call i32 @fputs(i8* %10, i32* %11)
%13 = load i32*, i32** %4
%14 = call i32 @putc(i8 signext 10, i32* %13)
ret void
}

LLVM IR (-O2):
define void @bf_pp(i32* %0, i32 %1, i8* nocapture %2) {
%4 = tail call i32 @bf_indent(i32* %0, i32 %1)
%5 = tail call i32 @fputs(i8* %2, i32* %0)
%6 = tail call i32 @putc(i8 signext 10, i32* %0)
ret void
}