xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ barf(char *, size_t);
void *malloc(size_t);
void *malloc_nofail(size_t size) {
  void *ptr = malloc(size);
  if (ptr)
    return ptr;
  barf("malloc of %zu failed", size);
}


x86 assembly (clang, -O0):
<malloc_nofail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <malloc_nofail+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <malloc_nofail+0x41>
mov    -0x10(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <barf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_nofail>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <malloc_nofail+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <barf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"malloc of %zu failed\00"
define i8* @malloc_nofail(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = call i32 @barf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [21 x i8] c"malloc of %zu failed\00"
define noalias i8* @malloc_nofail(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @barf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
/* Variables and functions */
bool ascending(int a, int b) { return a > b; }


x86 assembly (clang, -O0):
<ascending>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascending>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @ascending(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ascending(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
IR0AX1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*p0) <= (((unsigned char *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     1146 <IR0AX1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <IR0AX1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AX1>:
mov    (%r8),%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx),%dl
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = load i8, i8* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %8
%10 = load i8, i8* %9
%11 = icmp ule i8 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
unsigned char get_user_byte_io(const char *addr) {
  register unsigned char _v;
  __asm__ __volatile__("mov %1 ,%0 \n\t" : "=r"(_v) : "r"(*addr));
  return _v;
}


x86 assembly (clang, -O0):
<get_user_byte_io>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_byte_io>:
mov    (%rdi),%al
mov    %al,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_user_byte_io(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i8 asm sideeffect "mov $1 ,$0 \0A\09", "=r,r,~{dirflag},~{fpsr},~{flags}"(i8 %5)
store i8 %6, i8* %3
%7 = load i8, i8* %3
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @get_user_byte_io(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i8 asm sideeffect "mov $1 ,$0 \0A\09", "=r,r,~{dirflag},~{fpsr},~{flags}"(i8 %2)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int sql_select();
int /*<<< orphan*/ system(char *);
int main() {
  if (sql_select() == 1) {
    system("/ailvgo/system/traffic/udp_get &");
    sleep(5);
    system("/ailvgo/system/box/udp_daemon &");
    sleep(5);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <sql_select@plt>
cmp    $0x1,%eax
jne    117b <main+0x4b>
lea    0xeaa(%rip),%rdi
call   1040 <system@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xeb5(%rip),%rdi
call   1040 <system@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sql_select@plt>
cmp    $0x1,%eax
jne    1169 <main+0x39>
lea    0xebc(%rip),%rdi
call   1040 <system@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xec7(%rip),%rdi
call   1040 <system@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"/ailvgo/system/traffic/udp_get &\00"
@.str.1 = [32 x i8] c"/ailvgo/system/box/udp_daemon &\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @sql_select()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 5)
%7 = call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @sleep(i32 5)
br label %9
9: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"/ailvgo/system/traffic/udp_get &\00"
@.str.1 = [32 x i8] c"/ailvgo/system/box/udp_daemon &\00"
define i32 @main() {
%1 = tail call i32 (...) @sql_select()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 5)
%6 = tail call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @sleep(i32 5)
br label %8
8: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int htonl(int);
int /*<<< orphan*/ write(int, void const *, int);
int send_cmd(int fd, int cmd, int arg) {
  int netcmd, netarg;
  netcmd = htonl(cmd);
  netarg = htonl(arg);
  write(fd, (const void *)&netcmd, sizeof(int));
  write(fd, (const void *)&netarg, sizeof(int));
  return 0;
}


x86 assembly (clang, -O0):
<send_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <htonl@plt>
mov    %eax,0x4(%rsp)
mov    %ebx,%edi
call   1040 <htonl@plt>
mov    %eax,(%rsp)
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %rsp,%rsi
mov    %ebp,%edi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @send_cmd(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @htonl(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = call i32 @htonl(i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %4
%14 = bitcast i32* %7 to i8*
%15 = call i32 @write(i32 %13, i8* %14, i32 4)
%16 = load i32, i32* %4
%17 = bitcast i32* %8 to i8*
%18 = call i32 @write(i32 %16, i8* %17, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @send_cmd(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = tail call i32 @htonl(i32 %1)
store i32 %8, i32* %4
%9 = tail call i32 @htonl(i32 %2)
store i32 %9, i32* %5
%10 = call i32 @write(i32 %0, i8* %6, i32 4)
%11 = call i32 @write(i32 %0, i8* %7, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int is_Authorized(char *s) {
  if (strstr(s, "200 OK") != NULL) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_Authorized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <is_Authorized+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <is_Authorized+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_Authorized>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"200 OK\00"
define i32 @is_Authorized(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ closePwm();
int /*<<< orphan*/ initPwm();
int /*<<< orphan*/ sleep(int);
void startupPwm() {
  closePwm();
  sleep(1);
  initPwm();
}


x86 assembly (clang, -O0):
<startupPwm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <closePwm@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1040 <initPwm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startupPwm>:
push   %rax
xor    %eax,%eax
call   1030 <closePwm@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initPwm@plt>

LLVM IR (-O0):
define void @startupPwm() {
%1 = call i32 (...) @closePwm()
%2 = call i32 @sleep(i32 1)
%3 = call i32 (...) @initPwm()
ret void
}

LLVM IR (-O2):
define void @startupPwm() {
%1 = tail call i32 (...) @closePwm()
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 (...) @initPwm()
ret void
}
void rop3_244_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  *D = stk1;
}


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

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

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

LLVM IR (-O2):
define void @rop3_244_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %5, %1
%7 = or i8 %6, %2
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kb_wait();
int /*<<< orphan*/ outb(int, int);
int /*<<< orphan*/ udelay(int);
void mach_reboot(void) {
  int i;
  for (i = 0; i < 100; i++) {
    kb_wait();
    udelay(50);
    outb(0xfe, 0x64);
    udelay(50);
  }
}


x86 assembly (clang, -O0):
<mach_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1181 <mach_reboot+0x51>
mov    $0x0,%al
call   1050 <kb_wait@plt>
mov    $0x32,%edi
call   1040 <udelay@plt>
mov    $0xfe,%edi
mov    $0x64,%esi
call   1030 <outb@plt>
mov    $0x32,%edi
call   1040 <udelay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <mach_reboot+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mach_reboot>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <kb_wait@plt>
mov    $0x32,%edi
call   1040 <udelay@plt>
mov    $0xfe,%edi
mov    $0x64,%esi
call   1030 <outb@plt>
mov    $0x32,%edi
call   1040 <udelay@plt>
add    $0xffffffff,%ebx
jne    1140 <mach_reboot+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @mach_reboot() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = call i32 (...) @kb_wait()
%7 = call i32 @udelay(i32 50)
%8 = call i32 @outb(i32 254, i32 100)
%9 = call i32 @udelay(i32 50)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @mach_reboot() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = tail call i32 (...) @kb_wait()
%4 = tail call i32 @udelay(i32 50)
%5 = tail call i32 @outb(i32 254, i32 100)
%6 = tail call i32 @udelay(i32 50)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 100
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int EINVAL;
int ESRCH;
int thd_detach(int /*<<< orphan*/);
int pthread_detach(pthread_t thread) {
  int rv = thd_detach(thread);
  if (rv == -3) {
    return EINVAL;
  } else if (rv < 0) {
    return ESRCH;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<pthread_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <thd_detach@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xfffffffd,-0xc(%rbp)
jne    1141 <pthread_detach+0x31>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <pthread_detach+0x53>
cmpl   $0x0,-0xc(%rbp)
jge    115c <pthread_detach+0x4c>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <pthread_detach+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_detach>:
push   %rax
call   1030 <thd_detach@plt>
cmp    $0xfffffffd,%eax
jne    1126 <pthread_detach+0x16>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
mov    0x2ea3(%rip),%rcx
sar    $0x1f,%eax
and    (%rcx),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@ESRCH = global i32 0
define i32 @pthread_detach(i32 %0) {
%2 = tail call i32 @thd_detach(i32 %0)
%3 = icmp eq i32 %2, -3
%4 = load i32, i32* @EINVAL
%5 = icmp slt i32 %2, 0
%6 = load i32, i32* @ESRCH
%7 = select i1 %5, i32 %6, i32 0
%8 = select i1 %3, i32 %4, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t f0a(uint64_t arg) { return ~(arg > -3); }


x86 assembly (clang, -O0):
<f0a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffffffd,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0a>:
xor    %eax,%eax
cmp    $0xfffffffe,%edi
setge  %al
not    %eax
ret

LLVM IR (-O0):
define i32 @f0a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, -3
%5 = zext i1 %4 to i32
%6 = xor i32 %5, -1
ret i32 %6
}

LLVM IR (-O2):
define i32 @f0a(i32 %0) {
%2 = icmp sgt i32 %0, -3
%3 = zext i1 %2 to i32
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int testLibRequired();
int testLibDepends(void) { return testLibRequired(); }


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

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

LLVM IR (-O0):
define i32 @testLibDepends() {
%1 = call i32 (...) @testLibRequired()
ret i32 %1
}

LLVM IR (-O2):
define i32 @testLibDepends() {
%1 = tail call i32 (...) @testLibRequired()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ OS_TaskRegister();
void task_15(void) {
  OS_TaskRegister();
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<task_15>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OS_TaskRegister@plt>
jmp    111b <task_15+0xb>

x86 assembly (clang, -O2):
<task_15>:
push   %rax
xor    %eax,%eax
call   1030 <OS_TaskRegister@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <task_15+0x10>

LLVM IR (-O0):
define void @task_15() {
%1 = call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_15() {
%1 = tail call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ prtreal(double);
int /*<<< orphan*/ stderr;
void prtregr(char *name, double val) {
  prtreal(val);
  fprintf(stderr, "   RA");
}


x86 assembly (clang, -O0):
<prtregr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <prtreal@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prtregr>:
push   %rax
call   1030 <prtreal@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c" RA\00"
define void @prtregr(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call i32 @prtreal(double %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c" RA\00"
define void @prtregr(i8* nocapture readnone %0, double %1) {
%3 = tail call i32 @prtreal(double %1)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ifaddrs {
  int /*<<< orphan*/ ifa_addr;
  int /*<<< orphan*/ ifa_netmask;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
void free_target(struct ifaddrs *if_sender) {
  free(if_sender->ifa_netmask);
  free(if_sender->ifa_addr);
}


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

x86 assembly (clang, -O2):
<free_target>:
push   %rbx
mov    %rdi,%rbx
mov    0x4(%rdi),%edi
call   1030 <free@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ifaddrs = type { i32, i32 }
define void @free_target(%struct.ifaddrs* %0) {
%2 = alloca %struct.ifaddrs*
store %struct.ifaddrs* %0, %struct.ifaddrs** %2
%3 = load %struct.ifaddrs*, %struct.ifaddrs** %2
%4 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %3, i32 0, i32 1
%5 = load i32, i32* %4
%6 = call i32 @free(i32 %5)
%7 = load %struct.ifaddrs*, %struct.ifaddrs** %2
%8 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @free(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.ifaddrs = type { i32, i32 }
define void @free_target(%struct.ifaddrs* nocapture %0) {
%2 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %0, i64 0, i32 1
%3 = load i32, i32* %2
%4 = tail call i32 @free(i32 %3)
%5 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @free(i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
char *strchr(char *, char);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_formatted_time() {
  time_t curtime = time(NULL);
  char *fmt_time = asctime(localtime(&curtime));
  char *nl;
  if (nl = strchr(fmt_time, '\n'))
    *nl = 0;
  return fmt_time;
}


x86 assembly (clang, -O0):
<get_formatted_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     118b <get_formatted_time+0x4b>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_formatted_time>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1179 <get_formatted_time+0x39>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_formatted_time() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i32 @time(i32* null)
store i32 %4, i32* %1
%5 = call i32 @localtime(i32* %1)
%6 = call i8* @asctime(i32 %5)
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i8* @strchr(i8* %7, i8 signext 10)
store i8* %8, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i8*, i8** %3
store i8 0, i8* %11
br label %12
12: ; preds = %10, %0
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @get_formatted_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @localtime(i32* %1)
%5 = call i8* @asctime(i32 %4)
%6 = call i8* @strchr(i8* dereferenceable(1) %5, i8 signext 10)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %0
store i8 0, i8* %6
br label %9
9: ; preds = %8, %0
ret i8* %5
}
void unraw(void) {}


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

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

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

LLVM IR (-O2):
define void @unraw() {
ret void
}
/* Variables and functions */
scalar_t__ write(int, int *, int);
int write_int4(int f, int i) {
  i = ((i & 0xff000000) >> 24 | (i & 0x00ff0000) >> 8 | (i & 0x0000ff00) << 8 |
       (i & 0x000000ff) << 24);
  return write(f, &i, 4) > 0;
}


x86 assembly (clang, -O0):
<write_int4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x8(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int4>:
push   %rax
bswap  %esi
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_int4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, -16777216
%7 = lshr i32 %6, 24
%8 = load i32, i32* %4
%9 = and i32 %8, 16711680
%10 = ashr i32 %9, 8
%11 = or i32 %7, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 65280
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = load i32, i32* %4
%17 = and i32 %16, 255
%18 = shl i32 %17, 24
%19 = or i32 %15, %18
store i32 %19, i32* %4
%20 = load i32, i32* %3
%21 = call i64 @write(i32 %20, i32* %4, i32 4)
%22 = icmp sgt i64 %21, 0
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @write_int4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @llvm.bswap.i32(i32 %1)
store i32 %4, i32* %3
%5 = call i64 @write(i32 %0, i32* %3, i32 4)
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void rop3_183_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_183_0_0>:
xor    (%rdi),%dl
and    %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_183_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
int /*<<< orphan*/ scanf(char *, long *);
int main(void) {
  long int i, n;
  scanf("%ld", &n);
  for (i = 2; i <= n; i += 2)
    printf("%ld^2 = %ld\n", i, i * i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     117f <main+0x5f>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
imul   -0x10(%rbp),%rdx
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <main+0x27>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmpq   $0x2,(%rsp)
jl     116c <main+0x4c>
mov    $0x2,%ebx
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdx
imul   %rbx,%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x2,%rbx
cmp    (%rsp),%rbx
jle    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [13 x i8] c"%ld^2 = %ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 2
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = phi i64 [ %10, %6 ], [ 2, %0 ]
%8 = mul nsw i64 %7, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 %7, i64 %8)
%10 = add nuw nsw i64 %7, 2
%11 = load i64, i64* %1
%12 = icmp sgt i64 %10, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ __infer_nondet_int();
void FP_loop_with_return_good() {
  while (1) {
    if (__infer_nondet_int()) {
      return;
    }
  }
}


x86 assembly (clang, -O0):
<FP_loop_with_return_good>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <FP_loop_with_return_good+0x9>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
cmp    $0x0,%rax
je     112c <FP_loop_with_return_good+0x1c>
pop    %rbp
ret
jmp    1119 <FP_loop_with_return_good+0x9>

x86 assembly (clang, -O2):
<FP_loop_with_return_good>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %rax,%rax
je     1120 <FP_loop_with_return_good+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @FP_loop_with_return_good() {
br label %1
1: ; preds = %0, %5
%2 = call i64 (...) @__infer_nondet_int()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
ret void
5: ; preds = %1
br label %1
}

LLVM IR (-O2):
define void @FP_loop_with_return_good() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @__infer_nondet_int()
%3 = icmp eq i64 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void des_ctx_free(void *ctx) { free(ctx); }


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

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

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

LLVM IR (-O2):
define void @des_ctx_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
long double test_asinl(long double x) { return __builtin_asinl(x); }


x86 assembly (clang, -O0):
<test_asinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <asinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_asinl>:
jmp    1030 <asinl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_asinl(x86_fp80 %0) {
%2 = tail call x86_fp80 @asinl(x86_fp80 %0)
ret x86_fp80 %2
}
__attribute__((section("freplace/subprog"), used)) int replacement() {
  return 0;
}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @replacement to i8*)], section "llvm.metadata"
define i32 @replacement() section "freplace/subprog" {
ret i32 0
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @replacement to i8*)], section "llvm.metadata"
define i32 @replacement() section "freplace/subprog" {
ret i32 0
}
int is_leap(int year) {
  int leap;
  if (year % 100 == 0) {
    leap = (year % 400) ? 1 : 0;
  } else if (year % 4 == 0) {
    leap = 1;
  } else {
    leap = 0;
  }
  return leap;
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113b <is_leap+0x3b>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1167 <is_leap+0x67>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115b <is_leap+0x5b>
movl   $0x1,-0x8(%rbp)
jmp    1162 <is_leap+0x62>
movl   $0x0,-0x8(%rbp)
jmp    1167 <is_leap+0x67>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x2,%ecx
cmp    $0x28f5c28,%ecx
jbe    1123 <is_leap+0x23>
test   $0x3,%dil
sete   %al
movzbl %al,%eax
ret
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
setae  %al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = srem i32 %0, 400
%6 = icmp ne i32 %5, 0
br label %10
7: ; preds = %1
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ %6, %4 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}
int CLIP(int a) {
  if (a & 256)
    return ((a) >> 31) ^ (-1);
  else
    return a;
}


x86 assembly (clang, -O0):
<CLIP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1129 <CLIP+0x29>
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <CLIP+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLIP>:
mov    %edi,%eax
sar    $0x1f,%eax
test   $0x100,%edi
not    %eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @CLIP(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 256
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = ashr i32 %8, 31
%10 = xor i32 %9, -1
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @CLIP(i32 %0) {
%2 = and i32 %0, 256
%3 = icmp eq i32 %2, 0
%4 = ashr i32 %0, 31
%5 = xor i32 %4, -1
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
void GPIOPortB_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<GPIOPortB_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <GPIOPortB_Handler+0x9>
jmp    1109 <GPIOPortB_Handler+0x9>

x86 assembly (clang, -O2):
<GPIOPortB_Handler>:
jmp    1100 <GPIOPortB_Handler>

LLVM IR (-O0):
define void @GPIOPortB_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @GPIOPortB_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR85_set(void) { return U_WMRCORENONE_set("U_WMR85"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR85\00"
define i8* @U_WMR85_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR85\00"
define i8* @U_WMR85_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void foo044() {}


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

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

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

LLVM IR (-O2):
define void @foo044() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int _c(char *a, char *b) { return strcmp(a, b) == 0; }


x86 assembly (clang, -O0):
<_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_c>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_c(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_c(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int base64_declen(int x) { return ((x * 6) + 7) >> 3; }


x86 assembly (clang, -O0):
<base64_declen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x6,-0x4(%rbp),%eax
add    $0x7,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_declen>:
lea    (%rdi,%rdi,2),%eax
add    %eax,%eax
add    $0x7,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @base64_declen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 6
%5 = add nsw i32 %4, 7
%6 = ashr i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @base64_declen(i32 %0) {
%2 = mul nsw i32 %0, 6
%3 = add nsw i32 %2, 7
%4 = ashr i32 %3, 3
ret i32 %4
}
void *lrt_trans_gmem(void) { return (void *)(0xFFFFFFFF00000000ULL); }


x86 assembly (clang, -O0):
<lrt_trans_gmem>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffffffff00000000,%rax
ff ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrt_trans_gmem>:
movabs $0xffffffff00000000,%rax
ff ff ff
ret

LLVM IR (-O0):
define i8* @lrt_trans_gmem() {
ret i8* inttoptr (i64 -4294967296 to i8*)
}

LLVM IR (-O2):
define i8* @lrt_trans_gmem() {
ret i8* inttoptr (i64 -4294967296 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
void ft_putchar(int c) {
  if (c >= 0 && c <= 127)
    write(1, &c, 1);
}


x86 assembly (clang, -O0):
<ft_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113f <ft_putchar+0x2f>
cmpl   $0x7f,-0x4(%rbp)
jg     113f <ft_putchar+0x2f>
mov    $0x1,%edx
lea    -0x4(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar>:
push   %rax
mov    %edi,0x4(%rsp)
cmp    $0x7f,%edi
ja     112e <ft_putchar+0x1e>
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ft_putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 127
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @write(i32 1, i32* %2, i32 1)
br label %10
10: ; preds = %8, %5, %1
ret void
}

LLVM IR (-O2):
define void @ft_putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = icmp ult i32 %0, 128
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @write(i32 1, i32* %2, i32 1)
br label %6
6: ; preds = %4, %1
ret void
}
int parse_num_base(const char *sval) {
  if (sval[0] == '+' || sval[0] == '-') {
    sval++;
  }
  if (sval[0] == '0' && sval[1] == 'x') {
    return 0;
  } else {
    return 10;
  }
}


x86 assembly (clang, -O0):
<parse_num_base>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     1128 <parse_num_base+0x28>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1134 <parse_num_base+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1161 <parse_num_base+0x61>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
jne    1161 <parse_num_base+0x61>
movl   $0x0,-0x4(%rbp)
jmp    1168 <parse_num_base+0x68>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_num_base>:
mov    (%rdi),%al
cmp    $0x2d,%al
je     110a <parse_num_base+0xa>
cmp    $0x2b,%al
jne    1111 <parse_num_base+0x11>
mov    0x1(%rdi),%al
add    $0x1,%rdi
cmp    $0x30,%al
jne    111d <parse_num_base+0x1d>
xor    %eax,%eax
cmpb   $0x78,0x1(%rdi)
je     1122 <parse_num_base+0x22>
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @parse_num_base(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 43
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %15, label %18
15: ; preds = %9, %1
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %18
18: ; preds = %15, %9
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 48
br i1 %23, label %24, label %31
24: ; preds = %18
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 120
br i1 %29, label %30, label %31
30: ; preds = %24
store i32 0, i32* %2
br label %32
31: ; preds = %24, %18
store i32 10, i32* %2
br label %32
32: ; preds = %31, %30
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @parse_num_base(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %6 [
i8 43, label %3
i8 45, label %3
]
3: ; preds = %1, %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
br label %6
6: ; preds = %1, %3
%7 = phi i8 [ %2, %1 ], [ %5, %3 ]
%8 = phi i8* [ %0, %1 ], [ %4, %3 ]
%9 = icmp eq i8 %7, 48
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 120
br i1 %13, label %15, label %14
14: ; preds = %10, %6
br label %15
15: ; preds = %10, %14
%16 = phi i32 [ 10, %14 ], [ 0, %10 ]
ret i32 %16
}