xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("size of a short is %d\n", sizeof(short));
  printf("size of a int is %d\n", sizeof(int));
  printf("size of a long is %d\n", sizeof(long));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"size of a short is %d\0A\00"
@.str.1 = [21 x i8] c"size of a int is %d\0A\00"
@.str.2 = [22 x i8] c"size of a long is %d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"size of a short is %d\0A\00"
@.str.1 = [21 x i8] c"size of a int is %d\0A\00"
@.str.2 = [22 x i8] c"size of a long is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
int count_word_int_str_way_2_recursion(char *str, char *word) { return 0; }


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

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

LLVM IR (-O0):
define i32 @count_word_int_str_way_2_recursion(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 @count_word_int_str_way_2_recursion(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vs3();
int /*<<< orphan*/ take_struct_vs3(int /*<<< orphan*/);
void test_struct_vs3() { take_struct_vs3(return_struct_vs3()); }


x86 assembly (clang, -O0):
<test_struct_vs3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_struct_vs3@plt>
mov    %eax,%edi
call   1040 <take_struct_vs3@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_struct_vs3() {
%1 = call i32 (...) @return_struct_vs3()
%2 = call i32 @take_struct_vs3(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vs3() {
%1 = tail call i32 (...) @return_struct_vs3()
%2 = tail call i32 @take_struct_vs3(i32 %1)
ret void
}
/* Variables and functions */
int gcd(int, int);
int lcm(int a, int b) { return (a * b) % gcd(a, b); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = srem i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @gcd(i32 %0, i32 %1)
%5 = srem i32 %3, %4
ret i32 %5
}
int format(int n, int b) {
  n %= b;
  return (b == 16) ? (n > 9) ? (n - 10 + 'A') : (n + '0') : n + '0';
}


x86 assembly (clang, -O0):
<format>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0x10,-0x8(%rbp)
jne    114f <format+0x4f>
cmpl   $0x9,-0x4(%rbp)
jle    113b <format+0x3b>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <format+0x44>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <format+0x58>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<format>:
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0xa,%edx
mov    $0x37,%eax
mov    $0x30,%ecx
cmovl  %ecx,%eax
cmp    $0x10,%esi
cmovne %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @format(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 = srem i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 16
br i1 %9, label %10, label %22
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 9
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 10
%16 = add nsw i32 %15, 65
br label %20
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 48
br label %20
20: ; preds = %17, %13
%21 = phi i32 [ %16, %13 ], [ %19, %17 ]
br label %25
22: ; preds = %2
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 48
br label %25
25: ; preds = %22, %20
%26 = phi i32 [ %21, %20 ], [ %24, %22 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @format(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %1, 16
%5 = icmp sgt i32 %3, 9
%6 = and i1 %4, %5
%7 = select i1 %6, i32 55, i32 48
%8 = add nsw i32 %3, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
int /*<<< orphan*/ white(char *);
void cmWhite(char *str) { printColor(white(str)); }


x86 assembly (clang, -O0):
<cmWhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <white@plt>
mov    %eax,%edi
call   1040 <printColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cmWhite(i8* %0) {
%2 = tail call i32 @white(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
/* Type definitions */
struct peer {
  int dummy;
};

/* Variables and functions */
scalar_t__ PEER_PORT(struct peer *);
int peer_is_exist(struct peer *p) { return 0 != PEER_PORT(p); }


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

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

LLVM IR (-O0):
%struct.peer = type { i32 }
define i32 @peer_is_exist(%struct.peer* %0) {
%2 = alloca %struct.peer*
store %struct.peer* %0, %struct.peer** %2
%3 = load %struct.peer*, %struct.peer** %2
%4 = call i64 @PEER_PORT(%struct.peer* %3)
%5 = icmp ne i64 0, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.peer = type { i32 }
define i32 @peer_is_exist(%struct.peer* %0) {
%2 = tail call i64 @PEER_PORT(%struct.peer* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p521_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_p521_sub(uint64_t out1[9], const uint64_t arg1[9],
                   const uint64_t arg2[9]) {
  internal_fiat_p521_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p521_sub>:
jmp    1030 <internal_fiat_p521_sub@plt>

LLVM IR (-O0):
define void @fiat_p521_sub(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p521_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p521_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p521_sub(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__16__IO__makeInput();
void SharedAnalogDeviceP__1__EnablePin__makeInput(void) {
  HplAtm128GeneralIOPinP__16__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @SharedAnalogDeviceP__1__EnablePin__makeInput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__16__IO__makeInput()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t rgb888to565(uint8_t r, uint8_t g, uint8_t b) {
  uint16_t rgb565 = 0;
  rgb565 = ((r >> 3) << 11);
  rgb565 |= ((g >> 2) << 6);
  rgb565 |= (b >> 3);
  return rgb565;
}


x86 assembly (clang, -O0):
<rgb888to565>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
shl    $0xb,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
shl    $0x6,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb888to565>:
mov    %edx,%eax
and    $0xfffffff8,%edi
shl    $0x8,%edi
shl    $0x4,%esi
and    $0xffffffc0,%esi
or     %edi,%esi
sar    $0x3,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @rgb888to565(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = ashr i32 %8, 3
%10 = shl i32 %9, 11
store i32 %10, i32* %7
%11 = load i32, i32* %5
%12 = ashr i32 %11, 2
%13 = shl i32 %12, 6
%14 = load i32, i32* %7
%15 = or i32 %14, %13
store i32 %15, i32* %7
%16 = load i32, i32* %6
%17 = ashr i32 %16, 3
%18 = load i32, i32* %7
%19 = or i32 %18, %17
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @rgb888to565(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = and i32 %4, -2048
%6 = shl i32 %1, 4
%7 = and i32 %6, -64
%8 = or i32 %7, %5
%9 = ashr i32 %2, 3
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ llib_file_backup(char const *);
__attribute__((unused)) int backup(const char *path) {
  return llib_file_backup(path) ? 0 : -1;
}


x86 assembly (clang, -O0):
<backup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <llib_file_backup@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backup>:
push   %rax
call   1030 <llib_file_backup@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @backup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @llib_file_backup(i8* %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 -1
ret i32 %7
}

LLVM IR (-O2):
define i32 @backup(i8* %0) {
%2 = tail call i64 @llib_file_backup(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ game_stop();
void server_stop() {
  game_stop();
  return;
}


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

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

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

LLVM IR (-O2):
define void @server_stop() {
%1 = tail call i32 (...) @game_stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int /*<<< orphan*/ xxx();
int main() {
  foo();
  xxx();
  bar();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @xxx()
%3 = tail call i32 (...) @bar()
ret i32 0
}
int letnum(c)
register c;
{ return (letter(c) || digit(c)); }


x86 assembly (clang, -O0):
<letnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <letter@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1158 <letnum+0x38>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <digit@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<letnum>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <letter@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1137 <letnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <digit@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @letnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @letter to i32 (i32, ...)*)(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 (i32, ...) bitcast (i32 (...)* @digit to i32 (i32, ...)*)(i32 %7)
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @letnum(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @letter to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @digit to i32 (i32, ...)*)(i32 %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
double dd_two_diff(double a, double b, double *err) {
  double s = a - b;
  double bb = s - a;
  *err = (a - (s - bb)) - (b + bb);
  return s;
}


x86 assembly (clang, -O0):
<dd_two_diff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x28(%rbp),%xmm1
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_two_diff>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm2,%xmm3
movapd %xmm2,%xmm4
subsd  %xmm0,%xmm4
subsd  %xmm4,%xmm3
subsd  %xmm3,%xmm0
addsd  %xmm1,%xmm4
subsd  %xmm4,%xmm0
movsd  %xmm0,(%rdi)
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dd_two_diff(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fsub double %9, %10
store double %11, double* %7
%12 = load double, double* %7
%13 = load double, double* %4
%14 = fsub double %12, %13
store double %14, double* %8
%15 = load double, double* %4
%16 = load double, double* %7
%17 = load double, double* %8
%18 = fsub double %16, %17
%19 = fsub double %15, %18
%20 = load double, double* %5
%21 = load double, double* %8
%22 = fadd double %20, %21
%23 = fsub double %19, %22
%24 = load double*, double** %6
store double %23, double* %24
%25 = load double, double* %7
ret double %25
}

LLVM IR (-O2):
define double @dd_two_diff(double %0, double %1, double* nocapture writeonly %2) {
%4 = fsub double %0, %1
%5 = fsub double %4, %0
%6 = fsub double %4, %5
%7 = fsub double %0, %6
%8 = fadd double %5, %1
%9 = fsub double %7, %8
store double %9, double* %2
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int eat(void) { printf("EAT "); }


x86 assembly (clang, -O0):
<eat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"EAT \00"
define i32 @eat() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int parseCodenum(void *);
int parseUe(void *pvBuf) { return parseCodenum(pvBuf); }


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

x86 assembly (clang, -O2):
<parseUe>:
jmp    1030 <parseCodenum@plt>

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

LLVM IR (-O2):
define i32 @parseUe(i8* %0) {
%2 = tail call i32 @parseCodenum(i8* %0)
ret i32 %2
}
int grade_cpu_simon_domain(int domain, int mv, int temperature) { return 0; }


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

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

LLVM IR (-O0):
define i32 @grade_cpu_simon_domain(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
ret i32 0
}

LLVM IR (-O2):
define i32 @grade_cpu_simon_domain(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
int fillTable(int inode, int *pos, int *table) {
  int i;
  for (i = 0; i < (*pos); i++) {
    if (inode == table[(i)])
      ;
    return -1;
  }
  table[(*pos)] = inode;
  *pos++;
  return 0;
}


x86 assembly (clang, -O0):
<fillTable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    114a <fillTable+0x4a>
mov    -0x8(%rbp),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    113e <fillTable+0x3e>
jmp    113e <fillTable+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <fillTable+0x6e>
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillTable>:
movslq (%rsi),%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jle    110e <fillTable+0xe>
ret
mov    %edi,(%rdx,%rcx,4)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fillTable(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%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 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %27
14: ; preds = %9
%15 = load i32, i32* %5
%16 = load i32*, i32** %7
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = icmp eq i32 %15, %20
br i1 %21, label %22, label %23
22: ; preds = %14
br label %23
23: ; preds = %22, %14
store i32 -1, i32* %4
br label %37
24: ; No predecessors!
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
%28 = load i32, i32* %5
%29 = load i32*, i32** %7
%30 = load i32*, i32** %6
%31 = load i32, i32* %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %29, i64 %32
store i32 %28, i32* %33
%34 = load i32*, i32** %6
%35 = getelementptr inbounds i32, i32* %34, i32 1
store i32* %35, i32** %6
%36 = load i32, i32* %34
store i32 0, i32* %4
br label %37
37: ; preds = %27, %23
%38 = load i32, i32* %4
ret i32 %38
}

LLVM IR (-O2):
define i32 @fillTable(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i32, i32* %2, i64 %7
store i32 %0, i32* %8
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %10
}
void watchdog_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @watchdog_stop() {
ret void
}
int f_ble_mr2(float *a1, float a2) { return !(__builtin_islessequal(*a1, a2)); }


x86 assembly (clang, -O0):
<f_ble_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ble_mr2>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @f_ble_mr2(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* %5
%7 = load float, float* %4
%8 = fcmp ole float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_ble_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp ugt float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
void WDC_TLLDeinit(void) {}


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

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

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

LLVM IR (-O2):
define void @WDC_TLLDeinit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ reconstruct_last_missing_uv_sse2_ssse3(int /*<<< orphan*/ *,
                                                          int /*<<< orphan*/ *);
extern void reconstruct_last_missing_uv_sse2_ssse3_sse41(__m128i *current_uv,
                                                         __m128i *out) {
  reconstruct_last_missing_uv_sse2_ssse3(current_uv, out);
}


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

x86 assembly (clang, -O2):
<reconstruct_last_missing_uv_sse2_ssse3_sse41>:
jmp    1030 <reconstruct_last_missing_uv_sse2_ssse3@plt>

LLVM IR (-O0):
define void @reconstruct_last_missing_uv_sse2_ssse3_sse41(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 @reconstruct_last_missing_uv_sse2_ssse3(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @reconstruct_last_missing_uv_sse2_ssse3_sse41(i32* %0, i32* %1) {
%3 = tail call i32 @reconstruct_last_missing_uv_sse2_ssse3(i32* %0, i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ dummy;

/* Variables and functions */
int /*<<< orphan*/ recv(int, int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ send(int, int *, int, int /*<<< orphan*/);
void barrier(int oob_sock) {
  int dummy = 0;
  send(oob_sock, &dummy, sizeof(dummy), 0);
  recv(oob_sock, &dummy, sizeof(dummy), 0);
}


x86 assembly (clang, -O0):
<barrier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<barrier>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @barrier(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @send(i32 %4, i32* %3, i32 4, i32 0)
%6 = load i32, i32* %2
%7 = call i32 @recv(i32 %6, i32* %3, i32 4, i32 0)
ret void
}

LLVM IR (-O2):
define void @barrier(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @send(i32 %0, i32* %2, i32 4, i32 0)
%5 = call i32 @recv(i32 %0, i32* %2, i32 4, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void mylog_init() {
  FILE *fp = fopen("tdt.log", "w");
  if (fp) {
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<mylog_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <mylog_init+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mylog_init>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1142 <mylog_init+0x22>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"tdt.log\00"
@.str.1 = [2 x i8] c"w\00"
define void @mylog_init() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
br label %8
8: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"tdt.log\00"
@.str.1 = [2 x i8] c"w\00"
define void @mylog_init() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fclose(i32* %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int dopr(char *, size_t, char const *, int /*<<< orphan*/);
int vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
  if (str != NULL)
    str[0] = 0;
  return dopr(str, count, fmt, args);
}


x86 assembly (clang, -O0):
<vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <vsnprintf+0x29>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <dopr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf>:
test   %rdi,%rdi
je     1118 <vsnprintf+0x8>
movb   $0x0,(%rdi)
jmp    1030 <dopr@plt>

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

LLVM IR (-O2):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i8 0, i8* %0
br label %7
7: ; preds = %6, %4
%8 = tail call i32 @dopr(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %8
}
int encode_GDS_I2(buf, dchars, size)
char *buf;
unsigned char *dchars;
int size;
{
  int value = 0;
  sscanf(buf, "%d", &value);
  dchars[0] = value / 256;
  dchars[1] = value % 256;
  return 2;
}


x86 assembly (clang, -O0):
<encode_GDS_I2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xecb(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <sscanf@plt>
mov    -0x18(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_GDS_I2>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xed9(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1030 <sscanf@plt>
mov    0xc(%rsp),%eax
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
mov    %ch,(%rbx)
mov    %al,0x1(%rbx)
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @encode_GDS_I2(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%10 = load i32, i32* %7
%11 = sdiv i32 %10, 256
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
%15 = load i32, i32* %7
%16 = srem i32 %15, 256
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
ret i32 2
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @encode_GDS_I2(i8* nocapture %0, i8* nocapture writeonly %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 256
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = trunc i32 %7 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %10, i8* %11
ret i32 2
}
void f109(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    goto a;
    ({ 0; });
    ({ 0; });
  a:
    0;
  });
  0;
}


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

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

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

LLVM IR (-O2):
define void @f109() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mkversion [-v version-file]\n"
                  "                 [-r releasedate-file] [outfile]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [85 x i8] c"usage: mkversion [-v version-file]\0A [-r releasedate-file] [outfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [85 x i8] c"usage: mkversion [-v version-file]\0A [-r releasedate-file] [outfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int swap16(int);
uint32_t swap32(uint32_t x) { return (swap16(x) << 16) | (swap16(x >> 16)); }


x86 assembly (clang, -O0):
<swap32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <swap16@plt>
shl    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
call   1030 <swap16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <swap16@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
sar    $0x10,%ebx
mov    %ebx,%edi
call   1030 <swap16@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @swap16(i32 %3)
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = call i32 @swap16(i32 %7)
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @swap32(i32 %0) {
%2 = tail call i32 @swap16(i32 %0)
%3 = shl i32 %2, 16
%4 = ashr i32 %0, 16
%5 = tail call i32 @swap16(i32 %4)
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int linked_mem_pool_free(void *, void *);
int virtual_machine_resource_pool_linked_free(void *pool_ptr, void *ptr) {
  return linked_mem_pool_free(pool_ptr, ptr);
}


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

x86 assembly (clang, -O2):
<virtual_machine_resource_pool_linked_free>:
jmp    1030 <linked_mem_pool_free@plt>

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

LLVM IR (-O2):
define i32 @virtual_machine_resource_pool_linked_free(i8* %0, i8* %1) {
%3 = tail call i32 @linked_mem_pool_free(i8* %0, i8* %1)
ret i32 %3
}
marker2() {}


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

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

LLVM IR (-O0):
define i32 @marker2() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @marker2() {
ret i32 undef
}
/* Variables and functions */
int fn_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120(char const *);
int fn_al_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120(const char *text) {
  int pos = 0;
  pos = fn_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120(text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120>:
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_80_ch_114_ch_101_ch_102_ch_105_ch_120@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120>:
jmp    1030 <fn_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120@plt>

LLVM IR (-O0):
define i32 @fn_al_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120(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_80_ch_114_ch_101_ch_102_ch_105_ch_120(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_80_ch_114_ch_101_ch_102_ch_105_ch_120(i8* %0) {
%2 = tail call i32 @fn_sq_ch_80_ch_114_ch_101_ch_102_ch_105_ch_120(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ local_mcu_Pin0_makeOutput__E();
int /*<<< orphan*/ pollen_parts_Led0_off__E();
void pollen_parts_Led0_targetInit__E() {
  local_mcu_Pin0_makeOutput__E();
  pollen_parts_Led0_off__E();
}


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

x86 assembly (clang, -O2):
<pollen_parts_Led0_targetInit__E>:
push   %rax
xor    %eax,%eax
call   1040 <local_mcu_Pin0_makeOutput__E@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <pollen_parts_Led0_off__E@plt>

LLVM IR (-O0):
define void @pollen_parts_Led0_targetInit__E() {
%1 = call i32 (...) @local_mcu_Pin0_makeOutput__E()
%2 = call i32 (...) @pollen_parts_Led0_off__E()
ret void
}

LLVM IR (-O2):
define void @pollen_parts_Led0_targetInit__E() {
%1 = tail call i32 (...) @local_mcu_Pin0_makeOutput__E()
%2 = tail call i32 (...) @pollen_parts_Led0_off__E()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *value = malloc(size);
  if (value == NULL) {
    fprintf(stderr, "tree: virtual memory exhausted.\n");
    exit(1);
  }
  return value;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"tree: virtual memory exhausted.\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"tree: virtual memory exhausted.\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int open(const char *name, int type, int flags) { return -1; }


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ echo();
int /*<<< orphan*/ getstr(char *);
int /*<<< orphan*/ mvprintw(int /*<<< orphan*/, int /*<<< orphan*/,
                            char const *);
int /*<<< orphan*/ nocbreak();
int /*<<< orphan*/ sscanf(char *, char *, int *);
int get_dim(const char *prompt) {
  curs_set(1);
  nocbreak();
  echo();
  char string[5];
  mvprintw(0, 0, prompt);
  getstr(string);
  int i;
  sscanf(string, "%5i", &i);
  return i;
}


x86 assembly (clang, -O0):
<get_dim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1070 <curs_set@plt>
mov    $0x0,%al
call   1060 <nocbreak@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
call   1080 <mvprintw@plt>
lea    -0xd(%rbp),%rdi
call   1040 <getstr@plt>
lea    -0xd(%rbp),%rdi
lea    0xe5b(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dim>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    $0x1,%edi
call   1070 <curs_set@plt>
xor    %eax,%eax
call   1060 <nocbreak@plt>
xor    %eax,%eax
call   1030 <echo@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1080 <mvprintw@plt>
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <getstr@plt>
lea    0xe60(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
mov    0x4(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%5i\00"
define i32 @get_dim(i8* %0) {
%2 = alloca i8*
%3 = alloca [5 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 @curs_set(i32 1)
%6 = call i32 (...) @nocbreak()
%7 = call i32 (...) @echo()
%8 = load i8*, i8** %2
%9 = call i32 @mvprintw(i32 0, i32 0, i8* %8)
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%11 = call i32 @getstr(i8* %10)
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%13 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %4)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%5i\00"
define i32 @get_dim(i8* %0) {
%2 = alloca [5 x i8]
%3 = alloca i32
%4 = tail call i32 @curs_set(i32 1)
%5 = tail call i32 (...) @nocbreak()
%6 = tail call i32 (...) @echo()
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%8 = tail call i32 @mvprintw(i32 0, i32 0, i8* %0)
%9 = call i32 @getstr(i8* %7)
%10 = bitcast i32* %3 to i8*
%11 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
ret i32 %12
}
/* Type definitions */
struct rte_ring {
  int dummy;
};

/* Variables and functions */
int rte_ring_sc_dequeue_bulk(struct rte_ring *, void **, int);
int rte_ring_sc_dequeue(struct rte_ring *r, void **obj_p) {
  return rte_ring_sc_dequeue_bulk(r, obj_p, 1);
}


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

x86 assembly (clang, -O2):
<rte_ring_sc_dequeue>:
mov    $0x1,%edx
jmp    1030 <rte_ring_sc_dequeue_bulk@plt>

LLVM IR (-O0):
%struct.rte_ring = type { i32 }
define i32 @rte_ring_sc_dequeue(%struct.rte_ring* %0, i8** %1) {
%3 = alloca %struct.rte_ring*
%4 = alloca i8**
store %struct.rte_ring* %0, %struct.rte_ring** %3
store i8** %1, i8*** %4
%5 = load %struct.rte_ring*, %struct.rte_ring** %3
%6 = load i8**, i8*** %4
%7 = call i32 @rte_ring_sc_dequeue_bulk(%struct.rte_ring* %5, i8** %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.rte_ring = type { i32 }
define i32 @rte_ring_sc_dequeue(%struct.rte_ring* %0, i8** %1) {
%3 = tail call i32 @rte_ring_sc_dequeue_bulk(%struct.rte_ring* %0, i8** %1, i32 1)
ret i32 %3
}