xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ a1();
void b(unsigned long data) {
  if (data & 0x80000000)
    a1();
  data <<= 1;
  if (data & 0x80000000)
    a1();
  data <<= 1;
  if (data & 0x80000000)
    a1();
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x80000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     113b <b+0x2b>
mov    $0x0,%al
call   1030 <a1@plt>
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x8(%rbp)
movabs $0x80000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1166 <b+0x56>
mov    $0x0,%al
call   1030 <a1@plt>
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x8(%rbp)
movabs $0x80000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1191 <b+0x81>
mov    $0x0,%al
call   1030 <a1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rbx
mov    %rdi,%rbx
test   $0x80000000,%ebx
jne    112e <b+0x1e>
test   $0x40000000,%ebx
jne    113d <b+0x2d>
test   $0x20000000,%ebx
jne    114c <b+0x3c>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <a1@plt>
test   $0x40000000,%ebx
je     1124 <b+0x14>
xor    %eax,%eax
call   1030 <a1@plt>
test   $0x20000000,%ebx
je     112c <b+0x1c>
xor    %eax,%eax
pop    %rbx
jmp    1030 <a1@plt>

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

LLVM IR (-O2):
define void @b(i64 %0) {
%2 = and i64 %0, 2147483648
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @a1()
br label %6
6: ; preds = %4, %1
%7 = and i64 %0, 1073741824
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (...) @a1()
br label %11
11: ; preds = %9, %6
%12 = and i64 %0, 536870912
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 (...) @a1()
br label %16
16: ; preds = %14, %11
ret void
}
void upload_progress_callback_dummy(int aLoaded) {}


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

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

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

LLVM IR (-O2):
define void @upload_progress_callback_dummy(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x73() {
  Assert_real((isodigit(115) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              580, ("isodigit should be 0 for s"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x73>:
push   %rbp
mov    %rsp,%rbp
mov    $0x73,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x244,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x73>:
push   %rax
mov    $0x73,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x244,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for s\00"
define void @t_isodigit_0x73() {
%1 = call i64 @isodigit(i32 115)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 580, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for s\00"
define void @t_isodigit_0x73() {
%1 = tail call i64 @isodigit(i32 115)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 580, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void item_free(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<item_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @item_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int bt_sys_lseek(int, int, int);
int _lseek_r(struct _reent *r, int file, int ptr, int dir) {
  return bt_sys_lseek(file, ptr, dir);
}


x86 assembly (clang, -O0):
<_lseek_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <bt_sys_lseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lseek_r>:
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <bt_sys_lseek@plt>

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

LLVM IR (-O2):
%struct._reent = type { i32 }
define i32 @_lseek_r(%struct._reent* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @bt_sys_lseek(i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bson_get_current(char *, char **, int *);
char *bson_next(char *);
int bson_array_find_next_embedded_doc(char **buffer) {
  char *read_field;
  int read_type;
  *buffer = bson_next(*buffer);
  bson_get_current(*buffer, &read_field, &read_type);
  return read_type == 0x03;
}


x86 assembly (clang, -O0):
<bson_array_find_next_embedded_doc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <bson_next@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <bson_get_current@plt>
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_array_find_next_embedded_doc>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <bson_next@plt>
mov    %rax,(%rbx)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
call   1040 <bson_get_current@plt>
xor    %eax,%eax
cmpl   $0x3,0x4(%rsp)
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bson_array_find_next_embedded_doc(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = call i8* @bson_next(i8* %6)
%8 = load i8**, i8*** %2
store i8* %7, i8** %8
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = call i32 @bson_get_current(i8* %10, i8** %3, i32* %4)
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 3
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @bson_array_find_next_embedded_doc(i8** nocapture %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = bitcast i8** %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = load i8*, i8** %0
%7 = tail call i8* @bson_next(i8* %6)
store i8* %7, i8** %0
%8 = call i32 @bson_get_current(i8* %7, i8** %2, i32* %3)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
ret i32 %11
}
int wpas_p2p_notif_pbc_overlap(struct wpa_supplicant *wpa_s) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define i32 @wpas_p2p_notif_pbc_overlap(%struct.wpa_supplicant* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int write(int, char *, int);
int main(int argc, char **argv) {
  int l = 14;
  int r = write(1, "Hello, world!\n", l);
  if (r < 0)
    return -1;
  if (r != l)
    return 1 + r;
  else
    return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xe,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x1,%edi
lea    0xec4(%rip),%rsi
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115a <main+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <main+0x6b>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1174 <main+0x64>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117b <main+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0xe,%eax
cmovne %ecx,%edx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%4 = icmp eq i32 %3, 14
%5 = add nsw i32 %3, 1
%6 = select i1 %4, i32 0, i32 %5
%7 = icmp sgt i32 %3, -1
%8 = select i1 %7, i32 %6, i32 -1
ret i32 %8
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void LCDIDDConfigSet(uint32_t ui32Base, uint32_t ui32Config) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000000C))) = ui32Config;
}


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

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

LLVM IR (-O0):
define void @LCDIDDConfigSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 12
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @LCDIDDConfigSet(i64 %0, i64 %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
int guess_tilt_angle(int angle_speed, int angle_accel) {
  return angle_speed + angle_accel * 4;
}


x86 assembly (clang, -O0):
<guess_tilt_angle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @guess_tilt_angle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 4
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @guess_tilt_angle(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = add nsw i32 %3, %0
ret i32 %4
}
int analog(int port) {}


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

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

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

LLVM IR (-O2):
define i32 @analog(i32 %0) {
ret i32 undef
}
int liballoc_lock() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @liballoc_lock() {
ret i32 0
}
void fc194(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    goto a;
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc194>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc194+0x7>

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

LLVM IR (-O0):
define void @fc194(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %1
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
br label %11
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc194(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void mdp4_lcdc_vsync_init(int cndx) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_lcdc_vsync_init(i32 %0) {
ret void
}
int exchange(int *a, int *b) {
  int tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @exchange(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 undef
}
char const *basefilename(const char const *p) {
  char const *b = p, *q = p;
  for (;;)
    switch (*q++) {
    case '/':
      b = q;
      break;
    case 0:
      return b;
    }
}


x86 assembly (clang, -O0):
<basefilename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     1158 <basefilename+0x58>
jmp    113a <basefilename+0x3a>
mov    -0x1c(%rbp),%eax
sub    $0x2f,%eax
jne    115e <basefilename+0x5e>
jmp    114b <basefilename+0x4b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    115e <basefilename+0x5e>
mov    -0x10(%rbp),%rax
pop    %rbp
ret
jmp    1118 <basefilename+0x18>

x86 assembly (clang, -O2):
<basefilename>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
movsbl (%rcx),%edx
add    $0x1,%rcx
cmp    $0x2f,%edx
je     1122 <basefilename+0x22>
test   %edx,%edx
jne    1110 <basefilename+0x10>
jmp    1127 <basefilename+0x27>
mov    %rcx,%rax
jmp    1110 <basefilename+0x10>
ret

LLVM IR (-O0):
define i8* @basefilename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %2
store i8* %6, i8** %4
br label %7
7: ; preds = %16, %1
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
switch i32 %11, label %16 [
i32 47, label %12
i32 0, label %14
]
12: ; preds = %7
%13 = load i8*, i8** %4
store i8* %13, i8** %3
br label %16
14: ; preds = %7
%15 = load i8*, i8** %3
ret i8* %15
16: ; preds = %7, %12
br label %7
}

LLVM IR (-O2):
define i8* @basefilename(i8* %0) {
br label %2
2: ; preds = %4, %1
%3 = phi i8* [ %0, %1 ], [ %6, %4 ]
br label %4
4: ; preds = %2, %4
%5 = phi i8* [ %6, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
switch i32 %8, label %4 [
i32 47, label %2
i32 0, label %9
]
9: ; preds = %4
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_ucomige_ss(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_ucomige_ss(__m128 A, __m128 B) { return _mm_ucomige_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_ucomige_ss>:
jmp    1030 <_mm_ucomige_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_ucomige_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_ucomige_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char num;
  num = 77;
  printf("%c\n", num);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 77)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ ofl_queue_prop_type_print(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/);
int /*<<< orphan*/ *open_memstream(char **, size_t *);
char *ofl_queue_prop_type_to_string(uint16_t type) {
  char *str;
  size_t str_size;
  FILE *stream = open_memstream(&str, &str_size);
  ofl_queue_prop_type_print(stream, type);
  fclose(stream);
  return str;
}


x86 assembly (clang, -O0):
<ofl_queue_prop_type_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <ofl_queue_prop_type_print@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofl_queue_prop_type_to_string>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <ofl_queue_prop_type_print@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ofl_queue_prop_type_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %2
%6 = call i32* @open_memstream(i8** %3, i64* %4)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %2
%9 = call i32 @ofl_queue_prop_type_print(i32* %7, i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ofl_queue_prop_type_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32* @open_memstream(i8** %2, i64* %3)
%7 = call i32 @ofl_queue_prop_type_print(i32* %6, i32 %0)
%8 = call i32 @fclose(i32* %6)
%9 = load i8*, i8** %2
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void runtime_block(unsigned long milliseconds) { usleep(milliseconds * 1000); }


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

x86 assembly (clang, -O2):
<runtime_block>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @runtime_block(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @runtime_block(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ stderr;
void *lmalloc(size_t size) {
  void *p = malloc(size);
  memset(p, 0, size);
  if (!p) {
    fprintf(stderr, "malloc failed for: %lu\n", size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<lmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1196 <lmalloc+0x56>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe79(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
test   %rbx,%rbx
je     116c <lmalloc+0x2c>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"malloc failed for: %lu\0A\00"
define i8* @lmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = load i64, i64* %2
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %1
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"malloc failed for: %lu\0A\00"
define i8* @lmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
%4 = icmp eq i8* %2, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i8* %2
}
void beClient() {}


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

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

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

LLVM IR (-O2):
define void @beClient() {
ret void
}
int test_imm_6Euint16_reg(unsigned short val) {
  return ((val) & (0x6E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Euint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x6e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Euint16_reg>:
test   $0x6e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Euint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 110
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_6Euint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 110
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_less_or_equal(void) {
  gen_pop();
  gen_call("ccle");
}


x86 assembly (clang, -O0):
<gen_less_or_equal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_less_or_equal>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ccle\00"
define void @gen_less_or_equal() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ccle\00"
define void @gen_less_or_equal() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int dup2(int oldfd, int newfd) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<dup2>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ send_req(int, int, int, int);
int u_hw_reset(int fd, char **argv) {
  argv = argv;
  send_req(fd, 0x00, 0x01, 1);
  return 0;
}


x86 assembly (clang, -O0):
<u_hw_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1030 <send_req@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_hw_reset>:
push   %rax
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1030 <send_req@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @u_hw_reset(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
store i8** %5, i8*** %4
%6 = load i32, i32* %3
%7 = call i32 @send_req(i32 %6, i32 0, i32 1, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @u_hw_reset(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @send_req(i32 %0, i32 0, i32 1, i32 1)
ret i32 0
}
/* Type definitions */
struct blob_attr {
  int dummy;
};

/* Variables and functions */
int blobmsg_data_len(struct blob_attr const *);
int blobmsg_len(const struct blob_attr *attr) { return blobmsg_data_len(attr); }


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

x86 assembly (clang, -O2):
<blobmsg_len>:
jmp    1030 <blobmsg_data_len@plt>

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

LLVM IR (-O2):
%struct.blob_attr = type { i32 }
define i32 @blobmsg_len(%struct.blob_attr* %0) {
%2 = tail call i32 @blobmsg_data_len(%struct.blob_attr* %0)
ret i32 %2
}
int check_type() { return (257); }


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

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

LLVM IR (-O0):
define i32 @check_type() {
ret i32 257
}

LLVM IR (-O2):
define i32 @check_type() {
ret i32 257
}
int control_flow(int a) {
  if (a)
    return 6;
  else
    return 4;
}


x86 assembly (clang, -O0):
<control_flow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <control_flow+0x1d>
movl   $0x6,-0x4(%rbp)
jmp    1124 <control_flow+0x24>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<control_flow>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
add    %eax,%eax
add    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @control_flow(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 4, i32 6
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Mali_PrintMem(unsigned int volatile *, int);
void Mali_ReadDescriptor(volatile unsigned int *descriptor_address) {
  Mali_PrintMem(descriptor_address, 12);
}


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

x86 assembly (clang, -O2):
<Mali_ReadDescriptor>:
mov    $0xc,%esi
jmp    1030 <Mali_PrintMem@plt>

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

LLVM IR (-O2):
define void @Mali_ReadDescriptor(i32* %0) {
%2 = tail call i32 @Mali_PrintMem(i32* %0, i32 12)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ np_werror(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strerror_r(int, char *, int);
void create_rerror(int ecode) {
  char buf[256];
  if (strerror_r(ecode, buf, sizeof(buf)))
    strcpy(buf, "unknown error");
  np_werror(buf, ecode);
}


x86 assembly (clang, -O0):
<create_rerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1050 <strerror_r@plt>
cmp    $0x0,%rax
je     116f <create_rerror+0x3f>
lea    -0x110(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <np_werror@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_rerror>:
push   %rbx
sub    $0x100,%rsp
mov    %edi,%ebx
mov    %rsp,%rsi
mov    $0x100,%edx
call   1050 <strerror_r@plt>
test   %rax,%rax
je     115b <create_rerror+0x2b>
lea    0xead(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcpy@plt>
mov    %rsp,%rdi
mov    %ebx,%esi
call   1030 <np_werror@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unknown error\00"
define void @create_rerror(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = call i64 @strerror_r(i32 %4, i8* %5, i32 256)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%13 = load i32, i32* %2
%14 = call i32 @np_werror(i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"unknown error\00"
define void @create_rerror(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i64 @strerror_r(i32 %0, i8* %3, i32 256)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = call i32 @np_werror(i8* %3, i32 %0)
ret void
}
/* Variables and functions */
size_t hash_set_threshold(size_t capacity, float load_factor) {
  return (size_t)(capacity * load_factor);
}


x86 assembly (clang, -O0):
<hash_set_threshold>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x14(%rbp)
test   %rax,%rax
movss  %xmm0,-0x10(%rbp)
js     114a <hash_set_threshold+0x4a>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttss2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movss  0xe91(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_set_threshold>:
test   %rdi,%rdi
js     110c <hash_set_threshold+0xc>
cvtsi2ss %rdi,%xmm1
jmp    1121 <hash_set_threshold+0x21>
mov    %rdi,%rax
shr    %rax
and    $0x1,%edi
or     %rax,%rdi
cvtsi2ss %rdi,%xmm1
addss  %xmm1,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subss  0xec7(%rip),%xmm1
cvttss2si %xmm1,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @hash_set_threshold(i64 %0, float %1) {
%3 = alloca i64
%4 = alloca float
store i64 %0, i64* %3
store float %1, float* %4
%5 = load i64, i64* %3
%6 = uitofp i64 %5 to float
%7 = load float, float* %4
%8 = fmul float %6, %7
%9 = fptoui float %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @hash_set_threshold(i64 %0, float %1) {
%3 = uitofp i64 %0 to float
%4 = fmul float %3, %1
%5 = fptoui float %4 to i64
ret i64 %5
}
unsigned char *put_int16(unsigned char *buffer, int val) {
  *buffer++ = val & 0xff;
  *buffer++ = (val & 0xff00) >> 8;
  return buffer;
}


x86 assembly (clang, -O0):
<put_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_int16>:
mov    %si,(%rdi)
lea    0x2(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @put_int16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
store i8 %7, i8* %8
%10 = load i32, i32* %4
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
store i8 %13, i8* %14
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @put_int16(i8* writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %0
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %4
ret i8* %7
}
epage(p) int p;
{
  if (p != 0x00)
    emit(p);
}


x86 assembly (clang, -O0):
<epage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <epage+0x1f>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <emit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epage>:
test   %edi,%edi
je     1120 <epage+0x10>
push   %rax
xor    %eax,%eax
call   1030 <emit@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @epage(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %7)
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @epage(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %0)
br label %5
5: ; preds = %3, %1
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ polyglot_array_typeid(int /*<<< orphan*/,
                                         int /*<<< orphan*/);
void *polyglot_as_typed(void *, int /*<<< orphan*/);
int /*<<< orphan*/ polyglot_i32_typeid();
__attribute__((always_)) int32_t *polyglot_as_i32_array(void *p) {
  void *ret =
      polyglot_as_typed(p, polyglot_array_typeid(polyglot_i32_typeid(), 0));
  return (int32_t *)ret;
}


x86 assembly (clang, -O0):
<polyglot_as_i32_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <polyglot_i32_typeid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <polyglot_array_typeid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <polyglot_as_typed@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polyglot_as_i32_array>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <polyglot_i32_typeid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <polyglot_array_typeid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <polyglot_as_typed@plt>

LLVM IR (-O0):
define i32* @polyglot_as_i32_array(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (...) @polyglot_i32_typeid()
%6 = call i32 @polyglot_array_typeid(i32 %5, i32 0)
%7 = call i8* @polyglot_as_typed(i8* %4, i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
ret i32* %9
}

LLVM IR (-O2):
define i32* @polyglot_as_i32_array(i8* %0) {
%2 = tail call i32 (...) @polyglot_i32_typeid()
%3 = tail call i32 @polyglot_array_typeid(i32 %2, i32 0)
%4 = tail call i8* @polyglot_as_typed(i8* %0, i32 %3)
%5 = bitcast i8* %4 to i32*
ret i32* %5
}
int msm_watchdog_resume(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @msm_watchdog_resume(%struct.device* nocapture readnone %0) {
ret i32 0
}
int parse(unsigned char *str, unsigned char c) {
  char *pr = str, *pw = str;
  while (*pr) {
    *pw = *pr++;
    pw += (*pw != c);
  }
  *pw = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <parse+0x6a>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <parse+0x1e>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
mov    (%rdi),%dl
test   %dl,%dl
je     112b <parse+0x2b>
movzbl %sil,%eax
lea    0x1(%rdi),%rcx
xchg   %ax,%ax
mov    %dl,(%rdi)
movsbl %dl,%edx
xor    %esi,%esi
cmp    %eax,%edx
setne  %sil
add    %rsi,%rdi
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <parse+0x10>
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @parse(i8* nocapture %0, i8 zeroext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = zext i8 %1 to i32
br label %7
7: ; preds = %5, %7
%8 = phi i8 [ %3, %5 ], [ %16, %7 ]
%9 = phi i8* [ %0, %5 ], [ %15, %7 ]
%10 = phi i8* [ %0, %5 ], [ %11, %7 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %8, i8* %9
%12 = sext i8 %8 to i32
%13 = icmp ne i32 %12, %6
%14 = zext i1 %13 to i64
%15 = getelementptr inbounds i8, i8* %9, i64 %14
%16 = load i8, i8* %11
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %7
18: ; preds = %7, %2
%19 = phi i8* [ %0, %2 ], [ %15, %7 ]
store i8 0, i8* %19
ret i32 0
}
int larger(int a, int b) {
  if (a > b)
    return a;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @larger(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}