xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ swap(char *, int, int);
void reverseString(char *s) {
  int len = strlen(s);
  int lh = 0;
  int rh = len - 1;
  while (lh < rh) {
    swap(s, lh, rh);
    lh++;
    rh--;
  }
}


x86 assembly (clang, -O0):
<reverseString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    117a <reverseString+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <swap@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1148 <reverseString+0x28>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseString>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     1159 <reverseString+0x39>
mov    %eax,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%esi
mov    %r14,%rdi
mov    %ebp,%edx
call   1040 <swap@plt>
add    $0xffffffff,%ebp
lea    0x1(%rbx),%eax
cmp    %ebp,%ebx
mov    %eax,%ebx
jl     1140 <reverseString+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @reverseString(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %3
store i32 0, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %5
br label %10
10: ; preds = %14, %1
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i8*, i8** %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @swap(i8* %15, i32 %16, i32 %17)
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
%21 = load i32, i32* %5
%22 = add nsw i32 %21, -1
store i32 %22, i32* %5
br label %10
23: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @reverseString(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = add nsw i32 %2, -1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %11, %6 ], [ %5, %4 ]
%8 = phi i32 [ %10, %6 ], [ 0, %4 ]
%9 = tail call i32 @swap(i8* %0, i32 %8, i32 %7)
%10 = add nuw nsw i32 %8, 1
%11 = add nsw i32 %7, -1
%12 = icmp slt i32 %10, %11
br i1 %12, label %6, label %13
13: ; preds = %6, %1
ret void
}
short rotateL_fun_short(short x, int i) {
  if ((i %= 16) == 0)
    return x;
  return (x << i) | ((0x7fff >> (15 - i)) & (x >> (16 - i)));
}


x86 assembly (clang, -O0):
<rotateL_fun_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmp    $0x0,%edx
jne    1132 <rotateL_fun_short+0x32>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1166 <rotateL_fun_short+0x66>
movswl -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    $0xf,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x7fff,%edx
sar    %cl,%edx
mov    %edx,-0xc(%rbp)
movswl -0x4(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    -0xc(%rbp),%ecx
and    %edx,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateL_fun_short>:
mov    %edi,%eax
lea    0xf(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xfffffff0,%ecx
sub    %ecx,%esi
je     112f <rotateL_fun_short+0x2f>
cwtl
mov    %eax,%edx
mov    %esi,%ecx
shl    %cl,%edx
mov    $0xf,%cl
sub    %sil,%cl
mov    $0x7fff,%edi
shr    %cl,%edi
mov    $0x10,%cl
sub    %sil,%cl
sar    %cl,%eax
and    %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define signext i16 @rotateL_fun_short(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 16
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i16, i16* %4
store i16 %10, i16* %3
br label %27
11: ; preds = %2
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = load i32, i32* %5
%15 = shl i32 %13, %14
%16 = load i32, i32* %5
%17 = sub nsw i32 15, %16
%18 = ashr i32 32767, %17
%19 = load i16, i16* %4
%20 = sext i16 %19 to i32
%21 = load i32, i32* %5
%22 = sub nsw i32 16, %21
%23 = ashr i32 %20, %22
%24 = and i32 %18, %23
%25 = or i32 %15, %24
%26 = trunc i32 %25 to i16
store i16 %26, i16* %3
br label %27
27: ; preds = %11, %9
%28 = load i16, i16* %3
ret i16 %28
}

LLVM IR (-O2):
define signext i16 @rotateL_fun_short(i16 signext %0, i32 %1) {
%3 = srem i32 %1, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = sext i16 %0 to i32
%7 = shl nsw i32 %6, %3
%8 = sub nsw i32 15, %3
%9 = lshr i32 32767, %8
%10 = sub nsw i32 16, %3
%11 = ashr i32 %6, %10
%12 = and i32 %9, %11
%13 = or i32 %12, %7
%14 = trunc i32 %13 to i16
br label %15
15: ; preds = %2, %5
%16 = phi i16 [ %14, %5 ], [ %0, %2 ]
ret i16 %16
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpgrp();
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
void print() {
  pid_t pid = getpid();
  pid_t grp = getpgrp();
  printf("parent %u: %u\n", pid, grp);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getpgrp@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getpgrp@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"parent %u: %u\0A\00"
define void @print() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getpgrp()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_faceids_fromfile(int /*<<< orphan*/);
void fgmvwrite_faceids_fromfile_(char filnam[]) {
  gmvwrite_faceids_fromfile(fortchartoc(filnam));
}


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_faceids_fromfile_(i8* %0) {
%2 = tail call i32 @fortchartoc(i8* %0)
%3 = tail call i32 @gmvwrite_faceids_fromfile(i32 %2)
ret void
}
void iiccF(char *x) {
  int y;
  y = x;
}


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

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

LLVM IR (-O0):
define void @iiccF(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @iiccF(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CT_POLICY_EVAL_CTX;

/* Variables and functions */
int /*<<< orphan*/ *CT_POLICY_EVAL_CTX_new_ex(int /*<<< orphan*/ *,
                                              int /*<<< orphan*/ *);
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void) {
  return CT_POLICY_EVAL_CTX_new_ex(NULL, NULL);
}


x86 assembly (clang, -O0):
<CT_POLICY_EVAL_CTX_new>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <CT_POLICY_EVAL_CTX_new_ex@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CT_POLICY_EVAL_CTX_new>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <CT_POLICY_EVAL_CTX_new_ex@plt>

LLVM IR (-O0):
define i32* @CT_POLICY_EVAL_CTX_new() {
%1 = call i32* @CT_POLICY_EVAL_CTX_new_ex(i32* null, i32* null)
ret i32* %1
}

LLVM IR (-O2):
define i32* @CT_POLICY_EVAL_CTX_new() {
%1 = tail call i32* @CT_POLICY_EVAL_CTX_new_ex(i32* null, i32* null)
ret i32* %1
}
void nseel_asm_assign_fast(void) {
  __asm__("movl (%eax), %ecx\n"
          "movl %ecx, (%edi)\n"
          "movl 4(%eax), %ecx\n"
          "movl %edi, %eax\n"
          "movl %ecx, 4(%edi)\n");
}


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

x86 assembly (clang, -O2):
<nseel_asm_assign_fast>:
mov    (%eax),%ecx
mov    %ecx,(%edi)
mov    0x4(%eax),%ecx
mov    %edi,%eax
mov    %ecx,0x4(%edi)
ret

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

LLVM IR (-O2):
define void @nseel_asm_assign_fast() {
tail call void asm sideeffect "movl (%eax), %ecx\0Amovl %ecx, (%edi)\0Amovl 4(%eax), %ecx\0Amovl %edi, %eax\0Amovl %ecx, 4(%edi)\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ overflow_general(int /*<<< orphan*/, int);
int /*<<< orphan*/ warn_overflow(int, int);
void warn_overflow_const(int64_t data, int size) {
  if (overflow_general(data, size))
    warn_overflow(0x00000040, size);
}


x86 assembly (clang, -O0):
<warn_overflow_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <overflow_general@plt>
cmp    $0x0,%rax
je     1150 <warn_overflow_const+0x30>
mov    -0x8(%rbp),%esi
mov    $0x40,%edi
call   1030 <warn_overflow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_overflow_const>:
push   %rbx
mov    %esi,%ebx
call   1040 <overflow_general@plt>
test   %rax,%rax
je     113a <warn_overflow_const+0x1a>
mov    $0x40,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <warn_overflow@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @warn_overflow_const(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 @overflow_general(i32 %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 @warn_overflow(i32 64, i32 %10)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @warn_overflow_const(i32 %0, i32 %1) {
%3 = tail call i64 @overflow_general(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @warn_overflow(i32 64, i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
struct ns_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ ns_mqtt_prepend_header(struct ns_connection *,
                                          int /*<<< orphan*/, int, int);
int /*<<< orphan*/ ns_send(struct ns_connection *, int /*<<< orphan*/ *, int);
void ns_send_mqtt_short_command(struct ns_connection *nc, uint8_t cmd,
                                uint16_t message_id) {
  uint16_t message_id_net = htons(message_id);
  ns_send(nc, &message_id_net, 2);
  ns_mqtt_prepend_header(nc, cmd, ((1) << 1), 2);
}


x86 assembly (clang, -O0):
<ns_send_mqtt_short_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x2,%edx
call   1040 <ns_send@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x2,%ecx
mov    %ecx,%edx
call   1050 <ns_mqtt_prepend_header@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_send_mqtt_short_command>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <htons@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <ns_send@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1050 <ns_mqtt_prepend_header@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.ns_connection = type { i32 }
define void @ns_send_mqtt_short_command(%struct.ns_connection* %0, i32 %1, i32 %2) {
%4 = alloca %struct.ns_connection*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.ns_connection* %0, %struct.ns_connection** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @htons(i32 %8)
store i32 %9, i32* %7
%10 = load %struct.ns_connection*, %struct.ns_connection** %4
%11 = call i32 @ns_send(%struct.ns_connection* %10, i32* %7, i32 2)
%12 = load %struct.ns_connection*, %struct.ns_connection** %4
%13 = load i32, i32* %5
%14 = call i32 @ns_mqtt_prepend_header(%struct.ns_connection* %12, i32 %13, i32 2, i32 2)
ret void
}

LLVM IR (-O2):
%struct.ns_connection = type { i32 }
define void @ns_send_mqtt_short_command(%struct.ns_connection* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @htons(i32 %2)
store i32 %6, i32* %4
%7 = call i32 @ns_send(%struct.ns_connection* %0, i32* %4, i32 2)
%8 = call i32 @ns_mqtt_prepend_header(%struct.ns_connection* %0, i32 %1, i32 2, i32 2)
ret void
}
void platform_exit_critical() {}


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

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

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

LLVM IR (-O2):
define void @platform_exit_critical() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void __attribute__((weak)) __aeabi_memset8_impl(void *dest, size_t n, int c) {
  memset(dest, c, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memset8_impl>:
mov    %rsi,%rax
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define weak void @__aeabi_memset8_impl(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 i32, i32* %6
%9 = load i64, i64* %5
%10 = call i32 @memset(i8* %7, i32 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define weak void @__aeabi_memset8_impl(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i32 %2, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRAE_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRAE_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRAE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ IntDisable(scalar_t__);
int /*<<< orphan*/ IntUnregister(scalar_t__);
scalar_t__ _HibernateIntNumberGet();
void HibernateIntUnregister(void) {
  uint32_t ui32Int;
  ui32Int = _HibernateIntNumberGet();
  ASSERT(ui32Int != 0);
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<HibernateIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <_HibernateIntNumberGet@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%rdi
call   1060 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntUnregister>:
push   %rbx
xor    %eax,%eax
call   1040 <_HibernateIntNumberGet@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <ASSERT@plt>
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <IntUnregister@plt>

LLVM IR (-O0):
define void @HibernateIntUnregister() {
%1 = alloca i64
%2 = call i64 (...) @_HibernateIntNumberGet()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i64, i64* %1
%8 = call i32 @IntDisable(i64 %7)
%9 = load i64, i64* %1
%10 = call i32 @IntUnregister(i64 %9)
ret void
}

LLVM IR (-O2):
define void @HibernateIntUnregister() {
%1 = tail call i64 (...) @_HibernateIntNumberGet()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = tail call i32 @IntDisable(i64 %1)
%6 = tail call i32 @IntUnregister(i64 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t wt_mark(uint32_t v, uint32_t h, uint32_t bit) {
  return v | (1 << (h - bit - 1));
}


x86 assembly (clang, -O0):
<wt_mark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wt_mark>:
mov    %edi,%eax
not    %edx
add    %esi,%edx
bts    %edx,%eax
ret

LLVM IR (-O0):
define i32 @wt_mark(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 = sub nsw i32 %8, %9
%11 = sub nsw i32 %10, 1
%12 = shl i32 1, %11
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @wt_mark(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = add i32 %4, %1
%6 = shl nuw i32 1, %5
%7 = or i32 %6, %0
ret i32 %7
}
int readTCPPacket(char *buf, int nbuf) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @readTCPPacket(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
long long int segfault(long long int a, long long int b) { return a ^ b; }


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

x86 assembly (clang, -O2):
<segfault>:
mov    %rdi,%rax
xor    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @segfault(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 = xor i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @segfault(i64 %0, i64 %1) {
%3 = xor i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *safe_malloc(size_t n) {
  if (n == 0) {
    return NULL;
  }
  void *ptr = malloc(n);
  if (ptr == NULL) {
    perror("Memory allocation failed");
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <safe_malloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1187 <safe_malloc+0x57>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <safe_malloc+0x4f>
lea    0xe8d(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rax
test   %rdi,%rdi
je     1142 <safe_malloc+0x12>
call   1040 <malloc@plt>
test   %rax,%rax
je     1146 <safe_malloc+0x16>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb3(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Memory allocation failed\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %18
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %8
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %16, %7
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [25 x i8] c"Memory allocation failed\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ doupdate();
int /*<<< orphan*/ update_panels();
void view_update() {
  update_panels();
  doupdate();
}


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

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

LLVM IR (-O0):
define void @view_update() {
%1 = call i32 (...) @update_panels()
%2 = call i32 (...) @doupdate()
ret void
}

LLVM IR (-O2):
define void @view_update() {
%1 = tail call i32 (...) @update_panels()
%2 = tail call i32 (...) @doupdate()
ret void
}
/* Variables and functions */
int cio_read(int);
int /*<<< orphan*/ cio_skip(int);
void j2k_read_plt() {
  int len;
  len = cio_read(2);

  cio_skip(len - 2);
}


x86 assembly (clang, -O0):
<j2k_read_plt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <cio_read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <cio_skip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j2k_read_plt>:
push   %rax
mov    $0x2,%edi
call   1040 <cio_read@plt>
lea    -0x2(%rax),%edi
pop    %rax
jmp    1030 <cio_skip@plt>

LLVM IR (-O0):
define void @j2k_read_plt() {
%1 = alloca i32
%2 = call i32 @cio_read(i32 2)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sub nsw i32 %3, 2
%5 = call i32 @cio_skip(i32 %4)
ret void
}

LLVM IR (-O2):
define void @j2k_read_plt() {
%1 = tail call i32 @cio_read(i32 2)
%2 = add nsw i32 %1, -2
%3 = tail call i32 @cio_skip(i32 %2)
ret void
}
int ffs(unsigned int mask) {
  int i;
  if (!mask)
    return 0;
  i = 1;
  while (!(mask & 1)) {
    i++;
    mask = mask >> 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ffs+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    115c <ffs+0x5c>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113f <ffs+0x3f>
jmp    1156 <ffs+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ffs+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112e <ffs+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <ffs+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %21
8: ; preds = %1
store i32 1, i32* %4
br label %9
9: ; preds = %14, %8
%10 = load i32, i32* %3
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = lshr i32 %17, 1
store i32 %18, i32* %3
br label %9
19: ; preds = %9
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 1, %3 ]
%8 = phi i32 [ %10, %6 ], [ %0, %3 ]
%9 = add nuw nsw i32 %7, 1
%10 = lshr i32 %8, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ silc_free(void *);
int /*<<< orphan*/ silc_hash_table_free(void *);
void silc_mime_assembler_dest(void *key, void *context, void *user_context) {
  silc_free(key);
  silc_hash_table_free(context);
}


x86 assembly (clang, -O0):
<silc_mime_assembler_dest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <silc_free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <silc_hash_table_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silc_mime_assembler_dest>:
push   %rbx
mov    %rsi,%rbx
call   1040 <silc_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <silc_hash_table_free@plt>

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

LLVM IR (-O2):
define void @silc_mime_assembler_dest(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @silc_free(i8* %0)
%5 = tail call i32 @silc_hash_table_free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage_print(char *exec_name) {
  printf("Usage: %s -i <interface> [-h] [-v] [-d] [-r <ip>] [-q <ip>] [-m "
         "<MAC>] [-t <sec>]\n",
         exec_name);
}


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

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

LLVM IR (-O0):
@.str = [83 x i8] c"Usage: %s -i <interface> [-h] [-v] [-d] [-r <ip>] [-q <ip>] [-m <MAC>] [-t <sec>]\0A\00"
define void @usage_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [83 x i8] c"Usage: %s -i <interface> [-h] [-v] [-d] [-r <ip>] [-q <ip>] [-m <MAC>] [-t <sec>]\0A\00"
define void @usage_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *dir_name(char const *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcmp(char *, char const *);
int dir_name_is(const char *path, const char *str) {
  char *dir;
  int result;
  dir = dir_name(path);
  if (!dir)
    return 0;
  result = !strcmp(dir, str);
  free(dir);
  return result;
}


x86 assembly (clang, -O0):
<dir_name_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <dir_name@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1164 <dir_name_is+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1190 <dir_name_is+0x60>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_name_is>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbp
call   1040 <dir_name@plt>
test   %rax,%rax
je     1160 <dir_name_is+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1050 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1162 <dir_name_is+0x32>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dir_name_is(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i8* @dir_name(i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 0, i32* %3
br label %23
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = call i32 @strcmp(i8* %14, i8* %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
store i32 %19, i32* %7
%20 = load i8*, i8** %6
%21 = call i32 @free(i8* %20)
%22 = load i32, i32* %7
store i32 %22, i32* %3
br label %23
23: ; preds = %13, %12
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @dir_name_is(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @dir_name(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(1) %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @free(i8* %3)
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %11
}
unsigned char i2c_write(unsigned char data) { return 1; }


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

x86 assembly (clang, -O2):
<i2c_write>:
mov    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @i2c_write(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @i2c_write(i8 zeroext %0) {
ret i8 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void DieWithError(char *errorMessage) {
  printf("%s\n", errorMessage);
  exit(1);
}


x86 assembly (clang, -O0):
<DieWithError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<DieWithError>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @DieWithError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *path, int val) {
  printf("Usage: %s <-a|--addr-add ADDR> | <-l|--addr-lst> | "
         "<-d|--addr-del ADDR>  <-i|--dev DEVICE>\n",
         path);
  exit(val);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [92 x i8] c"Usage: %s <-a|--addr-add ADDR> | <-l|--addr-lst> | <-d|--addr-del ADDR> <-i|--dev DEVICE>\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [92 x i8] c"Usage: %s <-a|--addr-add ADDR> | <-l|--addr-lst> | <-d|--addr-del ADDR> <-i|--dev DEVICE>\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
scalar_t__ EINTR;
int dup2(int, int);
scalar_t__ errno;
int r_dup2(int fildes, int fildes2) {
  int retval;
  while (retval = dup2(fildes, fildes2), retval == -1 && errno == EINTR)
    ;
  return retval;
}


x86 assembly (clang, -O0):
<r_dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dup2@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    1155 <r_dup2+0x45>
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1165 <r_dup2+0x55>
jmp    116a <r_dup2+0x5a>
jmp    111e <r_dup2+0xe>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_dup2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2ebe(%rip),%r14
mov    0x2eaf(%rip),%r15
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <dup2@plt>
cmp    $0xffffffff,%eax
jne    1146 <r_dup2+0x36>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <r_dup2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @dup2(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = load i64, i64* @errno
%14 = load i64, i64* @EINTR
%15 = icmp eq i64 %13, %14
br label %16
16: ; preds = %12, %6
%17 = phi i1 [ false, %6 ], [ %15, %12 ]
br i1 %17, label %18, label %19
18: ; preds = %16
br label %6
19: ; preds = %16
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_dup2(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @dup2(i32 %0, i32 %1)
%5 = icmp eq i32 %4, -1
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
%9 = select i1 %5, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int comm_printer_getc_block();
int /*<<< orphan*/ comm_printer_writeFFFx(int);
int getStatus(int which) {
  comm_printer_writeFFFx(which);
  return (comm_printer_getc_block());
}


x86 assembly (clang, -O0):
<getStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <comm_printer_writeFFFx@plt>
mov    $0x0,%al
call   1030 <comm_printer_getc_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getStatus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @comm_printer_writeFFFx(i32 %3)
%5 = call i32 (...) @comm_printer_getc_block()
ret i32 %5
}

LLVM IR (-O2):
define i32 @getStatus(i32 %0) {
%2 = tail call i32 @comm_printer_writeFFFx(i32 %0)
%3 = tail call i32 (...) @comm_printer_getc_block()
ret i32 %3
}
/* Variables and functions */
double log(int);
double log2(double x) { return log(x) / log(2); }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
push   %rax
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = call double @log(i32 %4)
%6 = call double @log(i32 2)
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @log2(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call double @log(i32 %2)
%4 = tail call double @log(i32 2)
%5 = fdiv double %3, %4
ret double %5
}
void test0() {
  extern volatile _Complex float test0_v;
  float f = (float)test0_v;
}


x86 assembly (clang, -O0):
<test0>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
movss  (%rax),%xmm0
mov    0x2eca(%rip),%rax
movss  0x4(%rax),%xmm1
movss  %xmm0,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test0>:
mov    0x2ed9(%rip),%rax
movss  (%rax),%xmm0
movss  0x4(%rax),%xmm0
ret

LLVM IR (-O0):
@test0_v = external global { float, float }
define void @test0() {
%1 = alloca float
%2 = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test0_v, i32 0, i32 0)
%3 = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test0_v, i32 0, i32 1)
store float %2, float* %1
ret void
}

LLVM IR (-O2):
@test0_v = external global { float, float }
define void @test0() {
%1 = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test0_v, i64 0, i32 0)
%2 = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test0_v, i64 0, i32 1)
ret void
}
/* Variables and functions */
size_t round_to_page_size(size_t size) {
  const size_t PAGE_MASK = (1L << 12) - 1;
  return (size + PAGE_MASK) & (~PAGE_MASK);
}


x86 assembly (clang, -O0):
<round_to_page_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0xfff,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfff,%rax
and    $0xfffffffffffff000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_page_size>:
lea    0xfff(%rdi),%rax
and    $0xfffffffffffff000,%rax
ret

LLVM IR (-O0):
define i64 @round_to_page_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 4095, i64* %3
%4 = load i64, i64* %2
%5 = add i64 %4, 4095
%6 = and i64 %5, -4096
ret i64 %6
}

LLVM IR (-O2):
define i64 @round_to_page_size(i64 %0) {
%2 = add i64 %0, 4095
%3 = and i64 %2, -4096
ret i64 %3
}
/* Variables and functions */
void putc(unsigned char c) {
  while (!((*(volatile unsigned long *)0x50000010) & (1 << 2)))
    ;
  (*(volatile unsigned char *)0x50000020) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x50000010,%eax
mov    (%rax),%rax
and    $0x4,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <putc+0x2c>
jmp    1131 <putc+0x31>
jmp    110a <putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x50000020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testq  $0x4,0x50000010
je     1100 <putc>
mov    %dil,0x50000020
50
ret

LLVM IR (-O0):
define void @putc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%5 = and i64 %4, 4
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i8, i8* %2
store volatile i8 %10, i8* inttoptr (i64 1342177312 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%4 = and i64 %3, 4
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 1342177312 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void mwmFeatures(void) { printf("%s\n", "MWM:BC/BW-SHIFT + 2-BYTE-HASH"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [30 x i8] c"MWM:BC/BW-SHIFT + 2-BYTE-HASH\00"
define void @mwmFeatures() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [30 x i8] c"MWM:BC/BW-SHIFT + 2-BYTE-HASH\00"
define void @mwmFeatures() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ kill_all_children();
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void sigint_handler() {
  kill_all_children();
  signal(SIGINT, SIG_DFL);
  kill(getpid(), SIGINT);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <kill_all_children@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
call   1050 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rbx
xor    %eax,%eax
call   1060 <kill_all_children@plt>
mov    0x2e99(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    (%rbx),%esi
mov    %eax,%edi
pop    %rbx
jmp    1050 <kill@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @sigint_handler() {
%1 = call i32 (...) @kill_all_children()
%2 = load i32, i32* @SIGINT
%3 = load i32, i32* @SIG_DFL
%4 = call i32 @signal(i32 %2, i32 %3)
%5 = call i32 (...) @getpid()
%6 = load i32, i32* @SIGINT
%7 = call i32 @kill(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @sigint_handler() {
%1 = tail call i32 (...) @kill_all_children()
%2 = load i32, i32* @SIGINT
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %2, i32 %3)
%5 = tail call i32 (...) @getpid()
%6 = load i32, i32* @SIGINT
%7 = tail call i32 @kill(i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_bang(int n) {
  for (int i = 0; i < n; i++) {
    printf("!");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_bang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <print_bang+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_bang+0x12>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bang>:
push   %rbx
test   %edi,%edi
jle    112f <print_bang+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x21,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_bang+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_bang(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = tail call i32 @putchar(i32 10)
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @putchar(i32 33)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %3, label %5
}
int test_imm_0Euint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x0E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Euint64_highword_reg>:
movabs $0xe00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Euint64_highword_reg(i64 %0) {
%2 = and i64 %0, 60129542144
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}