xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ modem_close();
int /*<<< orphan*/ modem_open();
int /*<<< orphan*/ modem_setup();
int main() {
  modem_open();
  modem_setup();
  modem_close();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @modem_open()
%2 = tail call i32 (...) @modem_setup()
%3 = tail call i32 (...) @modem_close()
ret i32 0
}
int solib_main(arg)
int arg;
{ return arg * arg; }


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

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

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

LLVM IR (-O2):
define i32 @solib_main(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
void gall_laplace_sym_size(size_t m, size_t n, size_t *N, size_t *nz) {
  *N = m * n;
  *nz = 2 * (*N) - (m + n);
}


x86 assembly (clang, -O0):
<gall_laplace_sym_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
imul   -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
shl    $0x1,%rcx
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gall_laplace_sym_size>:
mov    %rsi,%rax
imul   %rdi,%rax
mov    %rax,(%rdx)
add    %rax,%rax
add    %rdi,%rsi
sub    %rsi,%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @gall_laplace_sym_size(i64 %0, i64 %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = mul i64 %9, %10
%12 = load i64*, i64** %7
store i64 %11, i64* %12
%13 = load i64*, i64** %7
%14 = load i64, i64* %13
%15 = mul i64 2, %14
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = add i64 %16, %17
%19 = sub i64 %15, %18
%20 = load i64*, i64** %8
store i64 %19, i64* %20
ret void
}

LLVM IR (-O2):
define void @gall_laplace_sym_size(i64 %0, i64 %1, i64* nocapture writeonly %2, i64* nocapture writeonly %3) {
%5 = mul i64 %1, %0
store i64 %5, i64* %2
%6 = shl i64 %5, 1
%7 = add i64 %1, %0
%8 = sub i64 %6, %7
store i64 %8, i64* %3
ret void
}
int handling_PWMIn_cmd(char *sPWMInCmdMesg) {
  int iResult = 0;
  return iResult;
}


x86 assembly (clang, -O0):
<handling_PWMIn_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @handling_PWMIn_cmd(i8* nocapture readnone %0) {
ret i32 0
}
int main(int argc, char *argv[]) {
  int x = 5;
  int y = 10;
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
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 5, i32* %6
store i32 10, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 15
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void _vs_assert(int a) { assert(a); }


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

x86 assembly (clang, -O2):
<_vs_assert>:
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @_vs_assert(i32 %0) {
%2 = tail call i32 @assert(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void con_deinit() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @con_deinit() {
%1 = tail call i32 (...) @endwin()
ret void
}
int gpio_usbotg_hs_active(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_usbotg_hs_active() {
ret i32 0
}
/* Type definitions */
typedef int __uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
__uid_t __geteuid(void) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__geteuid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__geteuid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__geteuid() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__geteuid() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
int plusandminus(int n) {
  if (n <= 0)
    return 0;
  else if (n > 100)
    return 100;
  return (plusandminus(n - 1) + plusandminus(n + 2));
}


x86 assembly (clang, -O0):
<plusandminus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <plusandminus+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116f <plusandminus+0x5f>
cmpl   $0x64,-0x8(%rbp)
jle    1147 <plusandminus+0x37>
movl   $0x64,-0x4(%rbp)
jmp    116f <plusandminus+0x5f>
jmp    114c <plusandminus+0x3c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <plusandminus@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    $0x2,%edi
call   1030 <plusandminus@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plusandminus>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <plusandminus+0x37>
mov    %edi,%ebx
mov    $0x64,%ebp
cmp    $0x64,%edi
ja     1149 <plusandminus+0x39>
add    $0xfffffffe,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%edi
call   1030 <plusandminus@plt>
add    %eax,%ebp
add    $0x2,%ebx
cmp    $0x63,%ebx
jb     1130 <plusandminus+0x20>
add    $0x64,%ebp
jmp    1149 <plusandminus+0x39>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @plusandminus(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 100
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ 0, %3 ]
%7 = phi i32 [ %10, %5 ], [ %0, %3 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @plusandminus(i32 %8)
%10 = add nuw nsw i32 %7, 2
%11 = add nsw i32 %9, %6
%12 = icmp ugt i32 %7, 98
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = add i32 %11, 100
br label %15
15: ; preds = %3, %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ], [ 100, %3 ]
ret i32 %16
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct datafile_list {
  int dummy;
};
struct datafile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_unlink(struct genlist *, struct datafile *);
void datafile_list_unlink(struct datafile_list *tthis, struct datafile *pfoo) {
  genlist_unlink(((struct genlist *)(tthis)), pfoo);
}


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

x86 assembly (clang, -O2):
<datafile_list_unlink>:
jmp    1030 <genlist_unlink@plt>

LLVM IR (-O0):
%struct.datafile_list = type { i32 }
%struct.datafile = type { i32 }
%struct.genlist = type { i32 }
define void @datafile_list_unlink(%struct.datafile_list* %0, %struct.datafile* %1) {
%3 = alloca %struct.datafile_list*
%4 = alloca %struct.datafile*
store %struct.datafile_list* %0, %struct.datafile_list** %3
store %struct.datafile* %1, %struct.datafile** %4
%5 = load %struct.datafile_list*, %struct.datafile_list** %3
%6 = bitcast %struct.datafile_list* %5 to %struct.genlist*
%7 = load %struct.datafile*, %struct.datafile** %4
%8 = call i32 @genlist_unlink(%struct.genlist* %6, %struct.datafile* %7)
ret void
}

LLVM IR (-O2):
%struct.datafile_list = type { i32 }
%struct.datafile = type { i32 }
%struct.genlist = type { i32 }
define void @datafile_list_unlink(%struct.datafile_list* %0, %struct.datafile* %1) {
%3 = bitcast %struct.datafile_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_unlink(%struct.genlist* %3, %struct.datafile* %1)
ret void
}
void dummy_gcode_finished(void *user) {}


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

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

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

LLVM IR (-O2):
define void @dummy_gcode_finished(i8* nocapture %0) {
ret void
}
/* Variables and functions */
void *memchr(const void *ptr, int val, size_t n) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @memchr(i8* nocapture readnone %0, i32 %1, i64 %2) {
ret i8* null
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
uint8_t to_runlevel(uint8_t c) {
  if (c == 's' || c == 'S')
    return 7;
  if (c >= '0' && c <= '6')
    return c - '0';
  return 0xFF;
}


x86 assembly (clang, -O0):
<to_runlevel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x73,%eax
je     1124 <to_runlevel+0x24>
movsbl -0x2(%rbp),%eax
cmp    $0x53,%eax
jne    112d <to_runlevel+0x2d>
movb   $0x7,-0x1(%rbp)
jmp    115a <to_runlevel+0x5a>
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1156 <to_runlevel+0x56>
movsbl -0x2(%rbp),%eax
cmp    $0x36,%eax
jg     1156 <to_runlevel+0x56>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    115a <to_runlevel+0x5a>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_runlevel>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xd0,%dil
cmp    $0x7,%dil
movzbl %dil,%ecx
mov    $0xff,%edx
cmovb  %ecx,%edx
cmp    $0x53,%al
mov    $0x7,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @to_runlevel(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 115
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 83
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8 7, i8* %2
br label %26
12: ; preds = %7
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 48
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 54
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 48
%24 = trunc i32 %23 to i8
store i8 %24, i8* %2
br label %26
25: ; preds = %16, %12
store i8 -1, i8* %2
br label %26
26: ; preds = %25, %20, %11
%27 = load i8, i8* %2
ret i8 %27
}

LLVM IR (-O2):
define signext i8 @to_runlevel(i8 signext %0) {
%2 = and i8 %0, -33
%3 = icmp eq i8 %2, 83
%4 = add i8 %0, -48
%5 = icmp ult i8 %4, 7
%6 = select i1 %5, i8 %4, i8 -1
%7 = select i1 %3, i8 7, i8 %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ sync();
void do_sync(int argc __attribute__((unused)),
             const char **argv __attribute__((unused))) {
  sync();
}


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

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

LLVM IR (-O0):
define void @do_sync(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @sync()
ret void
}

LLVM IR (-O2):
define void @do_sync(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sync()
ret void
}
void wifi_rsp_tcpip_dns_gethostbyname(
    const struct wifi_msg_tcpip_dns_gethostbyname_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_tcpip_dns_gethostbyname_rsp_t = type opaque
define void @wifi_rsp_tcpip_dns_gethostbyname(%struct.wifi_msg_tcpip_dns_gethostbyname_rsp_t* nocapture %0) {
ret void
}
int empty_line(char *str) {
  return str[0] == '\n' || str[0] == '\0' || (str[0] == '\r' && str[1] == '\n');
}


x86 assembly (clang, -O0):
<empty_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     115e <empty_line+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     115e <empty_line+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0xa(%rbp)
jne    1158 <empty_line+0x58>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_line>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     111e <empty_line+0x1e>
cmp    $0xa,%cl
je     111e <empty_line+0x1e>
xor    %eax,%eax
cmp    $0xd,%cl
jne    111e <empty_line+0x1e>
cmpb   $0xa,0x1(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @empty_line(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %8 [
i8 10, label %9
i8 0, label %9
i8 13, label %3
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
%7 = zext i1 %6 to i32
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %1, %8, %3
%10 = phi i32 [ 1, %1 ], [ %7, %3 ], [ 1, %1 ], [ 0, %8 ]
ret i32 %10
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
gid_t getgid(void) {
  printf("getgid\n");
  return 0xaffab1e;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"getgid\0A\00"
define i32 @getgid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 184527646
}

LLVM IR (-O2):
@str = [7 x i8] c"getgid\00"
define i32 @getgid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 184527646
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_2d(void **array) {
  free(array[0]);
  free(array);
}


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

x86 assembly (clang, -O2):
<free_2d>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_2d(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i8**
%7 = call i32 @free(i8** %6)
%8 = load i8**, i8*** %2
%9 = call i32 @free(i8** %8)
ret void
}

LLVM IR (-O2):
define void @free_2d(i8** nocapture %0) {
%2 = bitcast i8** %0 to i8***
%3 = load i8**, i8*** %2
%4 = tail call i32 @free(i8** %3)
%5 = tail call i32 @free(i8** %0)
ret void
}
long kernel__Int___45d(long self, long p0) {
  long var;
  long var1;
  var1 = self - p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

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

LLVM IR (-O0):
define i64 @kernel__Int___45d(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = sub nsw i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @kernel__Int___45d(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
__attribute__((__format__(__printf__, (1), (1 + 1)))) void
gumbo_debug(const char *unused__fmt __attribute__((__unused__)), ...) {}


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

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

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

LLVM IR (-O2):
define void @gumbo_debug(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
unsigned int do_rand(int /*<<< orphan*/ *);
int rand_r(unsigned int *ctx) {
  u_long val = (u_long)*ctx;
  *ctx = do_rand(&val);
  return (int)*ctx;
}


x86 assembly (clang, -O0):
<rand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <do_rand@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_r>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <do_rand@plt>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_r(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = call i32 @do_rand(i32* %3)
%7 = load i32*, i32** %2
store i32 %6, i32* %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rand_r(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
store i32 %4, i32* %2
%5 = call i32 @do_rand(i32* %2)
store i32 %5, i32* %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xa3() {
  Assert_real((islower(163) == 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_islower.c",
              820, ("islower should be 0 for 0xa3"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xa3>:
push   %rax
mov    $0xa3,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x334,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa3\00"
define void @t_islower_0xa3() {
%1 = call i64 @islower(i32 163)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 820, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa3\00"
define void @t_islower_0xa3() {
%1 = tail call i64 @islower(i32 163)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 820, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brake(double);
int /*<<< orphan*/ move_cursor_to(int /*<<< orphan*/, int /*<<< orphan*/);
void special_up(int key, int x, int y) {
  move_cursor_to(0, 0);
  brake(0.1);
}


x86 assembly (clang, -O0):
<special_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <move_cursor_to@plt>
movsd  0xebe(%rip),%xmm0
call   1040 <brake@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<special_up>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <move_cursor_to@plt>
movsd  0xece(%rip),%xmm0
pop    %rax
jmp    1040 <brake@plt>

LLVM IR (-O0):
define void @special_up(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @move_cursor_to(i32 0, i32 0)
%8 = call i32 @brake(double 1.000000e-01)
ret void
}

LLVM IR (-O2):
define void @special_up(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @move_cursor_to(i32 0, i32 0)
%5 = tail call i32 @brake(double 1.000000e-01)
ret void
}
/* Type definitions */
struct slab {
  int dummy;
};

/* Variables and functions */
int slab_sizeof();
struct slab *slab_from_data(void *data) {
  return (struct slab *)((char *)data - slab_sizeof());
}


x86 assembly (clang, -O0):
<slab_from_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <slab_sizeof@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slab_from_data>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <slab_sizeof@plt>
cltq
sub    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.slab = type { i32 }
define %struct.slab* @slab_from_data(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @slab_sizeof()
%5 = sext i32 %4 to i64
%6 = sub i64 0, %5
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = bitcast i8* %7 to %struct.slab*
ret %struct.slab* %8
}

LLVM IR (-O2):
%struct.slab = type { i32 }
define %struct.slab* @slab_from_data(i8* readnone %0) {
%2 = tail call i32 (...) @slab_sizeof()
%3 = sext i32 %2 to i64
%4 = sub nsw i64 0, %3
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = bitcast i8* %5 to %struct.slab*
ret %struct.slab* %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void exit_usage_error(char **argv) {
  printf(
      "Usage: %s -<ceif> [-2] [-x #] [-n cityname] snescity.srm [citymap.png]\n"
      " -c: create an SRAM file based on PNG map\n"
      " -e: export map from SRAM into PNG\n"
      " -i: import map from PNG into SRAM\n"
      " -f: fix SRAM file's checksum\n"
      " -2: operate on the second city\n"
      " -n cityname: specify the name for the newly-created city.\n"
      " -x: fix shores, forests and roads when importing.\n"
      " -I #: set additional flags for usage with -x\n"
      "\n",
      argv[0]);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [403 x i8] c"Usage: %s -<ceif> [-2] [-x #] [-n cityname] snescity.srm [citymap.png]\0A -c: create an SRAM file based on PNG map\0A -e: export map from SRAM into PNG\0A -i: import map from PNG into SRAM\0A -f: fix SRAM file's checksum\0A -2: operate on the second city\0A -n cityname: specify the name for the newly-created city.\0A -x: fix shores, forests and roads when importing.\0A -I #: set additional flags for usage with -x\0A\0A\00"
define void @exit_usage_error(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([403 x i8], [403 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [403 x i8] c"Usage: %s -<ceif> [-2] [-x #] [-n cityname] snescity.srm [citymap.png]\0A -c: create an SRAM file based on PNG map\0A -e: export map from SRAM into PNG\0A -i: import map from PNG into SRAM\0A -f: fix SRAM file's checksum\0A -2: operate on the second city\0A -n cityname: specify the name for the newly-created city.\0A -x: fix shores, forests and roads when importing.\0A -I #: set additional flags for usage with -x\0A\0A\00"
define void @exit_usage_error(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([403 x i8], [403 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct value {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ collect(struct value *);
char *get_str(struct value *);
int /*<<< orphan*/ new_int(int /*<<< orphan*/);
struct value *pop();
int /*<<< orphan*/ push(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void builtin_size() {
  struct value *v = pop();
  char *s = get_str(v);
  push(new_int(strlen(s)));
  collect(v);
}


x86 assembly (clang, -O0):
<builtin_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pop@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <get_str@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1060 <new_int@plt>
mov    %eax,%edi
call   1070 <push@plt>
mov    -0x8(%rbp),%rdi
call   1080 <collect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_size>:
push   %rbx
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <get_str@plt>
mov    %rax,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1060 <new_int@plt>
mov    %eax,%edi
call   1070 <push@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1080 <collect@plt>

LLVM IR (-O0):
%struct.value = type { i32 }
define void @builtin_size() {
%1 = alloca %struct.value*
%2 = alloca i8*
%3 = call %struct.value* (...) @pop()
store %struct.value* %3, %struct.value** %1
%4 = load %struct.value*, %struct.value** %1
%5 = call i8* @get_str(%struct.value* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @new_int(i32 %7)
%9 = call i32 @push(i32 %8)
%10 = load %struct.value*, %struct.value** %1
%11 = call i32 @collect(%struct.value* %10)
ret void
}

LLVM IR (-O2):
%struct.value = type { i32 }
define void @builtin_size() {
%1 = tail call %struct.value* (...) @pop()
%2 = tail call i8* @get_str(%struct.value* %1)
%3 = tail call i32 @strlen(i8* %2)
%4 = tail call i32 @new_int(i32 %3)
%5 = tail call i32 @push(i32 %4)
%6 = tail call i32 @collect(%struct.value* %1)
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int change_syscall(struct tcb *tcp, int new) {
  printf("Do we really call that (change_syscall) ???\n");
  exit(1);
}


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

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

LLVM IR (-O0):
%struct.tcb = type { i32 }
@.str = [45 x i8] c"Do we really call that (change_syscall) ???\0A\00"
define i32 @change_syscall(%struct.tcb* %0, i32 %1) {
%3 = alloca %struct.tcb*
%4 = alloca i32
store %struct.tcb* %0, %struct.tcb** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
@str = [44 x i8] c"Do we really call that (change_syscall) ???\00"
define i32 @change_syscall(%struct.tcb* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
int fib(int n) { return (n > 2) ? fib(n - 1) + n : 1; }


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jle    113b <fib+0x2b>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <fib+0x38>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <fib+0x38>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     1124 <fib+0x24>
lea    -0x1(%rdi),%eax
lea    -0x3(%rdi),%ecx
imul   %ecx,%eax
lea    -0x4(%rdi),%edx
imul   %rcx,%rdx
shr    %rdx
add    %edi,%eax
sub    %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = add nsw i32 %0, -3
%6 = mul i32 %4, %5
%7 = zext i32 %5 to i33
%8 = add nsw i32 %0, -4
%9 = zext i32 %8 to i33
%10 = mul i33 %7, %9
%11 = lshr i33 %10, 1
%12 = trunc i33 %11 to i32
%13 = add i32 %6, %0
%14 = sub i32 %13, %12
%15 = add i32 %14, 1
br label %16
16: ; preds = %3, %1
%17 = phi i32 [ 1, %1 ], [ %15, %3 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ _uarttx(char *, unsigned long);
unsigned char text_sender_length(char *target_str, unsigned long int length) {
  _uarttx(target_str, length);
  return ((unsigned char)1);
}


x86 assembly (clang, -O0):
<text_sender_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_uarttx@plt>
mov    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_sender_length>:
push   %rax
call   1030 <_uarttx@plt>
mov    $0x1,%al
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i8 @text_sender_length(i8* %0, i64 %1) {
%3 = tail call i32 @_uarttx(i8* %0, i64 %1)
ret i8 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char const *);
void check(int fail_condition, char const *restrict message) {
  if (fail_condition) {
    puts(message);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <check+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
jne    1125 <check+0x5>
ret
push   %rax
mov    %rsi,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @check(i32 %0, i8* noalias %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @puts(i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @check(i32 %0, i8* noalias nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *prg) {
  printf("USAGE: %s INPUTFILE=textFrom OUTPUTFILE=textTo\n", prg);
  printf("\tExample: %s mydoc.txt=change_me /tmp/newdoc.txt=changed\n", prg);
  printf("\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"USAGE: %s INPUTFILE=textFrom OUTPUTFILE=textTo\0A\00"
@.str.1 = [58 x i8] c"\09Example: %s mydoc.txt=change_me /tmp/newdoc.txt=changed\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"USAGE: %s INPUTFILE=textFrom OUTPUTFILE=textTo\0A\00"
@.str.1 = [58 x i8] c"\09Example: %s mydoc.txt=change_me /tmp/newdoc.txt=changed\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
void ThreadSetupSemaphore(void) {}


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

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

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

LLVM IR (-O2):
define void @ThreadSetupSemaphore() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_data();
void do_dump() { dump_data(); }


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

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

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

LLVM IR (-O2):
define void @do_dump() {
%1 = tail call i32 (...) @dump_data()
ret void
}
/* Type definitions */
typedef int CARD32;
typedef int CARD16;

/* Variables and functions */
CARD16 ConvertOlitAction(CARD32 olit_action) {
  CARD16 motif_action;
  motif_action = (1 << 1) | ((1 << 1) << 8);
  if (olit_action & (1 << 0))
    motif_action |= (1 << 0) | ((1 << 0) << 8);
  else if (olit_action & (1 << 10))
    motif_action |= (1 << 2) | ((1 << 2) << 8);
  return motif_action;
}


x86 assembly (clang, -O0):
<ConvertOlitAction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x202,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112d <ConvertOlitAction+0x2d>
mov    -0x8(%rbp),%eax
or     $0x101,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <ConvertOlitAction+0x4e>
mov    -0x4(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
je     1149 <ConvertOlitAction+0x49>
mov    -0x8(%rbp),%eax
or     $0x404,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <ConvertOlitAction+0x4e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertOlitAction>:
test   $0x400,%edi
mov    $0x202,%eax
mov    $0x606,%ecx
cmove  %eax,%ecx
test   $0x1,%dil
mov    $0x303,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ConvertOlitAction(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 514, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 257
store i32 %9, i32* %3
br label %18
10: ; preds = %1
%11 = load i32, i32* %2
%12 = and i32 %11, 1024
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %3
%16 = or i32 %15, 1028
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %10
br label %18
18: ; preds = %17, %7
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @ConvertOlitAction(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 1024
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 514, i32 1542
%7 = select i1 %3, i32 %6, i32 771
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char *a = "asdf";
  int c = 0;
  if (argc == 2) {
    c = strcmp(a, argv[1]);
    printf("%d\n", c);
  }
  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)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1175 <main+0x55>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    1148 <main+0x28>
push   %rax
mov    0x8(%rsi),%rsi
lea    0xecf(%rip),%rdi
call   1040 <strcmp@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"asdf\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %4, %2
ret i32 0
}
void RTVfsObjRelease(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsObjRelease() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ applyMultiProtocolPatch();
void rf_patch_cpe_multi_protocol(void) { applyMultiProtocolPatch(); }


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

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

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

LLVM IR (-O2):
define void @rf_patch_cpe_multi_protocol() {
%1 = tail call i32 (...) @applyMultiProtocolPatch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_getchar();
void c_getword() { c_getchar(); }


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

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

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

LLVM IR (-O2):
define void @c_getword() {
%1 = tail call i32 (...) @c_getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, uintptr_t, char *);
void printAddress(char *str, void *ptr) {
  printf("%16p or %20lu - %s\n", ptr, (uintptr_t)ptr, str);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"%16p or %20lu - %s\0A\00"
define void @printAddress(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%16p or %20lu - %s\0A\00"
define void @printAddress(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %3, i8* %0)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int INT64_MIN;
void mult_minimum_Bad() {
  int64_t x = -1;
  int64_t y = x * INT64_MIN;
}


x86 assembly (clang, -O0):
<mult_minimum_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed3(%rip),%rcx
imul   (%rcx),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@INT64_MIN = global i32 0
define void @mult_minimum_Bad() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @INT64_MIN
%5 = mul nsw i32 %3, %4
store i32 %5, i32* %2
ret void
}

LLVM IR (-O2):
@INT64_MIN = global i32 0
define void @mult_minimum_Bad() {
ret void
}