xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushinteger16array(long long int *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 16));
}


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

x86 assembly (clang, -O2):
<pushinteger16array>:
shl    $0x4,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushinteger16array(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = bitcast i64* %5 to i8*
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 16
%9 = call i32 @pushNarray(i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushinteger16array(i64* %0, i32 %1) {
%3 = bitcast i64* %0 to i8*
%4 = shl nsw i32 %1, 4
%5 = tail call i32 @pushNarray(i8* %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printstr(void *handle, const char str[]) { printf("env: %s", str); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"env: %s\00"
define void @printstr(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void vskip(int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("\n");
}


x86 assembly (clang, -O0):
<vskip>:
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 <vskip+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <vskip+0x12>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @vskip(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
ret void
}

LLVM IR (-O2):
define void @vskip(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 10)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void VAL_BTSN(bb, len, reg, nn) int *bb, len, reg, nn;
{ VMS_BTSN(bb, reg, nn, nn); }


x86 assembly (clang, -O0):
<VAL_BTSN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    $0x0,%al
call   1030 <VMS_BTSN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VAL_BTSN>:
mov    %edx,%esi
mov    %ecx,%edx
xor    %eax,%eax
jmp    1030 <VMS_BTSN@plt>

LLVM IR (-O0):
define void @VAL_BTSN(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = load i32, i32* %8
%13 = call i32 (i32*, i32, i32, i32, ...) bitcast (i32 (...)* @VMS_BTSN to i32 (i32*, i32, i32, i32, ...)*)(i32* %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @VAL_BTSN(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32*, i32, i32, i32, ...) bitcast (i32 (...)* @VMS_BTSN to i32 (i32*, i32, i32, i32, ...)*)(i32* %0, i32 %2, i32 %3, i32 %3)
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_assoc_resp(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0000 | 0x0010);
}


x86 assembly (clang, -O0):
<ieee80211_is_assoc_resp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x10,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_assoc_resp>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x10,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_assoc_resp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 16)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_assoc_resp(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 16)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *Strdup(const char *p) {
  char *ret = malloc(strlen(p) + 1);
  assert(ret != NULL && "Out of memory");
  strcpy(ret, p);
  return ret;
}


x86 assembly (clang, -O0):
<Strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     117f <Strdup+0x3f>
mov    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    117f <Strdup+0x3f>
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @Strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %1
%12 = phi i1 [ false, %1 ], [ true, %10 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @Strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int rat_mod_generic_set_val_flag_on(const char *argv, uint8_t *data,
                                    uint16_t len) {
  do {
  } while (0);
  if (!argv || !data || len < sizeof(int))
    return -1;
  *((int *)data) = 1;
  return 0;
}


x86 assembly (clang, -O0):
<rat_mod_generic_set_val_flag_on>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
jmp    1114 <rat_mod_generic_set_val_flag_on+0x14>
cmpq   $0x0,-0x10(%rbp)
je     1138 <rat_mod_generic_set_val_flag_on+0x38>
cmpq   $0x0,-0x18(%rbp)
je     1138 <rat_mod_generic_set_val_flag_on+0x38>
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jae    1144 <rat_mod_generic_set_val_flag_on+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <rat_mod_generic_set_val_flag_on+0x55>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rat_mod_generic_set_val_flag_on>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111c <rat_mod_generic_set_val_flag_on+0x1c>
test   %rsi,%rsi
je     111c <rat_mod_generic_set_val_flag_on+0x1c>
cmp    $0x4,%edx
jb     111c <rat_mod_generic_set_val_flag_on+0x1c>
movl   $0x1,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rat_mod_generic_set_val_flag_on(i8* readnone %0, i32* writeonly %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i32* %1, null
%6 = or i1 %4, %5
%7 = icmp ult i32 %2, 4
%8 = or i1 %6, %7
br i1 %8, label %10, label %9
9: ; preds = %3
store i32 1, i32* %1
br label %10
10: ; preds = %3, %9
%11 = phi i32 [ 0, %9 ], [ -1, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ clear_bit(int, void *);
int test_bit(int, void *);
int test_and_clear_bit(int nr, void *addr) {
  int oldbit = test_bit(nr, addr);
  clear_bit(nr, addr);
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <test_bit@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <clear_bit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_clear_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <test_bit@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <clear_bit@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test_and_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @test_bit(i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i8*, i8** %4
%11 = call i32 @clear_bit(i32 %9, i8* %10)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_and_clear_bit(i32 %0, i8* %1) {
%3 = tail call i32 @test_bit(i32 %0, i8* %1)
%4 = tail call i32 @clear_bit(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ debug_warning(char *);
void component_cbox_set_param(void *handle, unsigned int index, char *value) {
  debug_warning(
      "[component_cbox_set_param] component_cbox does not take any parameters");
}


x86 assembly (clang, -O0):
<component_cbox_set_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <debug_warning@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [71 x i8] c"[component_cbox_set_param] component_cbox does not take any parameters\00"
define void @component_cbox_set_param(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 @debug_warning(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"[component_cbox_set_param] component_cbox does not take any parameters\00"
define void @component_cbox_set_param(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @debug_warning(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
void __outw_p(unsigned short value, unsigned short port) {
  __asm__ __volatile__("out"
                       "w"
                       " %"
                       "w"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "d"(port));
  __asm__ __volatile__("outb %al,$0x80");
}


x86 assembly (clang, -O0):
<__outw_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outw_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @__outw_p(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char const *, int /*<<< orphan*/,
                        int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void WriteToSocket(const char *Message, int SockFD) {
  send(SockFD, Message, strlen(Message), 0);
}


x86 assembly (clang, -O0):
<WriteToSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteToSocket>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

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

LLVM IR (-O2):
define void @WriteToSocket(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @send(i32 %1, i8* %0, i32 %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lol();
int /*<<< orphan*/ printf(char *);
void rofl() {
  printf("rofl\n");
  lol();
}


x86 assembly (clang, -O0):
<rofl>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <lol@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rofl>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <lol@plt>

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

LLVM IR (-O2):
@str = [5 x i8] c"rofl\00"
define void @rofl() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @lol()
ret void
}
void set_int3(unsigned char *string, int n) {
  string[0] = (n >> 16) & 255;
  string[1] = (n >> 8) & 255;
  string[2] = n & 255;
}


x86 assembly (clang, -O0):
<set_int3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_int3>:
mov    %esi,%eax
mov    %esi,%ecx
shr    $0x10,%ecx
mov    %cl,(%rdi)
mov    %ah,0x1(%rdi)
mov    %al,0x2(%rdi)
ret

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

LLVM IR (-O2):
define void @set_int3(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = trunc i32 %1 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
ret void
}
/* Variables and functions */
scalar_t__ signbit(float);
float grad_relu(float grad_output_data, float input_data,
                float negative_slope) {
  return signbit(input_data) ? grad_output_data * negative_slope
                             : grad_output_data;
}


x86 assembly (clang, -O0):
<grad_relu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <signbit@plt>
cmp    $0x0,%rax
je     114f <grad_relu+0x3f>
movss  -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1159 <grad_relu+0x49>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grad_relu>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm0,0x4(%rsp)
movaps %xmm1,%xmm0
call   1030 <signbit@plt>
test   %rax,%rax
je     1130 <grad_relu+0x20>
movss  (%rsp),%xmm0
jmp    1138 <grad_relu+0x28>
movss  0xec8(%rip),%xmm0
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @grad_relu(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = call i64 @signbit(float %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load float, float* %4
%12 = load float, float* %6
%13 = fmul float %11, %12
br label %16
14: ; preds = %3
%15 = load float, float* %4
br label %16
16: ; preds = %14, %10
%17 = phi float [ %13, %10 ], [ %15, %14 ]
ret float %17
}

LLVM IR (-O2):
define float @grad_relu(float %0, float %1, float %2) {
%4 = tail call i64 @signbit(float %1)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, float 1.000000e+00, float %2
%7 = fmul float %6, %0
ret float %7
}
/* Variables and functions */
size_t lookup_auto_shrink_threshold(void *context, size_t capacity) {
  return (capacity >> 4);
}


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

x86 assembly (clang, -O2):
<lookup_auto_shrink_threshold>:
mov    %rsi,%rax
shr    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @lookup_auto_shrink_threshold(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = lshr i64 %5, 4
ret i64 %6
}

LLVM IR (-O2):
define i64 @lookup_auto_shrink_threshold(i8* nocapture readnone %0, i64 %1) {
%3 = lshr i64 %1, 4
ret i64 %3
}
unsigned int string_len(const char *a) {
  char *s;
  if (!a)
    return 0;
  for (s = (char *)a; *s; s++)
    ;
  return (s - a);
}


x86 assembly (clang, -O0):
<string_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <string_len+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1158 <string_len+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <string_len+0x4a>
jmp    1139 <string_len+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <string_len+0x27>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_len>:
test   %rdi,%rdi
je     111d <string_len+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <string_len+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @string_len(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %25
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %4
br label %10
10: ; preds = %15, %8
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
br label %10
18: ; preds = %10
%19 = load i8*, i8** %4
%20 = load i8*, i8** %3
%21 = ptrtoint i8* %19 to i64
%22 = ptrtoint i8* %20 to i64
%23 = sub i64 %21, %22
%24 = trunc i64 %23 to i32
store i32 %24, i32* %2
br label %25
25: ; preds = %18, %7
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @string_len(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %1, %8
%14 = phi i32 [ %12, %8 ], [ 0, %1 ]
ret i32 %14
}
long SIO1init() { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1init() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1init() {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getdelim(char **, size_t *, char, int /*<<< orphan*/ *);
ssize_t apol_getline(char **lineptr, size_t *n, FILE *stream) {
  return getdelim(lineptr, n, '\n', stream);
}


x86 assembly (clang, -O0):
<apol_getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0xa,%edx
call   1030 <getdelim@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apol_getline>:
mov    %rdx,%rcx
mov    $0xa,%edx
jmp    1030 <getdelim@plt>

LLVM IR (-O0):
define i32 @apol_getline(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 @getdelim(i8** %7, i64* %8, i8 signext 10, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @apol_getline(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @getdelim(i8** %0, i64* %1, i8 signext 10, i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double stdlib_strided_dsempn(int /*<<< orphan*/ const, double const,
                             double const *, int /*<<< orphan*/ const);
double stdlib_strided_dsem(const int64_t N, const double correction,
                           const double *X, const int64_t stride) {
  return stdlib_strided_dsempn(N, correction, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_dsem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <stdlib_strided_dsempn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dsem>:
jmp    1030 <stdlib_strided_dsempn@plt>

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

LLVM IR (-O2):
define double @stdlib_strided_dsem(i32 %0, double %1, double* %2, i32 %3) {
%5 = tail call double @stdlib_strided_dsempn(i32 %0, double %1, double* %2, i32 %3)
ret double %5
}
void XmbTextEscapement() {}


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

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

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

LLVM IR (-O2):
define void @XmbTextEscapement() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int *a, int s) {
  int i = 0;
  for (i = 0; i < s; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <printArr+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <printArr+0x1d>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void pcp_print_psicpu_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_psicpu_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_LESS;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ glClearColor(float, float, float, float);
int /*<<< orphan*/ glClearDepth(double);
int /*<<< orphan*/ glDepthFunc(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void InitGL(void) {
  glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
  glClearDepth(1.0);
  glDepthFunc(GL_LESS);
  glEnable(GL_DEPTH_TEST);
  glShadeModel(GL_SMOOTH);
}


x86 assembly (clang, -O0):
<InitGL>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
movsd  0xe93(%rip),%xmm0
call   1060 <glClearDepth@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
call   1040 <glDepthFunc@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1070 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitGL>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
movsd  0xe96(%rip),%xmm0
call   1060 <glClearDepth@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1040 <glDepthFunc@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1070 <glShadeModel@plt>

LLVM IR (-O0):
@GL_LESS = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_SMOOTH = global i32 0
define void @InitGL() {
%1 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%2 = call i32 @glClearDepth(double 1.000000e+00)
%3 = load i32, i32* @GL_LESS
%4 = call i32 @glDepthFunc(i32 %3)
%5 = load i32, i32* @GL_DEPTH_TEST
%6 = call i32 @glEnable(i32 %5)
%7 = load i32, i32* @GL_SMOOTH
%8 = call i32 @glShadeModel(i32 %7)
ret void
}

LLVM IR (-O2):
@GL_LESS = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_SMOOTH = global i32 0
define void @InitGL() {
%1 = tail call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%2 = tail call i32 @glClearDepth(double 1.000000e+00)
%3 = load i32, i32* @GL_LESS
%4 = tail call i32 @glDepthFunc(i32 %3)
%5 = load i32, i32* @GL_DEPTH_TEST
%6 = tail call i32 @glEnable(i32 %5)
%7 = load i32, i32* @GL_SMOOTH
%8 = tail call i32 @glShadeModel(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void overflow_fail(int pos) {
  printf("integer error at position %d\n", pos);
  exit(-1);
}


x86 assembly (clang, -O0):
<overflow_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<overflow_fail>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [30 x i8] c"integer error at position %d\0A\00"
define void @overflow_fail(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void SensorGetReg_FUJITSU(unsigned char uAddr, unsigned short *uVal) {
  *uVal = 0;
}


x86 assembly (clang, -O0):
<SensorGetReg_FUJITSU>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movw   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorGetReg_FUJITSU>:
movw   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @SensorGetReg_FUJITSU(i8 zeroext %0, i16* nocapture writeonly %1) {
store i16 0, i16* %1
ret void
}
/* Variables and functions */
char *callhello();
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *p = NULL;
  p = callhello();
  printf("function return value : %s\r\n", p);
  getchar();
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <callhello@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <callhello@plt>
mov    %rax,%rbx
lea    0xeae(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"function return value : %s\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = call i8* (...) @callhello()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @getchar()
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"function return value : %s\0D\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @callhello()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
void rop3_3_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T | S;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_3_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_3_1_0>:
or     %esi,%edx
not    %dl
mov    (%rdi),%al
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_3_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = trunc i32 %16 to i8
store i8 %17, i8* %7
%18 = load i8, i8* %7
%19 = zext i8 %18 to i32
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = xor i32 %21, -1
%23 = and i32 %19, %22
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = and i32 %26, %28
%30 = or i32 %23, %29
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %4
store i8 %31, i8* %32
ret void
}

LLVM IR (-O2):
define void @rop3_3_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %1
%8 = or i8 %7, %5
store i8 %8, i8* %0
ret void
}
void _Jv_LookupInterfaceMethod(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_LookupInterfaceMethod() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mpush(int);
void fcell() { mpush(2); }


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

x86 assembly (clang, -O2):
<fcell>:
mov    $0x2,%edi
jmp    1030 <mpush@plt>

LLVM IR (-O0):
define void @fcell() {
%1 = call i32 @mpush(i32 2)
ret void
}

LLVM IR (-O2):
define void @fcell() {
%1 = tail call i32 @mpush(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int task_callback(void *data, void *param) {
  printf("task run ...\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"task run ...\0A\00"
define i32 @task_callback(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"task run ...\00"
define i32 @task_callback(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ move(scalar_t__, int);
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
void status_left(char *message) {
  move(LINES - 3, 1);
  printw(message);
  refresh();
}


x86 assembly (clang, -O0):
<status_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%rdi
sub    $0x3,%rdi
mov    $0x1,%esi
call   1050 <move@plt>
mov    -0x8(%rbp),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_left>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%rdi
add    $0xfffffffffffffffd,%rdi
mov    $0x1,%esi
call   1050 <move@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@LINES = global i64 0
define void @status_left(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @LINES
%4 = sub nsw i64 %3, 3
%5 = call i32 @move(i64 %4, i32 1)
%6 = load i8*, i8** %2
%7 = call i32 @printw(i8* %6)
%8 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@LINES = global i64 0
define void @status_left(i8* %0) {
%2 = load i64, i64* @LINES
%3 = add nsw i64 %2, -3
%4 = tail call i32 @move(i64 %3, i32 1)
%5 = tail call i32 @printw(i8* %0)
%6 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, char *);
int main() {
  char s1[] = "abcdefabcghi";
  char s2[] = "aaabc";
  squeeze(s1, s2);
  printf("%s\n", s1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x13(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0xf(%rbp)
lea    -0xd(%rbp),%rdi
lea    -0x13(%rbp),%rsi
call   1030 <squeeze@plt>
lea    -0xd(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x69686763626166,%rax
mov    %rax,0x15(%rsp)
movabs $0x6261666564636261,%rax
66 61 62
mov    %rax,0x10(%rsp)
movw   $0x63,0xc(%rsp)
movl   $0x62616161,0x8(%rsp)
62
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <squeeze@plt>
lea    0xea8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [13 x i8] c"abcdefabcghi\00"
@__const.main.s2 = [6 x i8] c"aaabc\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca [6 x i8]
%3 = bitcast [13 x i8]* %1 to i8*
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 @squeeze(i8* %5, i8* %6)
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [13 x i8] c"abcdefabcghi\00"
@__const.main.s2 = [6 x i8] c"aaabc\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @squeeze(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int ifconfig_order(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @ifconfig_order() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ifconfig_order() {
ret i32 1
}
int logicalShift(int x, int n) {
  x = x >> n;
  int tmp = 1;
  tmp = tmp << 31;
  tmp = tmp >> n;
  tmp = tmp << 1;
  return (x & ~tmp);
}


x86 assembly (clang, -O0):
<logicalShift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicalShift>:
mov    %esi,%ecx
sar    %cl,%edi
mov    $0x80000000,%eax
sar    %cl,%eax
add    %eax,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
store i32 %8, i32* %3
store i32 1, i32* %5
%9 = load i32, i32* %5
%10 = shl i32 %9, 31
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = shl i32 %14, 1
store i32 %15, i32* %5
%16 = load i32, i32* %3
%17 = load i32, i32* %5
%18 = xor i32 %17, -1
%19 = and i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = ashr i32 -2147483648, %1
%5 = shl i32 %4, 1
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int less(float a, float b) {
  if (a < b) {
    printf("True");
    return 0;
  } else {
    printf("False");
    return 1;
  }
}


x86 assembly (clang, -O0):
<less>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    114d <less+0x3d>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1160 <less+0x50>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<less>:
push   %rbx
xor    %ebx,%ebx
ucomiss %xmm0,%xmm1
setbe  %bl
lea    0xee0(%rip),%rax
lea    0xede(%rip),%rdi
cmova  %rax,%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"True\00"
@.str.1 = [6 x i8] c"False\00"
define i32 @less(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%5 = xor i1 %3, true
%6 = zext i1 %5 to i32
%7 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret i32 %6
}