xunge/DecIR huggingface dataset:
signed short convert(signed int i) {
  if (i > 0x43c07fff)
    return 32767;
  else if (i < 0x43bf8000)
    return -32768;
  else
    return i - 0x43c00000;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x43c07fff,-0x8(%rbp)
jle    111f <convert+0x1f>
movw   $0x7fff,-0x2(%rbp)
jmp    1143 <convert+0x43>
cmpl   $0x43bf8000,-0x8(%rbp)
jge    1137 <convert+0x37>
movw   $0x8000,-0x2(%rbp)
jmp    1143 <convert+0x43>
mov    -0x8(%rbp),%eax
sub    $0x43c00000,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
cmp    $0x43bf8001,%edi
mov    $0x43bf8000,%ecx
cmovge %edi,%ecx
cmp    $0x43c07fff,%ecx
mov    $0x7fff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @convert(i32 %0) {
%2 = alloca i16
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 1136689151
br i1 %5, label %6, label %7
6: ; preds = %1
store i16 32767, i16* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 1136623616
br i1 %9, label %10, label %11
10: ; preds = %7
store i16 -32768, i16* %2
br label %15
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1136656384
%14 = trunc i32 %13 to i16
store i16 %14, i16* %2
br label %15
15: ; preds = %11, %10, %6
%16 = load i16, i16* %2
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @convert(i32 %0) {
%2 = icmp sgt i32 %0, 1136623616
%3 = select i1 %2, i32 %0, i32 1136623616
%4 = icmp ult i32 %3, 1136689151
%5 = select i1 %4, i32 %3, i32 1136689151
%6 = trunc i32 %5 to i16
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ _init_signal();
int /*<<< orphan*/ exit(int);
int main();
void _start() {
  int ex;
  _init_signal();
  ex = main();
  exit(ex);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_init_signal@plt>
mov    $0x0,%al
call   1040 <main@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1030 <_init_signal@plt>
xor    %eax,%eax
call   1040 <main@plt>
mov    %eax,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @_start() {
%1 = alloca i32
%2 = call i32 (...) @_init_signal()
%3 = call i32 (...) @main()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @_init_signal()
%2 = tail call i32 (...) @main()
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
bool nrf51_errata_76(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_76() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned char);
void os_move_cursor(int y, int x) {
  unsigned short position = (y * 80) + x;
  outb(0x3D4, 0x0F);
  outb(0x3D5, (unsigned char)(position & 0xFF));
  outb(0x3D4, 0x0E);
  outb(0x3D5, (unsigned char)((position >> 8) & 0xFF));
}


x86 assembly (clang, -O0):
<os_move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x50,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_move_cursor>:
push   %rbx
lea    (%rdi,%rdi,4),%ebx
shl    $0x4,%ebx
add    %esi,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @os_move_cursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 80
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %5
%11 = call i32 @outb(i32 980, i8 zeroext 15)
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = call i32 @outb(i32 981, i8 zeroext %15)
%17 = call i32 @outb(i32 980, i8 zeroext 14)
%18 = load i16, i16* %5
%19 = zext i16 %18 to i32
%20 = ashr i32 %19, 8
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = call i32 @outb(i32 981, i8 zeroext %22)
ret void
}

LLVM IR (-O2):
define void @os_move_cursor(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 80
%4 = add nsw i32 %3, %1
%5 = tail call i32 @outb(i32 980, i8 zeroext 15)
%6 = trunc i32 %4 to i8
%7 = tail call i32 @outb(i32 981, i8 zeroext %6)
%8 = tail call i32 @outb(i32 980, i8 zeroext 14)
%9 = lshr i32 %4, 8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @outb(i32 981, i8 zeroext %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xe2() {
  Assert_real((isgraph(226) == 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_isgraph.c",
              1135, ("isgraph should be 0 for 0xe2"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xe2>:
push   %rax
mov    $0xe2,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46f,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe2\00"
define void @t_isgraph_0xe2() {
%1 = call i64 @isgraph(i32 226)
%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 1135, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe2\00"
define void @t_isgraph_0xe2() {
%1 = tail call i64 @isgraph(i32 226)
%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 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_int(int /*<<< orphan*/);
int /*<<< orphan*/ term_attrs();
void cmd_term_attrs(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_int(term_attrs());
}


x86 assembly (clang, -O0):
<cmd_term_attrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_term_attrs+0x27>
jmp    117f <cmd_term_attrs+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1030 <term_attrs@plt>
mov    %eax,%edi
call   1060 <report_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_term_attrs>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_term_attrs+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1030 <term_attrs@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <report_int@plt>

LLVM IR (-O0):
define void @cmd_term_attrs(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @term_attrs()
%12 = call i32 @report_int(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_term_attrs(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @term_attrs()
%8 = tail call i32 @report_int(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
char *g_DUMMY_menu_get_label(int menu_id, int item_id) {
  menu_id = menu_id;
  item_id = item_id;
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @g_DUMMY_menu_get_label(i32 %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
int gpio_write(int, int /*<<< orphan*/);
int output_enable() {
  if (-1 == gpio_write(4, 0)) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<output_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <gpio_write@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    113f <output_enable+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <output_enable+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_enable>:
push   %rax
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <gpio_write@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @output_enable() {
%1 = tail call i32 @gpio_write(i32 4, i32 0)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned char even_parity(uint32_t data) {
  unsigned int temp = data ^ (data >> 16);
  temp = temp ^ (temp >> 8);
  temp = temp ^ (temp >> 4);
  temp = temp ^ (temp >> 2);
  temp = temp ^ (temp >> 1);
  return temp & 1;
}


x86 assembly (clang, -O0):
<even_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x1,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<even_parity>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @even_parity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = xor i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = xor i32 %8, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = lshr i32 %13, 4
%15 = xor i32 %12, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = load i32, i32* %3
%18 = lshr i32 %17, 2
%19 = xor i32 %16, %18
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = lshr i32 %21, 1
%23 = xor i32 %20, %22
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = and i32 %24, 1
%26 = trunc i32 %25 to i8
ret i8 %26
}

LLVM IR (-O2):
define zeroext i8 @even_parity(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 8
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = lshr i32 %7, 2
%9 = xor i32 %8, %7
%10 = lshr i32 %9, 1
%11 = xor i32 %10, %9
%12 = trunc i32 %11 to i8
%13 = and i8 %12, 1
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ Key(unsigned char, int /*<<< orphan*/, int /*<<< orphan*/);
void Menu(int value) { Key((unsigned char)value, 0, 0); }


x86 assembly (clang, -O0):
<Menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <Key@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Menu>:
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <Key@plt>

LLVM IR (-O0):
define void @Menu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @Key(i8 zeroext %4, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @Menu(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @Key(i8 zeroext %2, i32 0, i32 0)
ret void
}
void f_c(int i) {}


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

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

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

LLVM IR (-O2):
define void @f_c(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_pid_get_slice(pid_t pid,
                                                            char **slice) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_pid_get_slice>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_pid_get_slice>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_pid_get_slice(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_pid_get_slice(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ count_5();
char getchar();
int main() {
  count_5();
  while (getchar() != '\n')
    continue;
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <count_5@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     114e <main+0x2e>
jmp    1136 <main+0x16>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <count_5@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @count_5()
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call signext i8 (...) @getchar()
ret i32 0
}
double cosmology_redshift(const double a) { return 1.0 / a - 1.0; }


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

x86 assembly (clang, -O2):
<cosmology_redshift>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @cosmology_redshift(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fadd double %2, -1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ PRIO_PROCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpriority(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int pid_pri;
  printf("%d\n", getpriority(PRIO_PROCESS, 0));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <getpriority@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <getpriority@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@PRIO_PROCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @PRIO_PROCESS
%4 = call i32 @getpriority(i32 %3, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@PRIO_PROCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @PRIO_PROCESS
%2 = tail call i32 @getpriority(i32 %1, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int ccnl_lrpc_TLlen(int, int);
int ccnl_lrpc_TLVlen(int typ, int nofbytes) {
  return ccnl_lrpc_TLlen(typ, nofbytes) + nofbytes;
}


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

x86 assembly (clang, -O2):
<ccnl_lrpc_TLVlen>:
push   %rbx
mov    %esi,%ebx
call   1030 <ccnl_lrpc_TLlen@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ccnl_lrpc_TLVlen(i32 %0, i32 %1) {
%3 = tail call i32 @ccnl_lrpc_TLlen(i32 %0, i32 %1)
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int __ucmpdi2(long long, long long);
int _COM_CMPGT64u(long long a, long long b) { return __ucmpdi2(a, b) == 2; }


x86 assembly (clang, -O0):
<_COM_CMPGT64u>:
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 <__ucmpdi2@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_COM_CMPGT64u>:
push   %rax
call   1030 <__ucmpdi2@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_COM_CMPGT64u(i64 %0, i64 %1) {
%3 = tail call i32 @__ucmpdi2(i64 %0, i64 %1)
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}
int ld_blt_mm2(long double *a1, long double *a2) {
  return !(__builtin_isless(*a1, *a2));
}


x86 assembly (clang, -O0):
<ld_blt_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blt_mm2>:
fldt   (%rdi)
fldt   (%rsi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_blt_mm2(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80*, x86_fp80** %4
%8 = load x86_fp80, x86_fp80* %7
%9 = fcmp olt x86_fp80 %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @ld_blt_mm2(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fcmp uge x86_fp80 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void mov_preg32pimm32_reg8(int reg32, unsigned long imm32, int reg8) {
  put8(0x88);
  put8(0x80 | reg32 | (reg8 << 3));
  put32(imm32);
}


x86 assembly (clang, -O0):
<mov_preg32pimm32_reg8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x88,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
or     $0x80,%edi
mov    -0x14(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_preg32pimm32_reg8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x88,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0x80,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_preg32pimm32_reg8(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = call i32 @put8(i32 136)
%8 = load i32, i32* %4
%9 = or i32 128, %8
%10 = load i32, i32* %6
%11 = shl i32 %10, 3
%12 = or i32 %9, %11
%13 = call i32 @put8(i32 %12)
%14 = load i64, i64* %5
%15 = call i32 @put32(i64 %14)
ret void
}

LLVM IR (-O2):
define void @mov_preg32pimm32_reg8(i32 %0, i64 %1, i32 %2) {
%4 = tail call i32 @put8(i32 136)
%5 = shl i32 %2, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 128
%8 = tail call i32 @put8(i32 %7)
%9 = tail call i32 @put32(i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ load_data();
void import_database() { load_data(); }


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

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

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

LLVM IR (-O2):
define void @import_database() {
%1 = tail call i32 (...) @load_data()
ret void
}
/* Variables and functions */
unsigned int hash_str(char const *, int /*<<< orphan*/, int);
unsigned int hash_sdbm(const char *s) { return hash_str(s, 0, 65599); }


x86 assembly (clang, -O0):
<hash_sdbm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1003f,%edx
call   1030 <hash_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_sdbm>:
xor    %esi,%esi
mov    $0x1003f,%edx
jmp    1030 <hash_str@plt>

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

LLVM IR (-O2):
define i32 @hash_sdbm(i8* %0) {
%2 = tail call i32 @hash_str(i8* %0, i32 0, i32 65599)
ret i32 %2
}
/* Variables and functions */
scalar_t__ memchr(char const *, char, size_t);
size_t strlib_strnlen(const char *string, size_t maxlen) {
  const char *end = (const char *)memchr(string, '\0', maxlen);
  return end ? (size_t)(end - string) : maxlen;
}


x86 assembly (clang, -O0):
<strlib_strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <strlib_strnlen+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <strlib_strnlen+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlib_strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @strlib_strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i64 @memchr(i8* %6, i8 signext 0, i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
br label %20
18: ; preds = %2
%19 = load i64, i64* %4
br label %20
20: ; preds = %18, %12
%21 = phi i64 [ %17, %12 ], [ %19, %18 ]
ret i64 %21
}

LLVM IR (-O2):
define i64 @strlib_strnlen(i8* %0, i64 %1) {
%3 = tail call i64 @memchr(i8* %0, i8 signext 0, i64 %1)
%4 = icmp eq i64 %3, 0
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %3, %5
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wait(int /*<<< orphan*/);
int main() {
  int pid;
  pid = fork();
  if (pid == 0) {
    printf(" child waitig status\n");
    exit(0);
  } else {
    sleep(14);
    printf(" waiting for child to exit\n");
    wait(0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    117f <main+0x2f>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0xe,%edi
call   1050 <sleep@plt>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <wait@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
test   %eax,%eax
je     117d <main+0x2d>
mov    $0xe,%edi
call   1050 <sleep@plt>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <wait@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c" child waitig status\0A\00"
@.str.1 = [28 x i8] c" waiting for child to exit\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %0
%9 = call i32 @sleep(i32 14)
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @wait(i32 0)
br label %12
12: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c" waiting for child to exit\00"
@str.2 = [21 x i8] c" child waitig status\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = tail call i32 @sleep(i32 14)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @wait(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void nmea_init_random(void) { srandom(time(NULL)); }


x86 assembly (clang, -O0):
<nmea_init_random>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmea_init_random>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srandom@plt>

LLVM IR (-O0):
define void @nmea_init_random() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srandom(i32 %1)
ret void
}

LLVM IR (-O2):
define void @nmea_init_random() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srandom(i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int state;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xvisibility_state(void *_p, int _v) {
  ((XEvent *)_p)->xvisibility.state = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xvisibility_state>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xvisibility_state(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xvisibility_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void setArrayI(int32_t *arr, int idx, int32_t v) { arr[idx] = v; }


x86 assembly (clang, -O0):
<setArrayI>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setArrayI>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @setArrayI(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ULONG_MAX;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int hlp_ulong_max(void) {
  printf("%lu\n", ULONG_MAX);
  return 0;
}


x86 assembly (clang, -O0):
<hlp_ulong_max>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
@ULONG_MAX = global i32 0
define i32 @hlp_ulong_max() {
%1 = load i32, i32* @ULONG_MAX
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
@ULONG_MAX = global i32 0
define i32 @hlp_ulong_max() {
%1 = load i32, i32* @ULONG_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int module_symbol_is_present(const char *modname, const char *symbname) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @module_symbol_is_present(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void RTPollSetAdd(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPollSetAdd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ coap_hash_impl(unsigned char *, size_t, void *);
void hash_segment(unsigned char *s, size_t len, void *data) {
  coap_hash_impl((s), (len), (data));
}


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

x86 assembly (clang, -O2):
<hash_segment>:
jmp    1030 <coap_hash_impl@plt>

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

LLVM IR (-O2):
define void @hash_segment(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @coap_hash_impl(i8* %0, i64 %1, i8* %2)
ret void
}
/* Variables and functions */
float value_noise_2d(int /*<<< orphan*/);
int /*<<< orphan*/ vec2f(float, float);
float call_vnoise2(float x, float y) { return value_noise_2d(vec2f(x, y)); }


x86 assembly (clang, -O0):
<call_vnoise2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <vec2f@plt>
mov    %eax,%edi
call   1040 <value_noise_2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_vnoise2>:
push   %rax
call   1030 <vec2f@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <value_noise_2d@plt>

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

LLVM IR (-O2):
define float @call_vnoise2(float %0, float %1) {
%3 = tail call i32 @vec2f(float %0, float %1)
%4 = tail call float @value_noise_2d(i32 %3)
ret float %4
}
unsigned int decodeInt32(const unsigned char *z) {
  return (z[0] << 24) + (z[1] << 16) + (z[2] << 8) + z[3];
}


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

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

LLVM IR (-O0):
define i32 @decodeInt32(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 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = add nsw i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @decodeInt32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int M_PI;
unsigned int nco_idx(float phase, int size) {
  while (phase >= 2 * M_PI) {
    phase -= 2 * M_PI;
  }
  unsigned int idx = (unsigned int)(phase * size / (2 * M_PI));
  return idx;
}


x86 assembly (clang, -O0):
<nco_idx>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
ucomiss %xmm1,%xmm0
jb     114d <nco_idx+0x4d>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    110c <nco_idx+0xc>
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nco_idx>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2ss %eax,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <nco_idx+0x29>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
subss  %xmm1,%xmm0
ucomiss %xmm1,%xmm0
jae    1120 <nco_idx+0x20>
cvtsi2ss %edi,%xmm2
mulss  %xmm0,%xmm2
divss  %xmm1,%xmm2
cvttss2si %xmm2,%rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define i32 @nco_idx(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %12, %2
%7 = load float, float* %3
%8 = load i32, i32* @M_PI
%9 = mul nsw i32 2, %8
%10 = sitofp i32 %9 to float
%11 = fcmp oge float %7, %10
br i1 %11, label %12, label %18
12: ; preds = %6
%13 = load i32, i32* @M_PI
%14 = mul nsw i32 2, %13
%15 = sitofp i32 %14 to float
%16 = load float, float* %3
%17 = fsub float %16, %15
store float %17, float* %3
br label %6
18: ; preds = %6
%19 = load float, float* %3
%20 = load i32, i32* %4
%21 = sitofp i32 %20 to float
%22 = fmul float %19, %21
%23 = load i32, i32* @M_PI
%24 = mul nsw i32 2, %23
%25 = sitofp i32 %24 to float
%26 = fdiv float %22, %25
%27 = fptoui float %26 to i32
store i32 %27, i32* %5
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
@M_PI = global i32 0
define i32 @nco_idx(float %0, i32 %1) {
%3 = load i32, i32* @M_PI
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to float
%6 = fcmp ugt float %5, %0
br i1 %6, label %11, label %7
7: ; preds = %2, %7
%8 = phi float [ %9, %7 ], [ %0, %2 ]
%9 = fsub float %8, %5
%10 = fcmp ult float %9, %5
br i1 %10, label %11, label %7
11: ; preds = %7, %2
%12 = phi float [ %0, %2 ], [ %9, %7 ]
%13 = sitofp i32 %1 to float
%14 = fmul float %12, %13
%15 = fdiv float %14, %5
%16 = fptoui float %15 to i32
ret i32 %16
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int asuint(float);
int issignaling_f(float x) {
  uint32_t ix = asuint(x);
  if (!1)
    return (ix & 0x7fc00000) == 0x7fc00000;
  return 2 * (ix ^ 0x00400000) > 2u * 0x7fc00000;
}


x86 assembly (clang, -O0):
<issignaling_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asuint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0x400000,%eax
shl    $0x1,%eax
cmp    $0xff800000,%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issignaling_f>:
push   %rax
call   1030 <asuint@plt>
add    %eax,%eax
xor    $0x800000,%eax
xor    %ecx,%ecx
cmp    $0xff800001,%eax
setae  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @issignaling_f(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = call i32 @asuint(float %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = xor i32 %6, 4194304
%8 = mul nsw i32 2, %7
%9 = icmp ugt i32 %8, -8388608
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @issignaling_f(float %0) {
%2 = tail call i32 @asuint(float %0)
%3 = shl i32 %2, 1
%4 = xor i32 %3, 8388608
%5 = icmp ugt i32 %4, -8388608
%6 = zext i1 %5 to i32
ret i32 %6
}
__attribute__((always_)) void *radix_tree_deref_slot(void **pslot) {
  void *ret = ({
    typeof(*pslot) _________p1 = (*(volatile typeof(*pslot) *)&(*pslot));
    do {
    } while (0);
    (_________p1);
  });
  if (__builtin_expect(!!(radix_tree_is_indirect_ptr(ret)), 0))
    ret = ((void *)-1UL);
  return ret;
}


x86 assembly (clang, -O0):
<radix_tree_deref_slot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    112c <radix_tree_deref_slot+0x1c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <radix_tree_is_indirect_ptr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     116d <radix_tree_deref_slot+0x5d>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_tree_deref_slot>:
push   %rbx
mov    (%rdi),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <radix_tree_is_indirect_ptr@plt>
test   %eax,%eax
jne    1127 <radix_tree_deref_slot+0x17>
mov    %rbx,%rax
pop    %rbx
ret
mov    $0xffffffffffffffff,%rbx
jmp    1122 <radix_tree_deref_slot+0x12>

LLVM IR (-O0):
define i8* @radix_tree_deref_slot(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %2
%6 = load i8**, i8*** %2
%7 = load volatile i8*, i8** %6
store i8* %7, i8** %4
br label %8
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = load i8*, i8** %4
store i8* %10, i8** %5
%11 = load i8*, i8** %5
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @radix_tree_is_indirect_ptr to i32 (i8*, ...)*)(i8* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
%18 = sext i32 %17 to i64
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %9
store i8* inttoptr (i64 -1 to i8*), i8** %3
br label %21
21: ; preds = %20, %9
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @radix_tree_deref_slot(i8** %0) {
%2 = load volatile i8*, i8** %0
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @radix_tree_is_indirect_ptr to i32 (i8*, ...)*)(i8* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = phi i8* [ inttoptr (i64 -1 to i8*), %5 ], [ %2, %1 ]
ret i8* %7
}
int clearBit_fun_int(int x, unsigned i) { return x & ~(1 << i); }


x86 assembly (clang, -O0):
<clearBit_fun_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clearBit_fun_int(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @clearBit_fun_int(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void handler(int param) {
  fprintf(stderr, "Exiting!\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"Exiting!\0A\00"
@EXIT_SUCCESS = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"Exiting!\0A\00"
@EXIT_SUCCESS = global i32 0
define void @handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}