xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PACKSSDW(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x6b);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x70);
  addbyte(0xc0 | (dst_reg << 3) | dst_reg);
  addbyte(0x08);
}


x86 assembly (clang, -O0):
<MMX_PACKSSDW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x6b,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x70,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <addbyte@plt>
mov    $0x8,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PACKSSDW>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x6b,%edi
call   1030 <addbyte@plt>
mov    %r14d,%ebx
or     $0x18,%ebx
shl    $0x3,%ebx
or     %ebx,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x70,%edi
call   1030 <addbyte@plt>
or     %r14d,%ebx
mov    %ebx,%edi
call   1030 <addbyte@plt>
mov    $0x8,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PACKSSDW(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 107)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
%14 = call i32 @addbyte(i32 102)
%15 = call i32 @addbyte(i32 15)
%16 = call i32 @addbyte(i32 112)
%17 = load i32, i32* %3
%18 = shl i32 %17, 3
%19 = or i32 192, %18
%20 = load i32, i32* %3
%21 = or i32 %19, %20
%22 = call i32 @addbyte(i32 %21)
%23 = call i32 @addbyte(i32 8)
ret void
}

LLVM IR (-O2):
define void @MMX_PACKSSDW(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 107)
%6 = shl i32 %0, 3
%7 = or i32 %6, 192
%8 = or i32 %7, %1
%9 = tail call i32 @addbyte(i32 %8)
%10 = tail call i32 @addbyte(i32 102)
%11 = tail call i32 @addbyte(i32 15)
%12 = tail call i32 @addbyte(i32 112)
%13 = or i32 %7, %0
%14 = tail call i32 @addbyte(i32 %13)
%15 = tail call i32 @addbyte(i32 8)
ret void
}
/* Type definitions */
struct tslib_module_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tslib_module_info *);
int variance_fini(struct tslib_module_info *info) { free(info); }


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

x86 assembly (clang, -O2):
<variance_fini>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.tslib_module_info = type { i32 }
define i32 @variance_fini(%struct.tslib_module_info* %0) {
%2 = alloca i32
%3 = alloca %struct.tslib_module_info*
store %struct.tslib_module_info* %0, %struct.tslib_module_info** %3
%4 = load %struct.tslib_module_info*, %struct.tslib_module_info** %3
%5 = call i32 @free(%struct.tslib_module_info* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
%struct.tslib_module_info = type { i32 }
define i32 @variance_fini(%struct.tslib_module_info* nocapture %0) {
%2 = tail call i32 @free(%struct.tslib_module_info* %0)
ret i32 undef
}
int main() { int i = 5566; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x15be,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int foo(int);
int obj1func2(int a) { return foo(a) + 10; }


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

x86 assembly (clang, -O2):
<obj1func2>:
push   %rax
call   1030 <foo@plt>
add    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @obj1func2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo(i32 %3)
%5 = add nsw i32 %4, 10
ret i32 %5
}

LLVM IR (-O2):
define i32 @obj1func2(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
%3 = add nsw i32 %2, 10
ret i32 %3
}
void ggoto(void) {}


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

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

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

LLVM IR (-O2):
define void @ggoto() {
ret void
}
void g_ptr_array_foreach() {}


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

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

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

LLVM IR (-O2):
define void @g_ptr_array_foreach() {
ret void
}
int grid_y(int y) { return 11 - y - 1; }


x86 assembly (clang, -O0):
<grid_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xb,%eax
sub    -0x4(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_y>:
mov    $0xa,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @grid_y(i32 %0) {
%2 = sub i32 10, %0
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_led_8_8_12(int, int, int, int);
void render_xy(uint8_t x, uint8_t y) {
  set_led_8_8_12(8 - x - 1, 7, y, ((1 << 12) - 1));
}


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

x86 assembly (clang, -O2):
<render_xy>:
mov    %esi,%edx
mov    $0x7,%eax
sub    %edi,%eax
mov    %eax,%edi
mov    $0x7,%esi
mov    $0xfff,%ecx
jmp    1030 <set_led_8_8_12@plt>

LLVM IR (-O0):
define void @render_xy(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 = sub nsw i32 8, %5
%7 = sub nsw i32 %6, 1
%8 = load i32, i32* %4
%9 = call i32 @set_led_8_8_12(i32 %7, i32 7, i32 %8, i32 4095)
ret void
}

LLVM IR (-O2):
define void @render_xy(i32 %0, i32 %1) {
%3 = sub i32 7, %0
%4 = tail call i32 @set_led_8_8_12(i32 %3, i32 7, i32 %1, i32 4095)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void QueryModualName(char szName[]) { strcpy(szName, "terasic_pcie_qsys.so"); }


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

x86 assembly (clang, -O2):
<QueryModualName>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"terasic_pcie_qsys.so\00"
define void @QueryModualName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"terasic_pcie_qsys.so\00"
define void @QueryModualName(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
void adts_hdr_up(char *adts, int size) {
  int len = size + 7;
  adts[3] = ((len >> 11) & 0x03) | (adts[5] & 0xfc);
  ;
  adts[4] = (len >> 3) & 0xff;
  adts[5] = ((len & 7) << 5) | (adts[5] & 0x1f);
}


x86 assembly (clang, -O0):
<adts_hdr_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0xb,%eax
and    $0x3,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x5(%rcx),%ecx
and    $0xfc,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%eax
sar    $0x3,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x10(%rbp),%eax
and    $0x7,%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x5(%rcx),%ecx
and    $0x1f,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x5(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_hdr_up>:
add    $0x7,%esi
mov    %esi,%eax
shr    $0xb,%eax
mov    0x5(%rdi),%cl
mov    %ecx,%edx
and    $0xfc,%dl
and    $0x3,%al
or     %dl,%al
mov    %al,0x3(%rdi)
mov    %esi,%eax
shr    $0x3,%eax
mov    %al,0x4(%rdi)
and    $0x1f,%cl
shl    $0x5,%sil
or     %cl,%sil
mov    %sil,0x5(%rdi)
ret

LLVM IR (-O0):
define void @adts_hdr_up(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 7
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = ashr i32 %8, 11
%10 = and i32 %9, 3
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = and i32 %14, 252
%16 = or i32 %10, %15
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 3
store i8 %17, i8* %19
%20 = load i32, i32* %5
%21 = ashr i32 %20, 3
%22 = and i32 %21, 255
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 4
store i8 %23, i8* %25
%26 = load i32, i32* %5
%27 = and i32 %26, 7
%28 = shl i32 %27, 5
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = and i32 %32, 31
%34 = or i32 %28, %33
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i64 5
store i8 %35, i8* %37
ret void
}

LLVM IR (-O2):
define void @adts_hdr_up(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 7
%4 = lshr i32 %3, 11
%5 = getelementptr inbounds i8, i8* %0, i64 5
%6 = load i8, i8* %5
%7 = and i8 %6, -4
%8 = trunc i32 %4 to i8
%9 = and i8 %8, 3
%10 = or i8 %7, %9
%11 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %10, i8* %11
%12 = lshr i32 %3, 3
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %13, i8* %14
%15 = and i8 %6, 31
%16 = trunc i32 %3 to i8
%17 = shl i8 %16, 5
%18 = or i8 %15, %17
store i8 %18, i8* %5
ret void
}
void __ompc_end(void) {}


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

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

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

LLVM IR (-O2):
define void @__ompc_end() {
ret void
}
void monitor(const void *addr, int extensions, int hints) {
  __asm __volatile__("monitor;" : : "a"(addr), "c"(extensions), "d"(hints));
}


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

x86 assembly (clang, -O2):
<monitor>:
mov    %esi,%ecx
mov    %rdi,%rax
monitor %rax,%ecx,%edx
ret

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

LLVM IR (-O2):
define void @monitor(i8* %0, i32 %1, i32 %2) {
tail call void asm sideeffect "monitor;", "{ax},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %1, i32 %2)
ret void
}
int f() {}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
int numcmp(const long long a, const long long b) {
  if (a < b)
    return -1;
  if (a > b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1126 <numcmp+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <numcmp+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1140 <numcmp+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <numcmp+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @numcmp(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %16
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = icmp sgt i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %3
br label %16
15: ; preds = %10
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @numcmp(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = icmp sgt i64 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int add_two_ints(int x1, int x2) { return x1 + x2; }


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

x86 assembly (clang, -O2):
<add_two_ints>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add_two_ints(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add_two_ints(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putchar_fd(char c, int fd) {
  write(fd, &c, 1);
  return;
}


x86 assembly (clang, -O0):
<ft_putchar_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar_fd>:
push   %rax
mov    %esi,%eax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @ft_putchar_fd(i8 signext %0, i32 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @write(i32 %1, i8* %3, i32 1)
ret void
}
int f2(int y, int x) { return ((~x) & y) | x; }


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

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

LLVM IR (-O0):
define i32 @f2(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 = xor i32 %5, -1
%7 = load i32, i32* %3
%8 = and i32 %6, %7
%9 = load i32, i32* %4
%10 = or i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *string, const char *control) {
  static char *nexttoken = 0;
  return strtok_r(string, control, &nexttoken);
}


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

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.nexttoken = internal global i8* null
define i8* @strtok(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* @strtok_r(i8* %5, i8* %6, i8** @strtok.nexttoken)
ret i8* %7
}

LLVM IR (-O2):
@strtok.nexttoken = internal global i8* null
define i8* @strtok(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.nexttoken)
ret i8* %3
}
int m_entry_header(void) {}


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

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

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

LLVM IR (-O2):
define i32 @m_entry_header() {
ret i32 undef
}
/* Variables and functions */
double frandom();
double los() { return frandom(); }


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

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

LLVM IR (-O0):
define double @los() {
%1 = call double (...) @frandom()
ret double %1
}

LLVM IR (-O2):
define double @los() {
%1 = tail call double (...) @frandom()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ft_strnjoin(char *, char *, size_t);
char *strnjoin_wrapper(char *s1, char *s2, size_t s2size) {
  char *tmp;
  tmp = ft_strnjoin(s1, s2, s2size);
  free(s1);
  return (tmp);
}


x86 assembly (clang, -O0):
<strnjoin_wrapper>:
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   1040 <ft_strnjoin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnjoin_wrapper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <ft_strnjoin@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strnjoin_wrapper(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @ft_strnjoin(i8* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %4
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %7
ret i8* %14
}

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

/* Variables and functions */
int /*<<< orphan*/ write_word_data(int /*<<< orphan*/, int, int /*<<< orphan*/);
void set_bus_pullups(uint8_t address, uint16_t value) {
  write_word_data(address, 0x0C, value);
}


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

x86 assembly (clang, -O2):
<set_bus_pullups>:
mov    %esi,%edx
mov    $0xc,%esi
jmp    1030 <write_word_data@plt>

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

LLVM IR (-O2):
define void @set_bus_pullups(i32 %0, i32 %1) {
%3 = tail call i32 @write_word_data(i32 %0, i32 12, i32 %1)
ret void
}
/* Variables and functions */
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log2(int);
int pow(int, int);
int offset(int idx) {
  if (idx < pow(2, 5)) {
    return 0;
  } else {
    return pow(2, floor(log2(idx)));
  }
}


x86 assembly (clang, -O0):
<offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
mov    $0x5,%esi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jge    1169 <offset+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1187 <offset+0x57>
mov    -0x8(%rbp),%edi
call   1030 <log2@plt>
mov    %eax,%edi
call   1050 <floor@plt>
mov    %eax,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
mov    $0x5,%esi
call   1040 <pow@plt>
cmp    %ebx,%eax
jle    114a <offset+0x1a>
xor    %eax,%eax
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <log2@plt>
mov    %eax,%edi
call   1050 <floor@plt>
mov    $0x2,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <pow@plt>

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

LLVM IR (-O2):
define i32 @offset(i32 %0) {
%2 = tail call i32 @pow(i32 2, i32 5)
%3 = icmp sgt i32 %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @log2(i32 %0)
%6 = tail call i32 @floor(i32 %5)
%7 = tail call i32 @pow(i32 2, i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ fabs(float);
bool is_close_flt_tol(float a, float b, float tolerance) {
  return (fabs(a - b) <= (tolerance + fabs(b)));
}


x86 assembly (clang, -O0):
<is_close_flt_tol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movss  -0x14(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
cvtsi2ss %rax,%xmm2
addss  %xmm2,%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_close_flt_tol>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0xc(%rsp)
subss  %xmm1,%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0x14(%rsp),%xmm0
xor    %eax,%eax
ucomiss 0x10(%rsp),%xmm0
setae  %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @is_close_flt_tol(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
%10 = call i64 @fabs(float %9)
%11 = sitofp i64 %10 to float
%12 = load float, float* %6
%13 = load float, float* %5
%14 = call i64 @fabs(float %13)
%15 = sitofp i64 %14 to float
%16 = fadd float %12, %15
%17 = fcmp ole float %11, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_close_flt_tol(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call i64 @fabs(float %4)
%6 = sitofp i64 %5 to float
%7 = tail call i64 @fabs(float %1)
%8 = sitofp i64 %7 to float
%9 = fadd float %8, %2
%10 = fcmp oge float %9, %6
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test_clear();
int /*<<< orphan*/ test_get();
int /*<<< orphan*/ test_itr();
int main() {
  test_clear();
  test_itr();
  test_get();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_clear()
%2 = tail call i32 (...) @test_itr()
%3 = tail call i32 (...) @test_get()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ resetFlag(int);
int /*<<< orphan*/ setFlag(int);
void bit(unsigned char pos, unsigned char value) {
  if ((0x01 << pos) & value)
    resetFlag(7);
  else
    setFlag(7);
  resetFlag(6);
  setFlag(5);
}


x86 assembly (clang, -O0):
<bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movzbl -0x2(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115d <bit+0x3d>
mov    $0x7,%edi
call   1040 <resetFlag@plt>
jmp    1167 <bit+0x47>
mov    $0x7,%edi
call   1030 <setFlag@plt>
mov    $0x6,%edi
call   1040 <resetFlag@plt>
mov    $0x5,%edi
call   1030 <setFlag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit>:
push   %rax
bt     %edi,%esi
jae    1132 <bit+0x12>
mov    $0x7,%edi
call   1040 <resetFlag@plt>
jmp    113c <bit+0x1c>
mov    $0x7,%edi
call   1030 <setFlag@plt>
mov    $0x6,%edi
call   1040 <resetFlag@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <setFlag@plt>

LLVM IR (-O0):
define void @bit(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl i32 1, %6
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @resetFlag(i32 7)
br label %16
14: ; preds = %2
%15 = call i32 @setFlag(i32 7)
br label %16
16: ; preds = %14, %12
%17 = call i32 @resetFlag(i32 6)
%18 = call i32 @setFlag(i32 5)
ret void
}

LLVM IR (-O2):
define void @bit(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw i32 1, %3
%5 = zext i8 %1 to i32
%6 = and i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @resetFlag(i32 7)
br label %12
10: ; preds = %2
%11 = tail call i32 @setFlag(i32 7)
br label %12
12: ; preds = %10, %8
%13 = tail call i32 @resetFlag(i32 6)
%14 = tail call i32 @setFlag(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ G1();
void C1() { G1(); }


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

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

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

LLVM IR (-O2):
define void @C1() {
%1 = tail call i32 (...) @G1()
ret void
}
/* Variables and functions */
char getchar();
void readstr(char *buf) {
  int idx = 0;
  char c;
  while ((c = getchar()) != '\n') {
    buf[idx] = c;
    idx++;
  }
  buf[idx] = '\0';
}


x86 assembly (clang, -O0):
<readstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0xd(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1155 <readstr+0x45>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <readstr+0x13>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1145 <readstr+0x35>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1130 <readstr+0x20>
mov    %ebx,%ebx
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @readstr(i8* nocapture writeonly %0) {
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %9, %4 ], [ %2, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %6, i8* %7
%8 = add nuw i64 %5, 1
%9 = tail call signext i8 (...) @getchar()
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = and i64 %8, 4294967295
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 0, %1 ], [ %12, %11 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret void
}
unsigned char gf4_squ(unsigned char a) { return a ^ (a >> 1); }


x86 assembly (clang, -O0):
<gf4_squ>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x1(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf4_squ>:
mov    %edi,%eax
shr    %al
xor    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @gf4_squ(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 1
%8 = xor i32 %4, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @gf4_squ(i8 zeroext %0) {
%2 = lshr i8 %0, 1
%3 = xor i8 %2, %0
ret i8 %3
}
void INT_Excep_ICU_IRQ2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ2() {
ret void
}
/* Variables and functions */
int get_fat_entry(int, char *);
int /*<<< orphan*/ printf(char *, int, int);
void print(char *fatTable, int x, int y) {
  int i;
  for (i = x; i <= y; i++) {
    printf("Entry %d: %x\n", i, get_fat_entry(i, fatTable));
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1175 <print+0x55>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <get_fat_entry@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1138 <print+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jg     115d <print+0x3d>
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
add    $0x1,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %r14,%rsi
call   1040 <get_fat_entry@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1140 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Entry %d: %x\0A\00"
define void @print(i8* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @get_fat_entry(i32 %6, i8* %0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = add i32 %6, 1
%10 = icmp eq i32 %6, %2
br i1 %10, label %11, label %5
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int parseHex(int);
uint8_t hexChars2Byte(uint8_t h, uint8_t l) {
  h = parseHex(h);
  l = parseHex(l);
  return (h << 4) | l;
}


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

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

LLVM IR (-O0):
define i32 @hexChars2Byte(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 = call i32 @parseHex(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @parseHex(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 4
%11 = load i32, i32* %4
%12 = or i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @hexChars2Byte(i32 %0, i32 %1) {
%3 = tail call i32 @parseHex(i32 %0)
%4 = tail call i32 @parseHex(i32 %1)
%5 = shl i32 %3, 4
%6 = or i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void __attribute__((regparm(3))) memcpy_19(void *dest, void *src) {
  memcpy(dest, src, 19);
}


x86 assembly (clang, -O0):
<memcpy_19>:
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    $0x13,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_19>:
mov    $0x13,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @memcpy_19(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 19)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fctl_biased(void *, unsigned char);
void ctl_biased(void *d, unsigned char uc) { fctl_biased(d, uc / 127.0); }


x86 assembly (clang, -O0):
<ctl_biased>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
call   1030 <fctl_biased@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctl_biased>:
cvtsi2sd %esi,%xmm0
divsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
jmp    1030 <fctl_biased@plt>

LLVM IR (-O0):
define void @ctl_biased(i8* %0, i8 zeroext %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 = zext i8 %6 to i32
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.270000e+02
%10 = fptoui double %9 to i8
%11 = call i32 @fctl_biased(i8* %5, i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @ctl_biased(i8* %0, i8 zeroext %1) {
%3 = uitofp i8 %1 to double
%4 = fdiv double %3, 1.270000e+02
%5 = fptoui double %4 to i8
%6 = tail call i32 @fctl_biased(i8* %0, i8 zeroext %5)
ret void
}
void foo_1_1_2_2_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_1_2_2_1_1() {
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_get_allow_interactive_authorization(void *m) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_get_allow_interactive_authorization>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_allow_interactive_authorization(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void print_char(char c) { write(1, &c, sizeof(c)); }


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun1(void) {
  int n = 1;
  printf("%d\n", n);
}


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

x86 assembly (clang, -O2):
<fun1>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @fun1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
bool is_EOF(FILE *stream) {
  char letra;
  letra = fgetc(stream);
  if (letra == EOF) {
    ungetc(letra, stream);
    return true;
  }
  ungetc(letra, stream);
  return false;
}


x86 assembly (clang, -O0):
<is_EOF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1169 <is_EOF+0x49>
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
movl   $0x1,-0x4(%rbp)
jmp    117f <is_EOF+0x5f>
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_EOF>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    0x2eb6(%rip),%rcx
xor    %ebp,%ebp
cmp    (%rcx),%al
sete   %bpl
movsbl %al,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @is_EOF(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call signext i8 @fgetc(i32* %5)
store i8 %6, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i8, i8* %4
%14 = load i32*, i32** %3
%15 = call i32 @ungetc(i8 signext %13, i32* %14)
store i32 1, i32* %2
br label %20
16: ; preds = %1
%17 = load i8, i8* %4
%18 = load i32*, i32** %3
%19 = call i32 @ungetc(i8 signext %17, i32* %18)
store i32 0, i32* %2
br label %20
20: ; preds = %16, %12
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @is_EOF(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
%5 = tail call i32 @ungetc(i8 signext %2, i32* %0)
%6 = zext i1 %4 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ k_memcpy(char *, char *, int /*<<< orphan*/);
int test_memcpy_2() {
  char src[] = {'a', 'b', 'c', 'd'};
  char dst[] = {'x', 'x', 'x', 'x'};
  k_memcpy(dst, src, 0);
  if (dst[0] != 'x' || src[0] != 'a')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<test_memcpy_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xedd(%rip),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <k_memcpy@plt>
movsbl -0xc(%rbp),%eax
cmp    $0x78,%eax
jne    1153 <test_memcpy_2+0x43>
movsbl -0x8(%rbp),%eax
cmp    $0x61,%eax
je     115f <test_memcpy_2+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1166 <test_memcpy_2+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_memcpy_2>:
push   %rax
movl   $0x64636261,0x4(%rsp)
64
movl   $0x78787878,(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <k_memcpy@plt>
mov    (%rsp),%cl
xor    $0x78,%cl
mov    0x4(%rsp),%dl
xor    $0x61,%dl
xor    %eax,%eax
or     %cl,%dl
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@__const.test_memcpy_2.src = [4 x i8] c"abcd"
@__const.test_memcpy_2.dst = [4 x i8] c"xxxx"
define i32 @test_memcpy_2() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca [4 x i8]
%4 = bitcast [4 x i8]* %2 to i8*
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%8 = call i32 @k_memcpy(i8* %6, i8* %7, i32 0)
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 120
br i1 %12, label %18, label %13
13: ; preds = %0
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 97
br i1 %17, label %18, label %19
18: ; preds = %13, %0
store i32 1, i32* %1
br label %20
19: ; preds = %13
store i32 0, i32* %1
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @test_memcpy_2() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1684234849, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 2021161080, i32* %2
%5 = call i32 @k_memcpy(i8* %4, i8* %3, i32 0)
%6 = load i8, i8* %4
%7 = icmp ne i8 %6, 120
%8 = load i8, i8* %3
%9 = icmp ne i8 %8, 97
%10 = select i1 %7, i1 true, i1 %9
%11 = zext i1 %10 to i32
ret i32 %11
}
void ipush_bad(char *name, int type, void *arg) {
  printf("ipush conflict detected %d:%s, arg %s\n", type, name, arg);
}


x86 assembly (clang, -O0):
<ipush_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipush_bad>:
mov    %rdx,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"ipush conflict detected %d:%s, arg %s\0A\00"
define void @ipush_bad(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"ipush conflict detected %d:%s, arg %s\0A\00"
define void @ipush_bad(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0, i8* %2)
ret void
}
/* Variables and functions */
unsigned long strlen(char *);
void str_appendchar(char *str, char ch) {
  unsigned long n = strlen(str);
  str[n] = ch;
  str[n + 1] = 0;
}


x86 assembly (clang, -O0):
<str_appendchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,0x1(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_appendchar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @str_appendchar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i64, i64* %5
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8 %8, i8* %11
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = add i64 %13, 1
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @str_appendchar(i8* nocapture %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %1, i8* %4
%5 = add i64 %3, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}