xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_start(void) { printf("my_start\n"); }


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

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

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

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

/* Variables and functions */
uint64_t minu64(uint64_t a, uint64_t b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<minu64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <minu64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <minu64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minu64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @minu64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
unsigned int mmio_read(int);
unsigned int timer_tick(void) { return (mmio_read(0x2000B420)); }


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

x86 assembly (clang, -O2):
<timer_tick>:
mov    $0x2000b420,%edi
jmp    1030 <mmio_read@plt>

LLVM IR (-O0):
define i32 @timer_tick() {
%1 = call i32 @mmio_read(i32 536917024)
ret i32 %1
}

LLVM IR (-O2):
define i32 @timer_tick() {
%1 = tail call i32 @mmio_read(i32 536917024)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void C67_LDW_SP_A0(int r) { C67_asm("LDW.D *+SP[A0]", r, 0, 0); }


x86 assembly (clang, -O0):
<C67_LDW_SP_A0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_LDW_SP_A0>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"LDW.D *+SP[A0]\00"
define void @C67_LDW_SP_A0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"LDW.D *+SP[A0]\00"
define void @C67_LDW_SP_A0(i32 %0) {
%2 = tail call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x12_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x12_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x12_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x12_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x12_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int getCommand(char *buf) {
  printf("> ");
  return (fgets(buf, 100, stdin) != NULL);
}


x86 assembly (clang, -O0):
<getCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCommand>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"> \00"
@stdin = global i32 0
define i32 @getCommand(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = load i32, i32* @stdin
%6 = call i32* @fgets(i8* %4, i32 100, i32 %5)
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
@stdin = global i32 0
define i32 @getCommand(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = tail call i32* @fgets(i8* %0, i32 100, i32 %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
void _swift_storeEnumTagSinglePayload(void) {}


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

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

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

LLVM IR (-O2):
define void @_swift_storeEnumTagSinglePayload() {
ret void
}
int dummy_rand() { return 123456; }


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

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

LLVM IR (-O0):
define i32 @dummy_rand() {
ret i32 123456
}

LLVM IR (-O2):
define i32 @dummy_rand() {
ret i32 123456
}
/* Variables and functions */
int getbits(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("input: 8,4,2 -> output: %d\n", getbits(8, 4, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
mov    $0x4,%esi
mov    $0x2,%edx
call   1040 <getbits@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"input: 8,4,2 -> output: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @getbits(i32 8, i32 4, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int check2dsurface(int *, double *, int *, int *, int, int, int /*<<< orphan*/);
int check_surface_topology_fix_(int *pnV, double *vertex, int *pnF, int *face) {
  return check2dsurface(pnV, vertex, pnF, face, 1, 1, 0);
}


x86 assembly (clang, -O0):
<check_surface_topology_fix_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r9d
xor    %eax,%eax
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <check2dsurface@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_surface_topology_fix_>:
push   %rax
movl   $0x0,(%rsp)
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <check2dsurface@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_surface_topology_fix_(i32* %0, double* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store double* %1, double** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load double*, double** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 @check2dsurface(i32* %9, double* %10, i32* %11, i32* %12, i32 1, i32 1, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @check_surface_topology_fix_(i32* %0, double* %1, i32* %2, i32* %3) {
%5 = tail call i32 @check2dsurface(i32* %0, double* %1, i32* %2, i32* %3, i32 1, i32 1, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMBIC;
int /*<<< orphan*/ TIOCMBIS;
int /*<<< orphan*/ TIOCM_DTR;
int /*<<< orphan*/ modem_ioctl(int /*<<< orphan*/, int /*<<< orphan*/);
void tty_dtr(int on) { modem_ioctl(on ? TIOCMBIS : TIOCMBIC, TIOCM_DTR); }


x86 assembly (clang, -O0):
<tty_dtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <tty_dtr+0x26>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <tty_dtr+0x32>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1030 <modem_ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_dtr>:
test   %edi,%edi
jne    111d <tty_dtr+0xd>
mov    0x2eb5(%rip),%rax
jmp    1124 <tty_dtr+0x14>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <modem_ioctl@plt>

LLVM IR (-O0):
@TIOCMBIS = global i32 0
@TIOCMBIC = global i32 0
@TIOCM_DTR = global i32 0
define void @tty_dtr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @TIOCMBIS
br label %9
7: ; preds = %1
%8 = load i32, i32* @TIOCMBIC
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = load i32, i32* @TIOCM_DTR
%12 = call i32 @modem_ioctl(i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@TIOCMBIS = global i32 0
@TIOCMBIC = global i32 0
@TIOCM_DTR = global i32 0
define void @tty_dtr(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @TIOCMBIS
%4 = load i32, i32* @TIOCMBIC
%5 = select i1 %2, i32 %4, i32 %3
%6 = load i32, i32* @TIOCM_DTR
%7 = tail call i32 @modem_ioctl(i32 %5, i32 %6)
ret void
}
int test_imm_DBint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xDB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DBint64_highword_mem>:
testb  $0xdb,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DBint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 940597837824
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void wifi_rsp_hardware_change_notification_pullup(
    const struct wifi_msg_hardware_change_notification_pullup_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_hardware_change_notification_pullup_rsp_t = type opaque
define void @wifi_rsp_hardware_change_notification_pullup(%struct.wifi_msg_hardware_change_notification_pullup_rsp_t* nocapture %0) {
ret void
}
void RTTcpServerDisconnectClient(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpServerDisconnectClient() {
ret void
}
void g_string_prepend_len() {}


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

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

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

LLVM IR (-O2):
define void @g_string_prepend_len() {
ret void
}
/* Variables and functions */
int findTrailingZeros(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  scanf("%d", &n);
  printf("%d", findTrailingZeros(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <findTrailingZeros@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <findTrailingZeros@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @findTrailingZeros(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int odd(register int i) { return (i & 1); }


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

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

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

LLVM IR (-O2):
define i32 @odd(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
MPID_Win_free(win) {}


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

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

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

LLVM IR (-O2):
define i32 @MPID_Win_free(i32 %0) {
ret i32 undef
}
int P(int *s) {
  int res = (*s);
  if (res > 0) {
    (*s)--;
  }
  return res;
}


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1126 <P+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
mov    (%rdi),%eax
test   %eax,%eax
jle    110b <P+0xb>
lea    -0x1(%rax),%ecx
mov    %ecx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @P(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i32 %2, -1
store i32 %5, i32* %0
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void menu2(int value) { printf("menu2: entry = %d\n", value); }


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

x86 assembly (clang, -O2):
<menu2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"menu2: entry = %d\0A\00"
define void @menu2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
OP(fd, f7) {
  illegal_1();
  op_f7();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f7@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_f7()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f7()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ endSPI(int);
int /*<<< orphan*/ startSPI(int);
int /*<<< orphan*/ writeSPI(int, int);
void setWRMR() {
  startSPI(1);
  writeSPI(0x00000001, 8);
  writeSPI(0x40, 8);
  endSPI(1);
}


x86 assembly (clang, -O0):
<setWRMR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <startSPI@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   1030 <writeSPI@plt>
mov    $0x40,%edi
mov    $0x8,%esi
call   1030 <writeSPI@plt>
mov    $0x1,%edi
call   1050 <endSPI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setWRMR>:
push   %rax
mov    $0x1,%edi
call   1040 <startSPI@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   1030 <writeSPI@plt>
mov    $0x40,%edi
mov    $0x8,%esi
call   1030 <writeSPI@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <endSPI@plt>

LLVM IR (-O0):
define void @setWRMR() {
%1 = call i32 @startSPI(i32 1)
%2 = call i32 @writeSPI(i32 1, i32 8)
%3 = call i32 @writeSPI(i32 64, i32 8)
%4 = call i32 @endSPI(i32 1)
ret void
}

LLVM IR (-O2):
define void @setWRMR() {
%1 = tail call i32 @startSPI(i32 1)
%2 = tail call i32 @writeSPI(i32 1, i32 8)
%3 = tail call i32 @writeSPI(i32 64, i32 8)
%4 = tail call i32 @endSPI(i32 1)
ret void
}
void dummy_solaris_fix(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dummy_solaris_fix() {
ret void
}
/* Variables and functions */
void test5b() {
  int abort();
  float *malloc();
  int *calloc();
}


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

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

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

LLVM IR (-O2):
define void @test5b() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 3, b = 9, c;
  c = (((a) < (b)) ? (a) : (b));
  printf("c:%i\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1144 <main+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114a <main+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"c:%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test(char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  char *filename = NULL;
  if (argc < 1) {
    usage(argv[0]);
    return 0;
  }
  filename = argv[1];
  printf("Working with file %s\n", filename);
  test(filename);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1170 <main+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1195 <main+0x65>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <test@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
test   %edi,%edi
jle    1152 <main+0x22>
mov    0x8(%rsi),%rbx
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <test@plt>
jmp    115a <main+0x2a>
mov    (%rsi),%rdi
call   1040 <usage@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Working with file %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @usage(i8* %12)
store i32 0, i32* %3
br label %22
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
store i8* %17, i8** %6
%18 = load i8*, i8** %6
%19 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %6
%21 = call i32 @test(i8* %20)
br label %22
22: ; preds = %14, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [22 x i8] c"Working with file %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i32 @test(i8* %9)
br label %12
12: ; preds = %7, %4
ret i32 0
}
void tidy_utmp() {}


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

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

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

LLVM IR (-O2):
define void @tidy_utmp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_alphabet_table();
int /*<<< orphan*/ build_unicode_to_latin1_table();
int /*<<< orphan*/ build_unicode_to_zscii_tables();
int /*<<< orphan*/ build_zscii_to_character_graphics_table();
int /*<<< orphan*/ build_zscii_to_unicode_table();
void setup_tables(void) {
  build_zscii_to_unicode_table();
  build_unicode_to_zscii_tables();
  build_unicode_to_latin1_table();
  build_zscii_to_character_graphics_table();
  build_alphabet_table();
}


x86 assembly (clang, -O0):
<setup_tables>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <build_zscii_to_unicode_table@plt>
mov    $0x0,%al
call   1030 <build_unicode_to_zscii_tables@plt>
mov    $0x0,%al
call   1060 <build_unicode_to_latin1_table@plt>
mov    $0x0,%al
call   1040 <build_zscii_to_character_graphics_table@plt>
mov    $0x0,%al
call   1050 <build_alphabet_table@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_tables>:
push   %rax
xor    %eax,%eax
call   1070 <build_zscii_to_unicode_table@plt>
xor    %eax,%eax
call   1030 <build_unicode_to_zscii_tables@plt>
xor    %eax,%eax
call   1060 <build_unicode_to_latin1_table@plt>
xor    %eax,%eax
call   1040 <build_zscii_to_character_graphics_table@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <build_alphabet_table@plt>

LLVM IR (-O0):
define void @setup_tables() {
%1 = call i32 (...) @build_zscii_to_unicode_table()
%2 = call i32 (...) @build_unicode_to_zscii_tables()
%3 = call i32 (...) @build_unicode_to_latin1_table()
%4 = call i32 (...) @build_zscii_to_character_graphics_table()
%5 = call i32 (...) @build_alphabet_table()
ret void
}

LLVM IR (-O2):
define void @setup_tables() {
%1 = tail call i32 (...) @build_zscii_to_unicode_table()
%2 = tail call i32 (...) @build_unicode_to_zscii_tables()
%3 = tail call i32 (...) @build_unicode_to_latin1_table()
%4 = tail call i32 (...) @build_zscii_to_character_graphics_table()
%5 = tail call i32 (...) @build_alphabet_table()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xapps_initialize();
void xpacket_initialize() { xapps_initialize(); }


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

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

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

LLVM IR (-O2):
define void @xpacket_initialize() {
%1 = tail call i32 (...) @xapps_initialize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int socket_set_blocking(int fd) {
  int flags = fcntl(fd, F_GETFL);
  return fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
}


x86 assembly (clang, -O0):
<socket_set_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_set_blocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%edx
not    %edx
and    %eax,%edx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @socket_set_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = call i32 (i32, i32, ...) @fcntl(i32 %7, i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @socket_set_blocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
%8 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %4, i32 %7)
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t i2bcd(uint8_t i) { return ((i / 10) << 4) | (i % 10); }


x86 assembly (clang, -O0):
<i2bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
or     %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2bcd>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @i2bcd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = shl i32 %4, 4
%6 = load i32, i32* %2
%7 = srem i32 %6, 10
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @i2bcd(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = shl i32 %2, 4
%4 = srem i32 %0, 10
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int RAND_MAX;
int rand();
int getRandomInteger(int min, int max) {
  return min + rand() / (RAND_MAX / (max - min + 1) + 1);
}


x86 assembly (clang, -O0):
<getRandomInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomInteger>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
mov    %eax,%esi
add    $0x1,%esi
mov    %ecx,%eax
cltd
idiv   %esi
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @getRandomInteger(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 (...) @rand()
%7 = load i32, i32* @RAND_MAX
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = sdiv i32 %7, %11
%13 = add nsw i32 %12, 1
%14 = sdiv i32 %6, %13
%15 = add nsw i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @getRandomInteger(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = sdiv i32 %4, %6
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %3, %8
%10 = add nsw i32 %9, %0
ret i32 %10
}
/* Type definitions */
struct fd_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fd_node *);
void fd_free(struct fd_node *node) {
  if (node) {
    free(node);
    node = NULL;
  }
}


x86 assembly (clang, -O0):
<fd_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <fd_free+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_free>:
test   %rdi,%rdi
je     111a <fd_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.fd_node = type { i32 }
define void @fd_free(%struct.fd_node* %0) {
%2 = alloca %struct.fd_node*
store %struct.fd_node* %0, %struct.fd_node** %2
%3 = load %struct.fd_node*, %struct.fd_node** %2
%4 = icmp ne %struct.fd_node* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.fd_node*, %struct.fd_node** %2
%7 = call i32 @free(%struct.fd_node* %6)
store %struct.fd_node* null, %struct.fd_node** %2
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.fd_node = type { i32 }
define void @fd_free(%struct.fd_node* %0) {
%2 = icmp eq %struct.fd_node* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.fd_node* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ write(int, void const *, size_t);
void write_no_check(int fd, const void *data, size_t size) {
  if (write(fd, data, size) < 0) {
  }
}


x86 assembly (clang, -O0):
<write_no_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1142 <write_no_check+0x32>
jmp    1142 <write_no_check+0x32>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_no_check>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_no_check(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
ret void
}
float sum_float(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<sum_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_float>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @sum_float(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
int f2(int a) { return a == 33 || a == 18; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <f2+0x20>
cmpl   $0x12,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
cmp    $0x21,%edi
sete   %al
cmp    $0x12,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 33
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 18
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = icmp eq i32 %0, 33
%3 = icmp eq i32 %0, 18
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_hotlist_resort();
void config_change_hotlist_sort(void *data, struct t_config_option *option) {
  (void)data;
  (void)option;
  gui_hotlist_resort();
}


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

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

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

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_change_hotlist_sort(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1) {
%3 = tail call i32 (...) @gui_hotlist_resort()
ret void
}
double ls_cost_nm10_twice(double x) { return x + x; }


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

x86 assembly (clang, -O2):
<ls_cost_nm10_twice>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @ls_cost_nm10_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void bar(void) {
  int32_t result;
  const int32_t other = 7;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar() {
%1 = alloca i32
%2 = alloca i32
store i32 7, i32* %2
ret void
}

LLVM IR (-O2):
define void @bar() {
ret void
}
double qbe(double x) { return x * x * x; }


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

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

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

LLVM IR (-O2):
define double @qbe(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
void core_stop(struct context *ctx) {}


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

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

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

LLVM IR (-O2):
%struct.context = type opaque
define void @core_stop(%struct.context* nocapture %0) {
ret void
}
void g_date_get_sunday_week_of_year() {}


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

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

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

LLVM IR (-O2):
define void @g_date_get_sunday_week_of_year() {
ret void
}
int _fstat(int file, struct stat *st) { return -1; }


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @_fstat(i32 %0, %struct.stat* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t read_FP_BE(int /*<<< orphan*/ *, float *, int);
size_t float32ReadFromFP(FILE *fp, float *data) {
  return read_FP_BE(fp, data, sizeof(float));
}


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

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

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

LLVM IR (-O2):
define i64 @float32ReadFromFP(i32* %0, float* %1) {
%3 = tail call i64 @read_FP_BE(i32* %0, float* %1, i32 4)
ret i64 %3
}
void init_idct() {}


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

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

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

LLVM IR (-O2):
define void @init_idct() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
void localArrayTest() {
  char *p = (char *)malloc(12);
  char *ArrayL[12];
  ArrayL[0] = p;
}


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

x86 assembly (clang, -O2):
<localArrayTest>:
mov    $0xc,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @localArrayTest() {
%1 = alloca i8*
%2 = alloca [12 x i8*]
%3 = call i64 @malloc(i32 12)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = getelementptr inbounds [12 x i8*], [12 x i8*]* %2, i64 0, i64 0
store i8* %5, i8** %6
ret void
}

LLVM IR (-O2):
define void @localArrayTest() {
%1 = tail call i64 @malloc(i32 12)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vwscanf(int /*<<< orphan*/ const *, int /*<<< orphan*/);
int __isoc99_vwscanf(const wchar_t *restrict format, va_list args) {
  return vwscanf(format, args);
}


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

x86 assembly (clang, -O2):
<__isoc99_vwscanf>:
jmp    1030 <vwscanf@plt>

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

LLVM IR (-O2):
define i32 @__isoc99_vwscanf(i32* noalias %0, i32 %1) {
%3 = tail call i32 @vwscanf(i32* %0, i32 %1)
ret i32 %3
}
void Tcl_Free(ptr) char *ptr;
{ free(ptr); }


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

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

LLVM IR (-O0):
define void @Tcl_Free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @Tcl_Free(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
void INT_Excep_MTU0_TGIB0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU0_TGIB0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cc32xx_binary_file_read(char *, char **, size_t *, int *);
void ext_configuration_read(char **buffer, size_t *buffer_size,
                            bool *needs_deallocation) {
  cc32xx_binary_file_read("kaa_configuration.bin", buffer, buffer_size,
                          needs_deallocation);
}


x86 assembly (clang, -O0):
<ext_configuration_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdi
call   1030 <cc32xx_binary_file_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_configuration_read>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <cc32xx_binary_file_read@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_read(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @cc32xx_binary_file_read(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %0, i64* %1, i32* %2)
ret void
}