xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ user_store_byte(int, int);
int /*<<< orphan*/ user_word(int);
int /*<<< orphan*/ watch_check(int, int /*<<< orphan*/, int);
void user_store_word(uint16_t addr, uint16_t v) {
  watch_check(addr, user_word(addr), v);
  user_store_byte(addr + 0, v >> 8);
  user_store_byte(addr + 1, v & 0xff);
}


x86 assembly (clang, -O0):
<user_store_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <user_word@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1050 <watch_check@plt>
mov    -0x4(%rbp),%edi
add    $0x0,%edi
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
call   1030 <user_store_byte@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
call   1030 <user_store_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_store_word>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <user_word@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
call   1050 <watch_check@plt>
mov    %ebx,%esi
sar    $0x8,%esi
mov    %ebp,%edi
call   1030 <user_store_byte@plt>
add    $0x1,%ebp
movzbl %bl,%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <user_store_byte@plt>

LLVM IR (-O0):
define void @user_store_word(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* %3
%7 = call i32 @user_word(i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @watch_check(i32 %5, i32 %7, i32 %8)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 0
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = call i32 @user_store_byte(i32 %11, i32 %13)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = call i32 @user_store_byte(i32 %16, i32 %18)
ret void
}

LLVM IR (-O2):
define void @user_store_word(i32 %0, i32 %1) {
%3 = tail call i32 @user_word(i32 %0)
%4 = tail call i32 @watch_check(i32 %0, i32 %3, i32 %1)
%5 = ashr i32 %1, 8
%6 = tail call i32 @user_store_byte(i32 %0, i32 %5)
%7 = add nsw i32 %0, 1
%8 = and i32 %1, 255
%9 = tail call i32 @user_store_byte(i32 %7, i32 %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ hwloc_topology_t;

/* Variables and functions */
int /*<<< orphan*/ hwloc_topology_destroy(int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_topology_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ putenv(char *);
int main(void) {
  hwloc_topology_t topology;
  putenv("HWLOC_COMPONENTS_VERBOSE=1");
  hwloc_topology_init(&topology);
  hwloc_topology_destroy(topology);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <putenv@plt>
lea    -0x8(%rbp),%rdi
call   1030 <hwloc_topology_init@plt>
mov    -0x8(%rbp),%edi
call   1050 <hwloc_topology_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <putenv@plt>
lea    0x4(%rsp),%rdi
call   1030 <hwloc_topology_init@plt>
mov    0x4(%rsp),%edi
call   1050 <hwloc_topology_destroy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"HWLOC_COMPONENTS_VERBOSE=1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @putenv(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @hwloc_topology_init(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @hwloc_topology_destroy(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"HWLOC_COMPONENTS_VERBOSE=1\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @putenv(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @hwloc_topology_init(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @hwloc_topology_destroy(i32 %5)
ret i32 0
}
/* Variables and functions */
char const *strstr(char const *, char const *);
const char *strstr_P(const char *haystack, const char *needle) {
  return strstr(haystack, needle);
}


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

x86 assembly (clang, -O2):
<strstr_P>:
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define i8* @strstr_P(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 i8* @strstr(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strstr_P(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
/* Type definitions */
struct sysinfo {
  long long totalram;
  long long totalswap;
};

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
long long totalVirtualMemory(bool withSwap) {
  struct sysinfo mem;
  sysinfo(&mem);
  if (withSwap)
    return mem.totalram + mem.totalswap;
  else
    return mem.totalram;
}


x86 assembly (clang, -O0):
<totalVirtualMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <sysinfo@plt>
cmpl   $0x0,-0xc(%rbp)
je     113f <totalVirtualMemory+0x2f>
mov    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <totalVirtualMemory+0x37>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<totalVirtualMemory>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %rsp,%rdi
call   1030 <sysinfo@plt>
test   %ebx,%ebx
je     112a <totalVirtualMemory+0x1a>
mov    0x8(%rsp),%rax
jmp    112c <totalVirtualMemory+0x1c>
xor    %eax,%eax
add    (%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.sysinfo = type { i64, i64 }
define i64 @totalVirtualMemory(i32 %0) {
%2 = alloca %struct.sysinfo
%3 = bitcast %struct.sysinfo* %2 to i8*
%4 = call i32 @sysinfo(%struct.sysinfo* %2)
%5 = icmp eq i32 %0, 0
%6 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %2, i64 0, i32 1
%9 = load i64, i64* %8
%10 = select i1 %5, i64 0, i64 %9
%11 = add nsw i64 %10, %7
ret i64 %11
}
void i_wait(void) { ; }


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

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

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

LLVM IR (-O2):
define void @i_wait() {
ret void
}
long f3() { return "asdfg"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"asdfg\00"
define i64 @f3() {
ret i64 ptrtoint ([6 x i8]* @.str to i64)
}

LLVM IR (-O2):
@.str = [6 x i8] c"asdfg\00"
define i64 @f3() {
ret i64 ptrtoint ([6 x i8]* @.str to i64)
}
/* Variables and functions */
int /*<<< orphan*/ rightDropAtPos(int /*<<< orphan*/);
int /*<<< orphan*/ writeDebugStreamLine(char *);
void rightOuterCrate1() {
  writeDebugStreamLine("Crate 1");
  rightDropAtPos(0);
}


x86 assembly (clang, -O0):
<rightOuterCrate1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
xor    %edi,%edi
call   1040 <rightDropAtPos@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightOuterCrate1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <rightDropAtPos@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Crate 1\00"
define void @rightOuterCrate1() {
%1 = call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @rightDropAtPos(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Crate 1\00"
define void @rightOuterCrate1() {
%1 = tail call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @rightDropAtPos(i32 0)
ret void
}
void test_builtin_choose_expr(int i) {
  __emit_expression_range(0, __builtin_choose_expr(1, i, i) + i);
  __emit_expression_range(0, i + __builtin_choose_expr(1, i, i));
}


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

x86 assembly (clang, -O2):
<test_builtin_choose_expr>:
push   %rbx
lea    (%rdi,%rdi,1),%ebx
xor    %edi,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_builtin_choose_expr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @test_builtin_choose_expr(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %2)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %2)
ret void
}
signed short signedshort_ignoring_shortint(signed short x, short int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @signedshort_ignoring_shortint(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_shortint(i16 returned signext %0, i16 signext %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_WR;
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
int strlen(char const *);
int write(int, char const *, int);
int admin_send(int fd, const char *str) {
  int len = strlen(str);
  if (write(fd, str, len) != len)
    return -1;
  shutdown(fd, SHUT_WR);
  return 0;
}


x86 assembly (clang, -O0):
<admin_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
je     116f <admin_send+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1187 <admin_send+0x57>
mov    -0x8(%rbp),%edi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
call   1040 <shutdown@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<admin_send>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ebp,%ecx
jne    116f <admin_send+0x3f>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
call   1040 <shutdown@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@SHUT_WR = global i32 0
define i32 @admin_send(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @SHUT_WR
%8 = tail call i32 @shutdown(i32 %0, i32 %7)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ instrumentUpdateCmpMap(void *, unsigned int);
void instrumentCmpMap(void *addr, unsigned int n) {
  instrumentUpdateCmpMap(addr, n);
}


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

x86 assembly (clang, -O2):
<instrumentCmpMap>:
jmp    1030 <instrumentUpdateCmpMap@plt>

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

LLVM IR (-O2):
define void @instrumentCmpMap(i8* %0, i32 %1) {
%3 = tail call i32 @instrumentUpdateCmpMap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int fconf_istoken(char const, char);
int fconf_istoken_blank(const char str) { return fconf_istoken(str, ' '); }


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

x86 assembly (clang, -O2):
<fconf_istoken_blank>:
mov    $0x20,%esi
jmp    1030 <fconf_istoken@plt>

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

LLVM IR (-O2):
define i32 @fconf_istoken_blank(i8 signext %0) {
%2 = tail call i32 @fconf_istoken(i8 signext %0, i8 signext 32)
ret i32 %2
}
void rcu_nocb_lock(struct rcu_data *rdp) {}


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

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

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

LLVM IR (-O2):
%struct.rcu_data = type opaque
define void @rcu_nocb_lock(%struct.rcu_data* nocapture %0) {
ret void
}
/* Variables and functions */
int *malloc(int);
int *calloc(int n, int s) { return malloc(n * s); }


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

x86 assembly (clang, -O2):
<calloc>:
imul   %esi,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @calloc(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 = call i32* @malloc(i32 %7)
ret i32* %8
}

LLVM IR (-O2):
define noalias i32* @calloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32* @malloc(i32 %3)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(char const *s, int fd) {
  int i;
  i = 0;
  while (s[i]) {
    write(fd, &s[i], 1);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115e <ft_putstr_fd+0x4e>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ft_putstr_fd+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1139 <ft_putstr_fd+0x29>
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr_fd+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = tail call i32 @write(i32 %1, i8* %7, i32 1)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 32; i < 127; i++) {
    printf("%d - %c\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x20,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d - %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 32, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 127
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void vfprintf() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @vfprintf() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getTime(void) {
  struct timeval time;
  gettimeofday(&time, NULL);
  return time.tv_sec + 1e-6 * time.tv_usec;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %7, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _Exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void exitPrint(char *msg) {
  fprintf(stderr, "%s\n", msg);
  _Exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<exitPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <_Exit@plt>

x86 assembly (clang, -O2):
<exitPrint>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <_Exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @exitPrint(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @_Exit(i32 %4)
unreachable
}
/* Variables and functions */
int strlen(char const *);
char *xml_utf8_decode(char const *, int, int *, char *);
char *utf8_decode(const char *str) {
  char *out;
  if (strlen(str)) {
    int alen, len;
    alen = strlen(str);
    out = xml_utf8_decode(str, alen, &len, "ISO-8859-1");
  }
  return out;
}


x86 assembly (clang, -O0):
<utf8_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
je     1165 <utf8_decode+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x18(%rbp),%rdx
lea    0xea4(%rip),%rcx
call   1040 <xml_utf8_decode@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_decode>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     1151 <utf8_decode+0x31>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xec0(%rip),%rcx
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <xml_utf8_decode@plt>
jmp    1151 <utf8_decode+0x31>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"ISO-8859-1\00"
define i8* @utf8_decode(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %4
%14 = call i8* @xml_utf8_decode(i8* %12, i32 %13, i32* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %14, i8** %3
br label %15
15: ; preds = %9, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [11 x i8] c"ISO-8859-1\00"
define i8* @utf8_decode(i8* %0) {
%2 = alloca i32
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = bitcast i32* %2 to i8*
%7 = tail call i32 @strlen(i8* %0)
%8 = call i8* @xml_utf8_decode(i8* %0, i32 %7, i32* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %1
%10 = phi i8* [ %8, %5 ], [ undef, %1 ]
ret i8* %10
}
/* Variables and functions */
void *malloc(size_t);
void *a(size_t c) {
  void *d = malloc(c);
  return d;
}


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

x86 assembly (clang, -O2):
<a>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @a(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
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @a(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
__attribute__((always_)) void sync$fence$W_SMP() {
  asm volatile("" ::: "memory");
}


x86 assembly (clang, -O0):
<sync$fence$W_SMP>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync$fence$W_SMP>:
ret

LLVM IR (-O0):
define void @"sync$fence$W_SMP"() {
ret void
}

LLVM IR (-O2):
define void @"sync$fence$W_SMP"() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void all_leds_off(void) {
  (*(volatile unsigned int *)(0x7F008824)) |= 0xF;
  return;
}


x86 assembly (clang, -O0):
<all_leds_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0xf,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_leds_off>:
orl    $0xf,0x7f008824
0f
ret

LLVM IR (-O0):
define void @all_leds_off() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = or i32 %1, 15
store volatile i32 %2, i32* inttoptr (i64 2130741284 to i32*)
ret void
}

LLVM IR (-O2):
define void @all_leds_off() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = or i32 %1, 15
store volatile i32 %2, i32* inttoptr (i64 2130741284 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __streams_init();
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ error_init();
int main(int, char **, char **);
void _start(int argc, char *argv[], char *envp[]) {
  int ret;
  error_init();
  __streams_init();
  ret = main(argc, argv, envp);
  _exit(ret);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <error_init@plt>
mov    $0x0,%al
call   1050 <__streams_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1060 <main@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <error_init@plt>
xor    %eax,%eax
call   1050 <__streams_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <main@plt>
mov    %eax,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @_start(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = call i32 (...) @error_init()
%9 = call i32 (...) @__streams_init()
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = load i8**, i8*** %6
%13 = call i32 @main(i32 %10, i8** %11, i8** %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @_exit(i32 %14)
unreachable
}

LLVM IR (-O2):
define void @_start(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 (...) @error_init()
%5 = tail call i32 (...) @__streams_init()
%6 = tail call i32 @main(i32 %0, i8** %1, i8** %2)
%7 = tail call i32 @_exit(i32 %6)
unreachable
}
void test2(int *i, int *j) {}


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

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

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

LLVM IR (-O2):
define void @test2(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Type definitions */
struct srcu_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __srcu_read_unlock(struct srcu_struct *, int);
void srcu_read_unlock(struct srcu_struct *sp, int idx) {
  do {
  } while (0);
  __srcu_read_unlock(sp, idx);
}


x86 assembly (clang, -O0):
<srcu_read_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
jmp    1124 <srcu_read_unlock+0x14>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <__srcu_read_unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srcu_read_unlock>:
jmp    1030 <__srcu_read_unlock@plt>

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

LLVM IR (-O2):
%struct.srcu_struct = type { i32 }
define void @srcu_read_unlock(%struct.srcu_struct* %0, i32 %1) {
%3 = tail call i32 @__srcu_read_unlock(%struct.srcu_struct* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ simgraph_init(int, int);
int init_adaptor() {
  printf("Preparing display ...\n");
  simgraph_init(672, 480);
  return 1;
}


x86 assembly (clang, -O0):
<init_adaptor>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a0,%edi
mov    $0x1e0,%esi
call   1040 <simgraph_init@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_adaptor>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2a0,%edi
mov    $0x1e0,%esi
call   1040 <simgraph_init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Preparing display ...\0A\00"
define i32 @init_adaptor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @simgraph_init(i32 672, i32 480)
ret i32 1
}

LLVM IR (-O2):
@str = [22 x i8] c"Preparing display ...\00"
define i32 @init_adaptor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @simgraph_init(i32 672, i32 480)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid_count(unsigned int, unsigned int, unsigned int,
                                 unsigned int, unsigned int, unsigned int);
void cpuid(unsigned int *registers) {
  __cpuid_count(registers[0], registers[2], *registers, *(registers + 1),
                *(registers + 2), *(registers + 3));
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r9d
call   1030 <__cpuid_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
mov    0x8(%rdi),%esi
mov    (%rdi),%edx
mov    0x4(%rdi),%ecx
mov    0xc(%rdi),%r9d
mov    %edx,%edi
mov    %esi,%r8d
jmp    1030 <__cpuid_count@plt>

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

LLVM IR (-O2):
define void @cpuid(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = tail call i32 @__cpuid_count(i32 %2, i32 %4, i32 %2, i32 %6, i32 %4, i32 %8)
ret void
}
double time(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @time(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @time(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int ptrace(int, int, int, int);
int ptraceContinue(int pid, int sig) { return ptrace(7, pid, 1, sig); }


x86 assembly (clang, -O0):
<ptraceContinue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x7,%edi
mov    $0x1,%edx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptraceContinue>:
mov    %esi,%ecx
mov    %edi,%esi
mov    $0x7,%edi
mov    $0x1,%edx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
define i32 @ptraceContinue(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 @ptrace(i32 7, i32 %5, i32 1, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ptraceContinue(i32 %0, i32 %1) {
%3 = tail call i32 @ptrace(i32 7, i32 %0, i32 1, i32 %1)
ret i32 %3
}
char const *menu(void) { return "mlako mlijeko"; }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"mlako mlijeko\00"
define i8* @menu() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void concat_char(char *str, char *x, const char *sep) {
  char buf[50] = {0};
  sprintf(buf, "%s%s", sep, x);
  strcat(str, buf);
}


x86 assembly (clang, -O0):
<concat_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1030 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe99(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_char>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movw   $0x0,0x30(%rsp)
lea    0xeb4(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcat@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define void @concat_char(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [50 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast [50 x i8]* %7 to i8*
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%15 = call i32 @strcat(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define void @concat_char(i8* %0, i8* %1, i8* %2) {
%4 = alloca [50 x i8]
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %1)
%7 = call i32 @strcat(i8* %0, i8* %5)
ret void
}
int a(int n) {
  char bv[10];
  return bv;
}


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

x86 assembly (clang, -O2):
<a>:
lea    -0xa(%rsp),%rax
ret

LLVM IR (-O0):
define i32 @a(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = ptrtoint i8* %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = ptrtoint [10 x i8]* %2 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}
void MP_motor(int VV_device, int VV_command) {}


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

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

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

LLVM IR (-O2):
define void @MP_motor(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
long bb_strtoll(char const *, char **, int);
long bb_strtol(const char *arg, char **endp, int base) {
  return bb_strtoll(arg, endp, base);
}


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

x86 assembly (clang, -O2):
<bb_strtol>:
jmp    1030 <bb_strtoll@plt>

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

LLVM IR (-O2):
define i64 @bb_strtol(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @bb_strtoll(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void put16bits(uint8_t **buffer, uint16_t value) {
  value = htons(value);
  memcpy(*buffer, &value, 2);
  *buffer += 2;
}


x86 assembly (clang, -O0):
<put16bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put16bits>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
mov    (%rbx),%rdi
lea    0xc(%rsp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
addq   $0x8,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @put16bits(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 = call i32 @htons(i32 %5)
store i32 %6, i32* %4
%7 = load i32**, i32*** %3
%8 = load i32*, i32** %7
%9 = call i32 @memcpy(i32* %8, i32* %4, i32 2)
%10 = load i32**, i32*** %3
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 2
store i32* %12, i32** %10
ret void
}

LLVM IR (-O2):
define void @put16bits(i32** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htons(i32 %1)
store i32 %4, i32* %3
%5 = load i32*, i32** %0
%6 = call i32 @memcpy(i32* %5, i32* %3, i32 2)
%7 = load i32*, i32** %0
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32* %8, i32** %0
ret void
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115c <main+0x3c>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%al
je     1153 <main+0x33>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i8 signext %5)
%7 = tail call signext i8 (...) @getchar()
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
int fun735() { return 735; }


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

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

LLVM IR (-O0):
define i32 @fun735() {
ret i32 735
}

LLVM IR (-O2):
define i32 @fun735() {
ret i32 735
}
double ls_cost_nm8_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<ls_cost_nm8_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm8_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm8_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_cost_nm8_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long, unsigned long long);
void show(unsigned long long int *a) {
  printf("[%#018llx, %#018llx]\n", a[0], a[1]);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"[%llx, %llx]\0A\00"
define void @show(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = load i64*, i64** %2
%7 = getelementptr inbounds i64, i64* %6, i64 1
%8 = load i64, i64* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"[%llx, %llx]\0A\00"
define void @show(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = getelementptr inbounds i64, i64* %0, i64 1
%4 = load i64, i64* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %2, i64 %4)
ret void
}