xunge/DecIR huggingface dataset:
const char *TA_GetVersionMinor(void) { return "4"; }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"4\00"
define i8* @TA_GetVersionMinor() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"4\00"
define i8* @TA_GetVersionMinor() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ myReduceLines();
int main(void) {
  myReduceLines();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @myReduceLines()
ret i32 0
}
void g_main_context_find_source_by_user_data() {}


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

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

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

LLVM IR (-O2):
define void @g_main_context_find_source_by_user_data() {
ret void
}
/* Variables and functions */
int floor(double);
float numeroArrotondatoAMigliaia(double x) {
  return floor(x * 1000 + .5) / 1000;
}


x86 assembly (clang, -O0):
<numeroArrotondatoAMigliaia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <floor@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeroArrotondatoAMigliaia>:
push   %rax
mulsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
call   1030 <floor@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @numeroArrotondatoAMigliaia(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 1.000000e+03, double 5.000000e-01)
%5 = call i32 @floor(double %4)
%6 = sdiv i32 %5, 1000
%7 = sitofp i32 %6 to float
ret float %7
}

LLVM IR (-O2):
define float @numeroArrotondatoAMigliaia(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.000000e+03, double 5.000000e-01)
%3 = tail call i32 @floor(double %2)
%4 = sdiv i32 %3, 1000
%5 = sitofp i32 %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void Debug_log_MINUS_memory_MINUS_balance_BANG_(_Bool value) {
  printf("Error - calling 'log-memory-balance!' without compiling with "
         "LOG_MEMORY enabled.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Debug_log_MINUS_memory_MINUS_balance_BANG_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [82 x i8] c"Error - calling 'log-memory-balance!' without compiling with LOG_MEMORY enabled.\0A\00"
define void @Debug_log_MINUS_memory_MINUS_balance_BANG_(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [81 x i8] c"Error - calling 'log-memory-balance!' without compiling with LOG_MEMORY enabled.\00"
define void @Debug_log_MINUS_memory_MINUS_balance_BANG_(i1 zeroext %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void break_here(void) { asm volatile(""); }


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

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

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

LLVM IR (-O2):
define void @break_here() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_tx_byte(unsigned char);
void print_debug(const char *str) {
  unsigned char ch;
  while ((ch = *str++) != '\0') {
    uart_tx_byte(ch);
  }
}


x86 assembly (clang, -O0):
<print_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
je     114a <print_debug+0x3a>
movzbl -0x9(%rbp),%edi
call   1030 <uart_tx_byte@plt>
jmp    111c <print_debug+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print_debug+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <uart_tx_byte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_debug+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @print_debug(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = zext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i8, i8* %3
%12 = call i32 @uart_tx_byte(i8 zeroext %11)
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @print_debug(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @uart_tx_byte(i8 zeroext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int bar();
int foo() { return bar(); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @bar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
int test_05(const char *x, const char *y) {
  return __builtin_strcmp("1234567", y);
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"1234567\00"
define i32 @test_05(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 = call i32 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"1234567\00"
define i32 @test_05(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %1)
ret i32 %3
}
void I2CMasterIntClearEx(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = ulIntFlags;
}


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

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

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

LLVM IR (-O2):
define void @I2CMasterIntClearEx(i64 %0, i64 %1) {
%3 = add i64 %0, 28
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lrtest_file_exec(char *);
int /*<<< orphan*/ lrtest_init();
int /*<<< orphan*/ lrtest_release();
int main(int argc, char **argv) {
  char *path;
  if (argc < 2) {
    path = "tests.conf";
  } else {
    path = argv[1];
  }
  lrtest_init();
  lrtest_file_exec(path);
  lrtest_release();
  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)
cmpl   $0x2,-0x8(%rbp)
jge    1160 <main+0x30>
lea    0xea9(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    116c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <lrtest_init@plt>
mov    -0x18(%rbp),%rdi
call   1030 <lrtest_file_exec@plt>
mov    $0x0,%al
call   1050 <lrtest_release@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jge    113f <main+0xf>
lea    0xec3(%rip),%rbx
jmp    1143 <main+0x13>
mov    0x8(%rsi),%rbx
xor    %eax,%eax
call   1040 <lrtest_init@plt>
mov    %rbx,%rdi
call   1030 <lrtest_file_exec@plt>
xor    %eax,%eax
call   1050 <lrtest_release@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"tests.conf\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 (...) @lrtest_init()
%10 = tail call i32 @lrtest_file_exec(i8* %8)
%11 = tail call i32 (...) @lrtest_release()
ret i32 0
}
/* Variables and functions */
int fn_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34(
    char const *);
int fn_al_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34>:
jmp    1030 <fn_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34(i8* %0) {
%2 = tail call i32 @fn_sq_ch_34_qtg_1_4294967295_al_sq_ch_92_ch_92_sq_ch_92_ch_34_sq_cl_1_33_35_4294967295_ch_34(i8* %0)
ret i32 %2
}
/* Variables and functions */
int helper(int *, int /*<<< orphan*/, int, int);
int findKthlagest(int a[], int size, int k) {
  return helper(a, 0, size - 1, k);
}


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

x86 assembly (clang, -O2):
<findKthlagest>:
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <helper@plt>

LLVM IR (-O0):
define i32 @findKthlagest(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** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @helper(i32* %7, i32 0, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @findKthlagest(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @helper(i32* %0, i32 0, i32 %4, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void __wbeu32(uint8_t *buffer, uint32_t value) {
  buffer[0] = (uint8_t)(value >> 24) & 0xFF;
  buffer[1] = (uint8_t)(value >> 16) & 0xFF;
  buffer[2] = (uint8_t)(value >> 8) & 0xFF;
  buffer[3] = (uint8_t)(value >> 0) & 0xFF;
}


x86 assembly (clang, -O0):
<__wbeu32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wbeu32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @__wbeu32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = ashr i32 %20, 0
%22 = and i32 %21, 255
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 3
store i32 %22, i32* %24
ret void
}

LLVM IR (-O2):
define void @__wbeu32(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
store i32 %3, i32* %0
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = and i32 %1, 255
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nearbyint(double);
int /*<<< orphan*/ nearbyintf(float);
int /*<<< orphan*/ nearbyintl(long double);
void uninitvar_nearbyint(void) {
  float f;
  (void)nearbyintf(f);
  double d;
  (void)nearbyint(d);
  long double ld;
  (void)nearbyintl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_nearbyint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1030 <nearbyintf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <nearbyint@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <nearbyintl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_nearbyint>:
sub    $0x18,%rsp
call   1030 <nearbyintf@plt>
call   1050 <nearbyint@plt>
call   1040 <nearbyintl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_nearbyint() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @nearbyintf(float %4)
%6 = load double, double* %2
%7 = call i32 @nearbyint(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @nearbyintl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_nearbyint() {
%1 = tail call i32 @nearbyintf(float undef)
%2 = tail call i32 @nearbyint(double undef)
%3 = tail call i32 @nearbyintl(x86_fp80 undef)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct list_head *);
int /*<<< orphan*/ list_init(struct list_head *);
__attribute__((always_)) void list_del_init(struct list_head *entry) {
  __list_del_entry(entry);
  list_init(entry);
}


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

x86 assembly (clang, -O2):
<list_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <list_init@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @__list_del_entry(%struct.list_head* %3)
%5 = load %struct.list_head*, %struct.list_head** %2
%6 = call i32 @list_init(%struct.list_head* %5)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = tail call i32 @__list_del_entry(%struct.list_head* %0)
%3 = tail call i32 @list_init(%struct.list_head* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
scalar_t__ registers_read_byte(int);
int /*<<< orphan*/ registers_read_word(int, int);
int /*<<< orphan*/ registers_write_byte(int, scalar_t__);
int /*<<< orphan*/ registers_write_word(int, int, int /*<<< orphan*/);
void timer_increment(void) {
  uint16_t value;
  value = registers_read_word(0x06, 0x07);
  ++value;
  registers_write_word(0x06, 0x07, value);
  registers_write_byte(0x2F, registers_read_byte(0x2F) + 1);
}


x86 assembly (clang, -O0):
<timer_increment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
mov    $0x7,%esi
call   1030 <registers_read_word@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x6,%edi
mov    $0x7,%esi
call   1060 <registers_write_word@plt>
mov    $0x2f,%edi
call   1050 <registers_read_byte@plt>
mov    %rax,%rsi
add    $0x1,%rsi
mov    $0x2f,%edi
call   1040 <registers_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_increment>:
push   %rax
mov    $0x6,%edi
mov    $0x7,%esi
call   1030 <registers_read_word@plt>
lea    0x1(%rax),%edx
mov    $0x6,%edi
mov    $0x7,%esi
call   1060 <registers_write_word@plt>
mov    $0x2f,%edi
call   1050 <registers_read_byte@plt>
lea    0x1(%rax),%rsi
mov    $0x2f,%edi
pop    %rax
jmp    1040 <registers_write_byte@plt>

LLVM IR (-O0):
define void @timer_increment() {
%1 = alloca i32
%2 = call i32 @registers_read_word(i32 6, i32 7)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @registers_write_word(i32 6, i32 7, i32 %5)
%7 = call i64 @registers_read_byte(i32 47)
%8 = add nsw i64 %7, 1
%9 = call i32 @registers_write_byte(i32 47, i64 %8)
ret void
}

LLVM IR (-O2):
define void @timer_increment() {
%1 = tail call i32 @registers_read_word(i32 6, i32 7)
%2 = add nsw i32 %1, 1
%3 = tail call i32 @registers_write_word(i32 6, i32 7, i32 %2)
%4 = tail call i64 @registers_read_byte(i32 47)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @registers_write_byte(i32 47, i64 %5)
ret void
}
/* Variables and functions */
void *scale2x_align_ptr(const void *ptr) {
  intptr_t iptr = (intptr_t)ptr;
  iptr += 16 - 1;
  iptr &= -(intptr_t)16;
  return (void *)iptr;
}


x86 assembly (clang, -O0):
<scale2x_align_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xf,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale2x_align_ptr>:
lea    0xf(%rdi),%rax
and    $0xfffffffffffffff0,%rax
ret

LLVM IR (-O0):
define i8* @scale2x_align_ptr(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 15
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = and i64 %8, -16
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @scale2x_align_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = add nsw i64 %2, 15
%4 = and i64 %3, -16
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int minitest_fail(char const *, char const *, int);
int minitest_pass(char const *);
int assert_true(int actual, const char *msg, const char *caller, int line) {
  if (actual) {
    return minitest_pass(msg);
  } else {
    return minitest_fail(msg, caller, line);
  }
}


x86 assembly (clang, -O0):
<assert_true>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1151 <assert_true+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <minitest_pass@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <assert_true+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <minitest_fail@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_true>:
test   %edi,%edi
je     112c <assert_true+0xc>
mov    %rsi,%rdi
jmp    1030 <minitest_pass@plt>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1040 <minitest_fail@plt>

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

LLVM IR (-O2):
define i32 @assert_true(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @minitest_pass(i8* %1)
br label %10
8: ; preds = %4
%9 = tail call i32 @minitest_fail(i8* %1, i8* %2, i32 %3)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
int nsvg__ptEquals(float x1, float y1, float x2, float y2, float tol) {
  float dx = x2 - x1;
  float dy = y2 - y1;
  return dx * dx + dy * dy < tol * tol;
}


x86 assembly (clang, -O0):
<nsvg__ptEquals>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__ptEquals>:
subss  %xmm0,%xmm2
subss  %xmm1,%xmm3
mulss  %xmm3,%xmm3
mulss  %xmm2,%xmm2
addss  %xmm3,%xmm2
mulss  %xmm4,%xmm4
xor    %eax,%eax
ucomiss %xmm2,%xmm4
seta   %al
ret

LLVM IR (-O0):
define i32 @nsvg__ptEquals(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%13 = load float, float* %8
%14 = load float, float* %6
%15 = fsub float %13, %14
store float %15, float* %11
%16 = load float, float* %9
%17 = load float, float* %7
%18 = fsub float %16, %17
store float %18, float* %12
%19 = load float, float* %11
%20 = load float, float* %11
%21 = load float, float* %12
%22 = load float, float* %12
%23 = fmul float %21, %22
%24 = call float @llvm.fmuladd.f32(float %19, float %20, float %23)
%25 = load float, float* %10
%26 = load float, float* %10
%27 = fmul float %25, %26
%28 = fcmp olt float %24, %27
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @nsvg__ptEquals(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %2, %0
%7 = fsub float %3, %1
%8 = fmul float %7, %7
%9 = tail call float @llvm.fmuladd.f32(float %6, float %6, float %8)
%10 = fmul float %4, %4
%11 = fcmp olt float %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
void USB_LP_CAN_RX0_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @USB_LP_CAN_RX0_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset_common(int);
void resetx86(void) { reset_common(1); }


x86 assembly (clang, -O0):
<resetx86>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <reset_common@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetx86>:
mov    $0x1,%edi
jmp    1030 <reset_common@plt>

LLVM IR (-O0):
define void @resetx86() {
%1 = call i32 @reset_common(i32 1)
ret void
}

LLVM IR (-O2):
define void @resetx86() {
%1 = tail call i32 @reset_common(i32 1)
ret void
}
void my_module_(void) {}


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

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

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

LLVM IR (-O2):
define void @my_module_() {
ret void
}
void gdk_pixmap_foreign_new() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pixmap_foreign_new() {
ret void
}
int express(int left, int right, char op) {
  int ret = 0;
  switch (op) {
  case '+':
    ret = left + right;
    break;
  case '-':
    ret = left - right;
    break;
  case '*':
    ret = left * right;
    break;
  case '/':
    ret = left / right;
    break;
  default:
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<express>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     117a <express+0x7a>
mov    -0x18(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    117f <express+0x7f>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    117f <express+0x7f>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    117f <express+0x7f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
jmp    117f <express+0x7f>
jmp    117f <express+0x7f>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<express>:
xor    %eax,%eax
add    $0xffffffd6,%edx
cmp    $0x5,%edx
ja     112f <express+0x2f>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
imul   %edi,%esi
mov    %esi,%eax
ret
add    %edi,%esi
mov    %esi,%eax
ret
sub    %esi,%edi
mov    %edi,%eax
ret
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @express(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
store i32 0, i32* %7
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
switch i32 %9, label %26 [
i32 43, label %10
i32 45, label %14
i32 42, label %18
i32 47, label %22
]
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
store i32 %13, i32* %7
br label %27
14: ; preds = %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
store i32 %17, i32* %7
br label %27
18: ; preds = %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul nsw i32 %19, %20
store i32 %21, i32* %7
br label %27
22: ; preds = %3
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = sdiv i32 %23, %24
store i32 %25, i32* %7
br label %27
26: ; preds = %3
br label %27
27: ; preds = %26, %22, %18, %14, %10
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @express(i32 %0, i32 %1, i8 signext %2) {
%4 = sext i8 %2 to i32
switch i32 %4, label %13 [
i32 43, label %5
i32 45, label %7
i32 42, label %9
i32 47, label %11
]
5: ; preds = %3
%6 = add nsw i32 %1, %0
br label %13
7: ; preds = %3
%8 = sub nsw i32 %0, %1
br label %13
9: ; preds = %3
%10 = mul nsw i32 %1, %0
br label %13
11: ; preds = %3
%12 = sdiv i32 %0, %1
br label %13
13: ; preds = %3, %11, %9, %7, %5
%14 = phi i32 [ 0, %3 ], [ %12, %11 ], [ %10, %9 ], [ %8, %7 ], [ %6, %5 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int EINTR;
int __sys_sigwait(int /*<<< orphan*/ const *, int *);
int __sigwait(const sigset_t *restrict set, int *restrict sig) {
  int ret;
  do {
    ret = __sys_sigwait(set, sig);
  } while (ret == EINTR);
  return (ret);
}


x86 assembly (clang, -O0):
<__sigwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__sys_sigwait@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
je     1120 <__sigwait+0x10>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sigwait>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ebe(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <__sys_sigwait@plt>
cmp    (%r15),%eax
je     1130 <__sigwait+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EINTR = global i32 0
define i32 @__sigwait(i32* noalias %0, i32* noalias %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @__sys_sigwait(i32* %0, i32* %1)
%5 = load i32, i32* @EINTR
%6 = icmp eq i32 %4, %5
br i1 %6, label %3, label %7
7: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int main(int argc, char *argv[]) {
  initscr();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initscr()
ret i32 0
}
int test_imm_8Cint64_highword_reg(long long val) {
  return ((val >> 32) & (0x8C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Cint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x8c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Cint64_highword_reg>:
movabs $0x8c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Cint64_highword_reg(i64 %0) {
%2 = and i64 %0, 601295421440
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int max(int a, int b) { return (b > a) ? b : a; }


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
float obdConvert_06_09(unsigned int A, unsigned int B, unsigned int C,
                       unsigned int D) {
  return ((float)A - 128.0f) * 100.0f / 128.0f;
}


x86 assembly (clang, -O0):
<obdConvert_06_09>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xee0(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xed8(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xec8(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_06_09>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
addss  0xef1(%rip),%xmm0
mulss  0xeed(%rip),%xmm0
mulss  0xee9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_06_09(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = fsub float %10, 1.280000e+02
%12 = fmul float %11, 1.000000e+02
%13 = fdiv float %12, 1.280000e+02
ret float %13
}

LLVM IR (-O2):
define float @obdConvert_06_09(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = fadd float %5, -1.280000e+02
%7 = fmul float %6, 1.000000e+02
%8 = fmul float %7, 7.812500e-03
ret float %8
}
__attribute__((weak)) void _init(void) {}


x86 assembly (clang, -O0):
<_init>:
endbr64
sub    $0x8,%rsp
mov    0x2fd9(%rip),%rax
test   %rax,%rax
je     1016 <_init+0x16>
call   *%rax
add    $0x8,%rsp
ret

x86 assembly (clang, -O2):
<_init>:
endbr64
sub    $0x8,%rsp
mov    0x2fd9(%rip),%rax
test   %rax,%rax
je     1016 <_init+0x16>
call   *%rax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define weak void @_init() {
ret void
}
int main(void) {
  int a;
  int *b = &a;
  int **c = &b;
  int *v[20];
  int *(*func)(int, int);
  void *(*func2[10])();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32**
%5 = alloca [20 x i32*]
%6 = alloca i32* (i32, i32)*
%7 = alloca [10 x i8* (...)*]
store i32 0, i32* %1
store i32* %2, i32** %3
store i32** %3, i32*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec timer_start() {
  struct timespec start_time;
  clock_gettime(CLOCK_MONOTONIC, &start_time);
  return start_time;
}


x86 assembly (clang, -O0):
<timer_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_start>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @timer_start() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @timer_start() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
int check_end() {
  int i = 0x12345678;
  char *c = (char *)&i;
  return (*c == 0x12);
}


x86 assembly (clang, -O0):
<check_end>:
push   %rbp
mov    %rsp,%rbp
movl   $0x12345678,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x12,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @check_end() {
%1 = alloca i32
%2 = alloca i8*
store i32 305419896, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 18
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @check_end() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *get_mount_by_mount_point(char const *);
int fuse_is_mount_point(const char path[]) {
  return get_mount_by_mount_point(path) != NULL;
}


x86 assembly (clang, -O0):
<fuse_is_mount_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_mount_by_mount_point@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuse_is_mount_point>:
push   %rax
call   1030 <get_mount_by_mount_point@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fuse_is_mount_point(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @get_mount_by_mount_point(i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fuse_is_mount_point(i8* %0) {
%2 = tail call i32* @get_mount_by_mount_point(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo(void) {
  asm volatile goto("" : : : : a, b);
a:
  bar();
b:
  return;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <foo+0x9>
jmp    111e <foo+0xe>
mov    $0x0,%al
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
jmp    1030 <bar@plt>
ret

LLVM IR (-O0):
define void @foo() {
to label %1 [label %2, label %4]
1: ; preds = %0
br label %2
2: ; preds = %1, %0
%3 = call i32 (...) @bar()
br label %4
4: ; preds = %2, %0
ret void
}

LLVM IR (-O2):
define void @foo() {
to label %1 [label %2, label %4]
1: ; preds = %0
br label %2
2: ; preds = %1, %0
%3 = tail call i32 (...) @bar()
br label %4
4: ; preds = %2, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Absolute(int);
int /*<<< orphan*/ STY8(int /*<<< orphan*/);
void Op8CX1(void) { STY8(Absolute(2)); }


x86 assembly (clang, -O0):
<Op8CX1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
call   1030 <STY8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op8CX1>:
push   %rax
mov    $0x2,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <STY8@plt>

LLVM IR (-O0):
define void @Op8CX1() {
%1 = call i32 @Absolute(i32 2)
%2 = call i32 @STY8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op8CX1() {
%1 = tail call i32 @Absolute(i32 2)
%2 = tail call i32 @STY8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _vWriteFormat(char, int);
void _vWrite(char c) { _vWriteFormat(c, 0x00 | 0x0F); }


x86 assembly (clang, -O0):
<_vWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xf,%esi
movsbl -0x1(%rbp),%edi
call   1030 <_vWriteFormat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vWrite>:
mov    $0xf,%esi
jmp    1030 <_vWriteFormat@plt>

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

LLVM IR (-O2):
define void @_vWrite(i8 signext %0) {
%2 = tail call i32 @_vWriteFormat(i8 signext %0, i32 15)
ret void
}
int is_le() {
  static int _is_init = 0;
  static int _is_le;
  if (!_is_init) {
    short s = 0x1234;
    _is_le = ((*(char *)&s) == 0x34);
    _is_init = 1;
  }
  return _is_le;
}


x86 assembly (clang, -O0):
<is_le>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
jne    1136 <is_le+0x36>
movw   $0x1234,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x34,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,0x2efc(%rip)
movl   $0x1,0x2eee(%rip)
mov    0x2eec(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_le>:
cmpb   $0x1,0x2f1d(%rip)
jne    1111 <is_le+0x11>
movzbl 0x2f18(%rip),%eax
ret
movb   $0x1,0x2f10(%rip)
movb   $0x1,0x2f05(%rip)
mov    $0x1,%eax
ret

LLVM IR (-O0):
@is_le._is_init = internal global i32 0
@is_le._is_le = internal global i32 0
define i32 @is_le() {
%1 = alloca i16
%2 = load i32, i32* @is_le._is_init
%3 = icmp ne i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0
store i16 4660, i16* %1
%5 = bitcast i16* %1 to i8*
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 52
%9 = zext i1 %8 to i32
store i32 %9, i32* @is_le._is_le
store i32 1, i32* @is_le._is_init
br label %10
10: ; preds = %4, %0
%11 = load i32, i32* @is_le._is_le
ret i32 %11
}

LLVM IR (-O2):
@is_le._is_init = internal unnamed_addr global i1 false
@is_le._is_le = internal unnamed_addr global i1 false
define i32 @is_le() {
%1 = load i1, i1* @is_le._is_init
br i1 %1, label %2, label %5
2: ; preds = %0
%3 = load i1, i1* @is_le._is_le
%4 = zext i1 %3 to i32
br label %6
5: ; preds = %0
store i1 true, i1* @is_le._is_le
store i1 true, i1* @is_le._is_init
br label %6
6: ; preds = %2, %5
%7 = phi i32 [ %4, %2 ], [ 1, %5 ]
ret i32 %7
}
double c2f(int nsam, double a1, double a2, double b2) {
  double c2;
  c2 = b2 - ((nsam + 2) / (a1 * nsam)) + (a2 / (a1 * a1));
  return (c2);
}


x86 assembly (clang, -O0):
<c2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x10(%rbp),%xmm2
cvtsi2sdl -0x4(%rbp),%xmm3
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2f>:
lea    0x2(%rdi),%eax
cvtsi2sd %eax,%xmm3
cvtsi2sd %edi,%xmm4
movapd %xmm0,%xmm5
unpcklpd %xmm0,%xmm5
unpcklpd %xmm4,%xmm0
mulpd  %xmm5,%xmm0
unpcklpd %xmm3,%xmm1
divpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
subsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @c2f(i32 %0, double %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %8
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 2
%13 = sitofp i32 %12 to double
%14 = load double, double* %6
%15 = load i32, i32* %5
%16 = sitofp i32 %15 to double
%17 = fmul double %14, %16
%18 = fdiv double %13, %17
%19 = fsub double %10, %18
%20 = load double, double* %7
%21 = load double, double* %6
%22 = load double, double* %6
%23 = fmul double %21, %22
%24 = fdiv double %20, %23
%25 = fadd double %19, %24
store double %25, double* %9
%26 = load double, double* %9
ret double %26
}

LLVM IR (-O2):
define double @c2f(i32 %0, double %1, double %2, double %3) {
%5 = add nsw i32 %0, 2
%6 = sitofp i32 %5 to double
%7 = sitofp i32 %0 to double
%8 = insertelement <2 x double> poison, double %1, i64 0
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> zeroinitializer
%10 = insertelement <2 x double> %8, double %7, i64 1
%11 = fmul <2 x double> %9, %10
%12 = insertelement <2 x double> poison, double %2, i64 0
%13 = insertelement <2 x double> %12, double %6, i64 1
%14 = fdiv <2 x double> %13, %11
%15 = extractelement <2 x double> %14, i64 1
%16 = fsub double %3, %15
%17 = extractelement <2 x double> %14, i64 0
%18 = fadd double %17, %16
ret double %18
}