xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help() {
  puts("follow this:\n"
       "./code HOST PORT Number_Packets TYPE Threads\n"
       " 0 - XMAS with Spoofing\n"
       " 1 - SYN+ACK with Spoofing\n"
       " 2 - SYN+ACK with Mirror Spoofing\n"
       " 3 - FIN+ACK with Spoofing\n"
       " 4 - FIN+ACK with Mirror Spoofing\n"
       " 5 - URG+ACK with Spoofing\n"
       " 6 - URG+ACK With Mirror Spoofing\n"
       " 7 - PSH+ACK With Spoofing\n"
       " 8 - XMAS with Mirror Spoofing\n"
       "ex: ./code www.server.com 80 20000 4 50\n"
       "..::hyde:NetWork:FlowTest::.. \n"
       "Coded by Cooler_ c00f3r[at]gmail[dot]com\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [436 x i8] c"follow this:\0A./code HOST PORT Number_Packets TYPE Threads\0A 0 - XMAS with Spoofing\0A 1 - SYN+ACK with Spoofing\0A 2 - SYN+ACK with Mirror Spoofing\0A 3 - FIN+ACK with Spoofing\0A 4 - FIN+ACK with Mirror Spoofing\0A 5 - URG+ACK with Spoofing\0A 6 - URG+ACK With Mirror Spoofing\0A 7 - PSH+ACK With Spoofing\0A 8 - XMAS with Mirror Spoofing\0Aex: ./code www.server.com 80 20000 4 50\0A..::hyde:NetWork:FlowTest::.. \0ACoded by Cooler_ c00f3r[at]gmail[dot]com\0A\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([436 x i8], [436 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [436 x i8] c"follow this:\0A./code HOST PORT Number_Packets TYPE Threads\0A 0 - XMAS with Spoofing\0A 1 - SYN+ACK with Spoofing\0A 2 - SYN+ACK with Mirror Spoofing\0A 3 - FIN+ACK with Spoofing\0A 4 - FIN+ACK with Mirror Spoofing\0A 5 - URG+ACK with Spoofing\0A 6 - URG+ACK With Mirror Spoofing\0A 7 - PSH+ACK With Spoofing\0A 8 - XMAS with Mirror Spoofing\0Aex: ./code www.server.com 80 20000 4 50\0A..::hyde:NetWork:FlowTest::.. \0ACoded by Cooler_ c00f3r[at]gmail[dot]com\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([436 x i8], [436 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct bridge_info {
  int dummy;
};

/* Variables and functions */
int old_get_bridge_info(char const *, struct bridge_info *);
int br_get_bridge_info(const char *bridge, struct bridge_info *info) {
  return old_get_bridge_info(bridge, info);
}


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

x86 assembly (clang, -O2):
<br_get_bridge_info>:
jmp    1030 <old_get_bridge_info@plt>

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

LLVM IR (-O2):
%struct.bridge_info = type { i32 }
define i32 @br_get_bridge_info(i8* %0, %struct.bridge_info* %1) {
%3 = tail call i32 @old_get_bridge_info(i8* %0, %struct.bridge_info* %1)
ret i32 %3
}
void pointer_arith_bad() {
  char arr[10];
  int x = 0;
  if (&x - 1 == 0)
    arr[10] = 1;
}


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

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

LLVM IR (-O0):
define void @pointer_arith_bad() {
%1 = alloca [10 x i8]
%2 = alloca i32
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
define void @pointer_arith_bad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(unsigned char);
void testBadPromotion(void) {
  unsigned char loc_c;
  unsigned char c = *(unsigned char *)&loc_c;
  func(c);
  c += '0';
  func(c);
  c += 'A' - '0';
  func(c);
}


x86 assembly (clang, -O0):
<testBadPromotion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <func@plt>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <func@plt>
movzbl -0x2(%rbp),%eax
add    $0x11,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBadPromotion>:
push   %rax
xor    %edi,%edi
call   1030 <func@plt>
mov    $0x30,%edi
call   1030 <func@plt>
mov    $0x41,%edi
pop    %rax
jmp    1030 <func@plt>

LLVM IR (-O0):
define void @testBadPromotion() {
%1 = alloca i8
%2 = alloca i8
%3 = load i8, i8* %1
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @func(i8 zeroext %4)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = add nsw i32 %7, 48
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
%10 = load i8, i8* %2
%11 = call i32 @func(i8 zeroext %10)
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, 17
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
%16 = load i8, i8* %2
%17 = call i32 @func(i8 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @testBadPromotion() {
%1 = tail call i32 @func(i8 zeroext undef)
%2 = tail call i32 @func(i8 zeroext 48)
%3 = tail call i32 @func(i8 zeroext 65)
ret void
}
int inPlane(double test, double divider, int direction) {
  if (direction)
    return test >= divider;
  else
    return test <= divider;
}


x86 assembly (clang, -O0):
<inPlane>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1135 <inPlane+0x35>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    114e <inPlane+0x4e>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inPlane>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setae  %cl
test   %edi,%edi
cmove  %ecx,%eax
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @inPlane(double %0, double %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = fcmp oge double %0, %1
%6 = fcmp ole double %0, %1
%7 = select i1 %4, i1 %6, i1 %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ message;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ panic(char *);
int /*<<< orphan*/ set_sigs_intern(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void bailout(int sig) {
  char message[1024];
  set_sigs_intern(1);
  snprintf(message, sizeof(message), "BAILOUT: caught signal %d", sig);
  panic(message);
  exit(7);
}


x86 assembly (clang, -O0):
<bailout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <set_sigs_intern@plt>
lea    -0x410(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x400,%esi
lea    0xe92(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <panic@plt>
mov    $0x7,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<bailout>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %edi,%ebx
mov    $0x1,%edi
call   1060 <set_sigs_intern@plt>
lea    0xea3(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
mov    %ebx,%ecx
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1040 <panic@plt>
mov    $0x7,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"BAILOUT: caught signal %d\00"
define void @bailout(i32 %0) {
%2 = alloca i32
%3 = alloca [1024 x i8]
store i32 %0, i32* %2
%4 = call i32 @set_sigs_intern(i32 1)
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 1024, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i32 @panic(i8* %8)
%10 = call i32 @exit(i32 7)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"BAILOUT: caught signal %d\00"
define void @bailout(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @set_sigs_intern(i32 1)
%5 = call i32 @snprintf(i8* %3, i32 1024, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 @panic(i8* %3)
%7 = call i32 @exit(i32 7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_stats();
int /*<<< orphan*/ stderr;
void sig_handler(int x) {
  fprintf(stderr, "caught SIGINT, exiting ...\n");
  print_stats();
  exit(1);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <print_stats@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <print_stats@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"caught SIGINT, exiting ...\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @print_stats()
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"caught SIGINT, exiting ...\0A\00"
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @print_stats()
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ console_printf(char *, unsigned long);
void vmem_segfault_handler(void *ip) {
  console_printf("segmentation fault: ip=%x.\n", (unsigned long)ip);
}


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

x86 assembly (clang, -O2):
<vmem_segfault_handler>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <console_printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"segmentation fault: ip=%x.\0A\00"
define void @vmem_segfault_handler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 @console_printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %4)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"segmentation fault: ip=%x.\0A\00"
define void @vmem_segfault_handler(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @console_printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int major_code;
};
typedef TYPE_1__ XGraphicsExposeEvent;

/* Variables and functions */
void set_XGraphicsExposeEvent_major_code(void *_p, int _v) {
  ((XGraphicsExposeEvent *)_p)->major_code = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGraphicsExposeEvent_major_code(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGraphicsExposeEvent_major_code(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int wait4() {}


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

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

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

LLVM IR (-O2):
define i32 @wait4() {
ret i32 undef
}
void CFGMR3QueryPort(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryPort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Slcd_Chr_Cp(int /*<<< orphan*/);
void Slcd_Out_Cp(char *text) {
  while ((text != 0) && (*text != 0)) {
    Slcd_Chr_Cp(*text++);
  }
}


x86 assembly (clang, -O0):
<Slcd_Out_Cp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113c <Slcd_Out_Cp+0x2c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114c <Slcd_Out_Cp+0x3c>
jmp    1168 <Slcd_Out_Cp+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <Slcd_Chr_Cp@plt>
jmp    111c <Slcd_Out_Cp+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Slcd_Out_Cp>:
push   %rbx
test   %rdi,%rdi
je     1143 <Slcd_Out_Cp+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <Slcd_Out_Cp+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <Slcd_Chr_Cp@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <Slcd_Out_Cp+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Slcd_Out_Cp(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = sext i8 %7 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = tail call i32 @Slcd_Chr_Cp(i32 %9)
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t write_FP_BE(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int);
size_t int16WriteToFP(FILE *fp, const int16_t *data) {
  return write_FP_BE(fp, data, sizeof(int16_t));
}


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

x86 assembly (clang, -O2):
<int16WriteToFP>:
mov    $0x4,%edx
jmp    1030 <write_FP_BE@plt>

LLVM IR (-O0):
define i64 @int16WriteToFP(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 i64 @write_FP_BE(i32* %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @int16WriteToFP(i32* %0, i32* %1) {
%3 = tail call i64 @write_FP_BE(i32* %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr,
          "Usage: n64cksum ROM [ROM_OUT]\n"
          "\n"
          "n64cksum v"
          "0.1"
          ": N64 ROM checksum calculator\n"
          "\n"
          "File arguments:\n"
          " ROM          input ROM file\n"
          " ROM_OUT      output ROM file (default: overwrites input ROM)\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [183 x i8] c"Usage: n64cksum ROM [ROM_OUT]\0A\0An64cksum v0.1: N64 ROM checksum calculator\0A\0AFile arguments:\0A ROM input ROM file\0A ROM_OUT output ROM file (default: overwrites input ROM)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [183 x i8] c"Usage: n64cksum ROM [ROM_OUT]\0A\0An64cksum v0.1: N64 ROM checksum calculator\0A\0AFile arguments:\0A ROM input ROM file\0A ROM_OUT output ROM file (default: overwrites input ROM)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ writeide(int, int /*<<< orphan*/, int /*<<< orphan*/);
void ide_write_qua(uint16_t addr, uint8_t val, void *priv) {
  writeide(3, addr, val);
}


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

x86 assembly (clang, -O2):
<ide_write_qua>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <writeide@plt>

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

LLVM IR (-O2):
define void @ide_write_qua(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @writeide(i32 3, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ h();
int /*<<< orphan*/ h1();
int main() {
  f();
  h();
  h1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @h()
%3 = tail call i32 (...) @h1()
ret i32 0
}
/* Variables and functions */
int f3(int *);
int f4(int *p) { return f3(p); }


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

x86 assembly (clang, -O2):
<f4>:
jmp    1030 <f3@plt>

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

LLVM IR (-O2):
define i32 @f4(i32* %0) {
%2 = tail call i32 @f3(i32* %0)
ret i32 %2
}
int ILibWrapper_WebRTC_Connection_DataChannelBucketizer(int index) {
  return (index & (16 - 1));
}


x86 assembly (clang, -O0):
<ILibWrapper_WebRTC_Connection_DataChannelBucketizer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibWrapper_WebRTC_Connection_DataChannelBucketizer>:
mov    %edi,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @ILibWrapper_WebRTC_Connection_DataChannelBucketizer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
ret i32 %4
}

LLVM IR (-O2):
define i32 @ILibWrapper_WebRTC_Connection_DataChannelBucketizer(i32 %0) {
%2 = and i32 %0, 15
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
scalar_t__ listen(int, int);
void listen_socket(int sockfd) {
  if (listen(sockfd, 5) < 0) {
    error("Listen error");
  }
}


x86 assembly (clang, -O0):
<listen_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1030 <listen@plt>
cmp    $0x0,%rax
jge    114e <listen_socket+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listen_socket>:
push   %rax
mov    $0x5,%esi
call   1030 <listen@plt>
test   %rax,%rax
js     1132 <listen_socket+0x12>
pop    %rax
ret
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Listen error\00"
define void @listen_socket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @listen(i32 %3, i32 5)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Listen error\00"
define void @listen_socket(i32 %0) {
%2 = tail call i64 @listen(i32 %0, i32 5)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct filter {
  int dummy;
};

/* Variables and functions */
struct filter *filter_list_first();
struct filter *filter_list_next(struct filter *);
int /*<<< orphan*/ filter_parse_filter_rules(struct filter *);
void filter_parse_all_filters(void) {
  struct filter *f = filter_list_first();
  while (f) {
    filter_parse_filter_rules(f);
    f = filter_list_next(f);
  }
}


x86 assembly (clang, -O0):
<filter_parse_all_filters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <filter_list_first@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <filter_parse_all_filters+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <filter_parse_filter_rules@plt>
mov    -0x8(%rbp),%rdi
call   1050 <filter_list_next@plt>
mov    %rax,-0x8(%rbp)
jmp    1143 <filter_parse_all_filters+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_parse_all_filters>:
push   %rbx
xor    %eax,%eax
call   1040 <filter_list_first@plt>
test   %rax,%rax
je     1158 <filter_parse_all_filters+0x28>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1030 <filter_parse_filter_rules@plt>
mov    %rbx,%rdi
call   1050 <filter_list_next@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <filter_parse_all_filters+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.filter = type { i32 }
define void @filter_parse_all_filters() {
%1 = alloca %struct.filter*
%2 = call %struct.filter* (...) @filter_list_first()
store %struct.filter* %2, %struct.filter** %1
br label %3
3: ; preds = %6, %0
%4 = load %struct.filter*, %struct.filter** %1
%5 = icmp ne %struct.filter* %4, null
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load %struct.filter*, %struct.filter** %1
%8 = call i32 @filter_parse_filter_rules(%struct.filter* %7)
%9 = load %struct.filter*, %struct.filter** %1
%10 = call %struct.filter* @filter_list_next(%struct.filter* %9)
store %struct.filter* %10, %struct.filter** %1
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.filter = type { i32 }
define void @filter_parse_all_filters() {
%1 = tail call %struct.filter* (...) @filter_list_first()
%2 = icmp eq %struct.filter* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi %struct.filter* [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @filter_parse_filter_rules(%struct.filter* %4)
%6 = tail call %struct.filter* @filter_list_next(%struct.filter* %4)
%7 = icmp eq %struct.filter* %6, null
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_error(char *);
scalar_t__ send(int, void *, int, int /*<<< orphan*/);
void checked_send(int s, void *buffer, int length) {
  if (send(s, buffer, length, 0) < 0) {
    handle_error("Could not write bytes");
  }
}


x86 assembly (clang, -O0):
<checked_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0x0,%rax
jge    1159 <checked_send+0x39>
lea    0xeac(%rip),%rdi
call   1040 <handle_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_send>:
push   %rax
xor    %ecx,%ecx
call   1030 <send@plt>
test   %rax,%rax
js     112f <checked_send+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1040 <handle_error@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Could not write bytes\00"
define void @checked_send(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i64 @send(i32 %7, i8* %8, i32 %9, i32 0)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @handle_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Could not write bytes\00"
define void @checked_send(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @handle_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int ci_send_menu_answer(int, int, int /*<<< orphan*/);
int ci_menu_select(int fd, int slot, uint8_t sl) {
  return ci_send_menu_answer(fd, slot, sl);
}


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

x86 assembly (clang, -O2):
<ci_menu_select>:
jmp    1030 <ci_send_menu_answer@plt>

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

LLVM IR (-O2):
define i32 @ci_menu_select(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @ci_send_menu_answer(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
int intcompare(const void *a, const void *b) {
  return (*((const int *)a) - *((const int *)b));
}


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

x86 assembly (clang, -O2):
<intcompare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intcompare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intcompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t multiply_subtract_32x32_rshift32_rounded(int32_t sum, int32_t a,
                                                 int32_t b) {}


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

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

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

LLVM IR (-O2):
define i32 @multiply_subtract_32x32_rshift32_rounded(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 10, b = 2;
  if (a = b) {
    printf("a=b\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1148 <main+0x38>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [4 x i8] c"a=b\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("hola clase\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"hola clase\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"hola clase\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t getBlue0(int32_t const rgb2) { return (rgb2 & 255); }


x86 assembly (clang, -O0):
<getBlue0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBlue0>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @getBlue0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}

LLVM IR (-O2):
define i32 @getBlue0(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
int imx6sl_cpuidle_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @imx6sl_cpuidle_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void _Assert(char *msg) {
  fputs(msg, stderr);
  fputs(" -- assertion failed\n", stderr);
  abort();
}


x86 assembly (clang, -O0):
<_Assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Assert>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0xec8(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c" -- assertion failed\0A\00"
define void @_Assert(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c" -- assertion failed\0A\00"
define void @_Assert(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @abort()
unreachable
}
int foo(int x) {
  const int y = 0;
  int r = 0;
  r += x / y;
  r += x / 0;
  r += x % y;
  r += x % 0;
  return r;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 0
%7 = load i32, i32* %4
%8 = add nsw i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 0
%11 = load i32, i32* %4
%12 = add nsw i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = srem i32 %13, 0
%15 = load i32, i32* %4
%16 = add nsw i32 %15, %14
store i32 %16, i32* %4
%17 = load i32, i32* %2
%18 = srem i32 %17, 0
%19 = load i32, i32* %4
%20 = add nsw i32 %19, %18
store i32 %20, i32* %4
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void my_recursion(int n) {
  printf("open %d\n", n);
  if (n == 0) {
    printf("\n\n");
    return;
  } else
    my_recursion(n - 1);
  printf("close %d\n", n);
}


x86 assembly (clang, -O0):
<my_recursion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1159 <my_recursion+0x39>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1175 <my_recursion+0x55>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <my_recursion@plt>
mov    -0x4(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_recursion>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
je     1160 <my_recursion+0x30>
lea    -0x1(%rbx),%edi
call   1040 <my_recursion@plt>
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>
lea    0xeaa(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"open %d\0A\00"
@.str.2 = [10 x i8] c"close %d\0A\00"
@str = [2 x i8] c"\0A\00"
define void @my_recursion(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %7
ret void
7: ; preds = %1
%8 = add nsw i32 %0, -1
tail call void @my_recursion(i32 %8)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void finish_array(void *pr_data) {
  FILE *fp = pr_data;
  fprintf(fp, "</array>\n");
}


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

x86 assembly (clang, -O2):
<finish_array>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"</array>\0A\00"
define void @finish_array(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"</array>\0A\00"
define void @finish_array(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 9, i64 1, i32* %2)
ret void
}
/* Variables and functions */
int tor_memcmp(char const *, char const *, int);
int compare_digests256_(const void **_a, const void **_b) {
  return tor_memcmp((const char *)*_a, (const char *)*_b, 32);
}


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

x86 assembly (clang, -O2):
<compare_digests256_>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    $0x20,%edx
jmp    1030 <tor_memcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_digests256_(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @tor_memcmp(i8* %3, i8* %4, i32 32)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ genrxfilt(int /*<<< orphan*/);
int /*<<< orphan*/ gentrain(int /*<<< orphan*/);
int /*<<< orphan*/ gentxfilt(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  gentrain(stdout);
  gentxfilt(stdout);
  genrxfilt(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <gentrain@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <gentxfilt@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <genrxfilt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
call   1040 <gentrain@plt>
mov    (%rbx),%edi
call   1030 <gentxfilt@plt>
mov    (%rbx),%edi
call   1050 <genrxfilt@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdout
%7 = call i32 @gentrain(i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @gentxfilt(i32 %8)
%10 = load i32, i32* @stdout
%11 = call i32 @genrxfilt(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @gentrain(i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @gentxfilt(i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @genrxfilt(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_tail_osm(void) { printf("</osm>\n"); }


x86 assembly (clang, -O0):
<print_tail_osm>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"</osm>\0A\00"
define void @print_tail_osm() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"</osm>\00"
define void @print_tail_osm() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
void kbase_js_debug_log_current_affinities(struct kbase_device *kbdev) {}


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

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

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

LLVM IR (-O2):
%struct.kbase_device = type opaque
define void @kbase_js_debug_log_current_affinities(%struct.kbase_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void shll() {
  printf("c = srcb&0x80;\n");
  printf("dst = srcb << 1;\n");
}


x86 assembly (clang, -O0):
<shll>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shll>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"c = srcb&0x80;\0A\00"
@.str.1 = [18 x i8] c"dst = srcb << 1;\0A\00"
define void @shll() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"c = srcb&0x80;\00"
@str.2 = [17 x i8] c"dst = srcb << 1;\00"
define void @shll() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BLKPBSZGET;
int /*<<< orphan*/ die_if(int, char *);
int ioctl(int, int /*<<< orphan*/, unsigned int *);
unsigned int get_physical_block_size(int fd) {
  unsigned int block_size;
  int retval;
  retval = ioctl(fd, BLKPBSZGET, &block_size);
  die_if(retval == -1, "ioctl(BLKPBSZGET)");
  return block_size;
}


x86 assembly (clang, -O0):
<get_physical_block_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeaa(%rip),%rsi
call   1030 <die_if@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_physical_block_size>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1040 <ioctl@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
lea    0xebc(%rip),%rsi
call   1030 <die_if@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@BLKPBSZGET = global i32 0
@.str = [18 x i8] c"ioctl(BLKPBSZGET)\00"
define i32 @get_physical_block_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @BLKPBSZGET
%7 = call i32 @ioctl(i32 %5, i32 %6, i32* %3)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i32
%11 = call i32 @die_if(i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@BLKPBSZGET = global i32 0
@.str = [18 x i8] c"ioctl(BLKPBSZGET)\00"
define i32 @get_physical_block_size(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @BLKPBSZGET
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
%8 = call i32 @die_if(i32 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
ret i32 %9
}
int lm_display_poll_event(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lm_display_poll_event() {
ret i32 0
}