xunge/DecIR huggingface dataset:
const char *_Locale_false(struct _Locale_numeric *lnum
                          __attribute__((__unused__))) {
  return "false";
}


x86 assembly (clang, -O0):
<_Locale_false>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_false>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct._Locale_numeric = type opaque
@.str = [6 x i8] c"false\00"
define i8* @_Locale_false(%struct._Locale_numeric* %0) {
%2 = alloca %struct._Locale_numeric*
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %2
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct._Locale_numeric = type opaque
@.str = [6 x i8] c"false\00"
define i8* @_Locale_false(%struct._Locale_numeric* nocapture readnone %0) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int htonl(int);
int /*<<< orphan*/ isBigEndian();
uint64_t htonll(uint64_t value) {
  if (!isBigEndian()) {
    uint32_t high_part = htonl((uint32_t)(value >> 32));
    uint32_t low_part = htonl((uint32_t)(value & 0xFFFFFFFFULL));
    return (uint64_t)(((uint64_t)low_part) << 32) | high_part;
  } else {
    return value;
  }
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <isBigEndian@plt>
cmp    $0x0,%eax
jne    117d <htonll+0x5d>
mov    -0x8(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1040 <htonl@plt>
mov    %eax,-0xc(%rbp)
movslq -0x8(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1040 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <htonll+0x63>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <isBigEndian@plt>
test   %eax,%eax
jne    113a <htonll+0x1a>
call   1040 <htonl@plt>
mov    %ebx,%edi
call   1040 <htonl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @htonll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = call i32 (...) @isBigEndian()
%7 = icmp ne i32 %6, 0
br i1 %7, label %21, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = ashr i32 %9, 32
%11 = call i32 @htonl(i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = and i64 %13, 4294967295
%15 = trunc i64 %14 to i32
%16 = call i32 @htonl(i32 %15)
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = shl i32 %17, 32
%19 = load i32, i32* %4
%20 = or i32 %18, %19
store i32 %20, i32* %2
br label %23
21: ; preds = %1
%22 = load i32, i32* %3
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %8
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @htonll(i32 returned %0) {
%2 = tail call i32 (...) @isBigEndian()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @htonl(i32 poison)
%6 = tail call i32 @htonl(i32 %0)
br label %7
7: ; preds = %1, %4
ret i32 %0
}
/* Variables and functions */
int open(char const *, int);
int /*<<< orphan*/ perror(char *);
int i2cdev_open(const char *path, int flags) {
  int fd = 0;
  fd = open(path, flags);
  if (fd < 0) {
    perror("i2c_open failed");
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<i2cdev_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1167 <i2cdev_open+0x47>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <i2cdev_open+0x4d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2cdev_open>:
push   %rax
call   1030 <open@plt>
test   %eax,%eax
js     112c <i2cdev_open+0xc>
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"i2c_open failed\00"
define i32 @i2cdev_open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ %3, %2 ]
ret i32 %8
}
void setPieceAt(char *board, int row, int col, char pieceId) {
  board[row * 8 + col] = pieceId;
}


x86 assembly (clang, -O0):
<setPieceAt>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPieceAt>:
lea    (%rdx,%rsi,8),%eax
cltq
mov    %cl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @setPieceAt(i8* %0, i32 %1, i32 %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%9 = load i8, i8* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = mul nsw i32 %11, 8
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %10, i64 %15
store i8 %9, i8* %16
ret void
}

LLVM IR (-O2):
define void @setPieceAt(i8* nocapture writeonly %0, i32 %1, i32 %2, i8 signext %3) {
%5 = shl nsw i32 %1, 3
%6 = add nsw i32 %5, %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %3, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EnableZigbee();
int zgb_hal_open(int devIndex, float baudrate) {
  EnableZigbee();
  return 1;
}


x86 assembly (clang, -O0):
<zgb_hal_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <EnableZigbee@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zgb_hal_open>:
push   %rax
xor    %eax,%eax
call   1030 <EnableZigbee@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @zgb_hal_open(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = call i32 (...) @EnableZigbee()
ret i32 1
}

LLVM IR (-O2):
define i32 @zgb_hal_open(i32 %0, float %1) {
%3 = tail call i32 (...) @EnableZigbee()
ret i32 1
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__u32 ceph_frag_bits(__u32 f) { return f >> 24; }


x86 assembly (clang, -O0):
<ceph_frag_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_frag_bits>:
mov    %edi,%eax
sar    $0x18,%eax
ret

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

LLVM IR (-O2):
define i32 @ceph_frag_bits(i32 %0) {
%2 = ashr i32 %0, 24
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ueBytesFromChar(char const);
int ueStrLen(const char *str) {
  int length = 0;
  const char *strptr = str;
  while (strptr[0] != '\0') {
    strptr += ueBytesFromChar(strptr[0]);
    ++length;
  }
  return length;
}


x86 assembly (clang, -O0):
<ueStrLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <ueStrLen+0x55>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ueBytesFromChar@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <ueStrLen+0x1b>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ueStrLen>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <ueStrLen+0x2c>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <ueBytesFromChar@plt>
movslq %eax,%rcx
movzbl (%r14,%rcx,1),%eax
add    %rcx,%r14
add    $0x1,%ebx
test   %al,%al
jne    1120 <ueStrLen+0x10>
jmp    113e <ueStrLen+0x2e>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ueStrLen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = tail call i32 @ueBytesFromChar(i8 signext %5)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = add nuw nsw i32 %7, 1
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
int subs_si_test1(int a, int b, int c) {
  int d = a - c;
  if (d == 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<subs_si_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    112e <subs_si_test1+0x2e>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <subs_si_test1+0x3a>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subs_si_test1>:
cmp    %edx,%edi
cmove  %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @subs_si_test1(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* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = add nsw i32 %15, %16
store i32 %17, i32* %4
br label %24
18: ; preds = %3
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
store i32 %23, i32* %4
br label %24
24: ; preds = %18, %14
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @subs_si_test1(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %2
%5 = select i1 %4, i32 %2, i32 %1
%6 = add i32 %5, %0
ret i32 %6
}
const char *STRV_IFNOTNULL(const char *x) { return x ? x : ((const char *)-1); }


x86 assembly (clang, -O0):
<STRV_IFNOTNULL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <STRV_IFNOTNULL+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <STRV_IFNOTNULL+0x30>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <STRV_IFNOTNULL+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<STRV_IFNOTNULL>:
cmp    $0x1,%rdi
sbb    %rax,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i8* @STRV_IFNOTNULL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ inttoptr (i64 -1 to i8*), %7 ]
ret i8* %9
}

LLVM IR (-O2):
define i8* @STRV_IFNOTNULL(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* inttoptr (i64 -1 to i8*), i8* %0
ret i8* %3
}
/* Variables and functions */
scalar_t__ atof(char *);
int atoi(char s[]) { return (int)atof(s); }


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

x86 assembly (clang, -O2):
<atoi>:
jmp    1030 <atof@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atof(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @atof(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int shutdown(int, int);
int shutdown_socket(int fd, int how) { return shutdown(fd, how); }


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

x86 assembly (clang, -O2):
<shutdown_socket>:
jmp    1030 <shutdown@plt>

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

LLVM IR (-O2):
define i32 @shutdown_socket(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
ret i32 %3
}
void unmap_sysmem(const void *vaddr) {}


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

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

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

LLVM IR (-O2):
define void @unmap_sysmem(i8* nocapture %0) {
ret void
}
void ff_hevc_put_hevc_bi_w_qpel_h12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_h12_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_hex_actual(void *, int, int);
void dump_hex_relative(void *pp, int len) { dump_hex_actual(pp, len, 1); }


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

x86 assembly (clang, -O2):
<dump_hex_relative>:
mov    $0x1,%edx
jmp    1030 <dump_hex_actual@plt>

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

LLVM IR (-O2):
define void @dump_hex_relative(i8* %0, i32 %1) {
%3 = tail call i32 @dump_hex_actual(i8* %0, i32 %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sfree(void *p) {
  if (p) {
    free(p);
  }
}


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

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

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

LLVM IR (-O2):
define void @sfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ unlink(char *);
void put_md_name(char *name) {
  if (strncmp(name, "/dev/.tmp.md", 12) == 0)
    unlink(name);
}


x86 assembly (clang, -O0):
<put_md_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1154 <put_md_name+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_md_name>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     113c <put_md_name+0x1c>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <unlink@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/.tmp.md\00"
define void @put_md_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @unlink(i8* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/.tmp.md\00"
define void @put_md_name(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unlink(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_basics() {
  printf("artemis - (C) 2013 Greg Berenfield\nReleased under the GNU "
         "GPL.\n\nUsage: artemis [-o <output>] [-f <word-file> | \"string of "
         "space-separated words\"]\n");
}


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

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

LLVM IR (-O0):
@.str = [147 x i8] c"artemis - (C) 2013 Greg Berenfield\0AReleased under the GNU GPL.\0A\0AUsage: artemis [-o <output>] [-f <word-file> | \22string of space-separated words\22]\0A\00"
define void @show_basics() {
%1 = call i32 @printf(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [146 x i8] c"artemis - (C) 2013 Greg Berenfield\0AReleased under the GNU GPL.\0A\0AUsage: artemis [-o <output>] [-f <word-file> | \22string of space-separated words\22]\00"
define void @show_basics() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([146 x i8], [146 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int partition(int, int, int *);
void quicksort_helper(int p, int r, int arr[]) {
  if (p < r) {
    int q = partition(p, r, arr);
    quicksort_helper(p + 1, q, arr);
    quicksort_helper(q + 1, r, arr);
  }
}


x86 assembly (clang, -O0):
<quicksort_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1174 <quicksort_helper+0x54>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <quicksort_helper@plt>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <quicksort_helper@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort_helper>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edi
jge    1168 <quicksort_helper+0x48>
mov    %rdx,%r14
mov    %esi,%r15d
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   1030 <partition@plt>
mov    %eax,%ebp
add    $0x1,%ebx
mov    %ebx,%edi
mov    %eax,%esi
mov    %r14,%rdx
call   1040 <quicksort_helper@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r15d,%ebp
jl     1140 <quicksort_helper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort_helper(i32 %0, i32 %1, i32* %2) {
%4 = icmp slt i32 %0, %1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %0, %3 ]
%7 = tail call i32 @partition(i32 %6, i32 %1, i32* %2)
%8 = add nsw i32 %6, 1
tail call void @quicksort_helper(i32 %8, i32 %7, i32* %2)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %1
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
volatile unsigned long readtsc() {
  unsigned long tsc;
  asm("rdtsc" : "=A"(tsc));
  return tsc;
}


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

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

LLVM IR (-O0):
define i64 @readtsc() {
%1 = alloca i64
%2 = call i64 asm "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @readtsc() {
%1 = tail call i64 asm "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void foo174(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo174(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
void set_XKeyReleasedEvent_send_event(void *_p, int _v) {
  ((XKeyReleasedEvent *)_p)->send_event = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XKeyReleasedEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int syscall(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int chown(const char *path, uid_t uid, gid_t gid) {
  return syscall(182, path, uid, gid);
}


x86 assembly (clang, -O0):
<chown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0xb6,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chown>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xb6,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @chown(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 182, i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ raise_lower_command(int /*<<< orphan*/);
void raise_command(void) { raise_lower_command(0); }


x86 assembly (clang, -O0):
<raise_command>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <raise_lower_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise_command>:
xor    %edi,%edi
jmp    1030 <raise_lower_command@plt>

LLVM IR (-O0):
define void @raise_command() {
%1 = call i32 @raise_lower_command(i32 0)
ret void
}

LLVM IR (-O2):
define void @raise_command() {
%1 = tail call i32 @raise_lower_command(i32 0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XFocusOutEvent;

/* Variables and functions */
void *get_XFocusOutEvent_display(void *_p) {
  return (void *)((XFocusOutEvent *)_p)->display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XFocusOutEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show(const unsigned arr[], unsigned els) {
  if (els > 0) {
    printf("  %u", arr[0]);
    show(arr + 1, els - 1);
  } else {
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1165 <show+0x45>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <show@plt>
jmp    1173 <show+0x53>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1157 <show+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    %ebx,%r12d
jne    1140 <show+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" %u\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @show(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 = icmp ugt i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %4
%15 = sub i32 %14, 1
br label %18
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %7
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" %u\00"
define void @show(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i32* [ %9, %4 ], [ %0, %2 ]
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = add i32 %5, -1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _databus_sem_op(int);
void _databus_unlock() { _databus_sem_op(1); }


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

x86 assembly (clang, -O2):
<_databus_unlock>:
mov    $0x1,%edi
jmp    1030 <_databus_sem_op@plt>

LLVM IR (-O0):
define void @_databus_unlock() {
%1 = call i32 @_databus_sem_op(i32 1)
ret void
}

LLVM IR (-O2):
define void @_databus_unlock() {
%1 = tail call i32 @_databus_sem_op(i32 1)
ret void
}
/* Variables and functions */
double atof(char *);
int atoi(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("%f\n", atof("2520.3307"));
  printf("%d\n", atoi("2520.3307"));
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb9(%rip),%rdi
call   1030 <atof@plt>
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1060 <atoi@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [10 x i8] c"2520.3307\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = call double @atof(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
%3 = call i32 @atoi(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [10 x i8] c"2520.3307\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = tail call double @atof(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call i32 @atoi(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ossd_fill_screen(int /*<<< orphan*/);
void ossd_cls(void) { ossd_fill_screen(0); }


x86 assembly (clang, -O0):
<ossd_cls>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <ossd_fill_screen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ossd_cls>:
xor    %edi,%edi
jmp    1030 <ossd_fill_screen@plt>

LLVM IR (-O0):
define void @ossd_cls() {
%1 = call i32 @ossd_fill_screen(i32 0)
ret void
}

LLVM IR (-O2):
define void @ossd_cls() {
%1 = tail call i32 @ossd_fill_screen(i32 0)
ret void
}
void av_gcd_q() {}


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

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

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

LLVM IR (-O2):
define void @av_gcd_q() {
ret void
}
void gdk_screen_get_toplevel_windows() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_toplevel_windows() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_Laurent_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(784, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_Laurent_start_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x310,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_Laurent_start_system_to_container>:
mov    $0x310,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_dobldobl_Laurent_start_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 784, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_dobldobl_Laurent_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 784, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void rop3_176_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D | stk3;
  stk1 = T & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_176_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 -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%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_176_1_0>:
mov    (%rdi),%al
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_176_1_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* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or 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 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_176_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %1
%7 = and i8 %4, %2
%8 = or i8 %6, %7
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void rvr_wait() { sleep(1); }


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

x86 assembly (clang, -O2):
<rvr_wait>:
mov    $0x1,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @rvr_wait() {
%1 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @rvr_wait() {
%1 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test() {
  static int b;
  b = 1;
  printf("test %d\n", b);
  return b;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,0x2f0e(%rip)
mov    0x2f08(%rip),%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ef6(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
movb   $0x1,0x2f14(%rip)
lea    0xee1(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
movzbl 0x2efc(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
@test.b = internal global i32 0
@.str = [9 x i8] c"test %d\0A\00"
define i32 @test() {
store i32 1, i32* @test.b
%1 = load i32, i32* @test.b
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @test.b
ret i32 %3
}

LLVM IR (-O2):
@test.b = internal unnamed_addr global i1 false
@.str = [9 x i8] c"test %d\0A\00"
define i32 @test() {
store i1 true, i1* @test.b
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = load i1, i1* @test.b
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char thermo_lo_threshold_get();
int /*<<< orphan*/ thermo_lo_threshold_set(char);
void thermo_lo_threshold_dec() {
  char val;
  val = thermo_lo_threshold_get();
  if (val == (128))
    return;
  if (val > (-55)) {
    val--;
    thermo_lo_threshold_set(val);
  }
}


x86 assembly (clang, -O0):
<thermo_lo_threshold_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <thermo_lo_threshold_get@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x80,%eax
jne    1146 <thermo_lo_threshold_dec+0x26>
jmp    1164 <thermo_lo_threshold_dec+0x44>
movsbl -0x1(%rbp),%eax
cmp    $0xffffffc9,%eax
jle    1164 <thermo_lo_threshold_dec+0x44>
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <thermo_lo_threshold_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thermo_lo_threshold_dec>:
push   %rax
xor    %eax,%eax
call   1030 <thermo_lo_threshold_get@plt>
cmp    $0xca,%al
jl     1137 <thermo_lo_threshold_dec+0x17>
add    $0xff,%al
movsbl %al,%edi
pop    %rax
jmp    1040 <thermo_lo_threshold_set@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @thermo_lo_threshold_dec() {
%1 = alloca i8
%2 = call signext i8 (...) @thermo_lo_threshold_get()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %0
br label %16
7: ; preds = %0
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, -55
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %1
%13 = add i8 %12, -1
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = call i32 @thermo_lo_threshold_set(i8 signext %14)
br label %16
16: ; preds = %6, %11, %7
ret void
}

LLVM IR (-O2):
define void @thermo_lo_threshold_dec() {
%1 = tail call signext i8 (...) @thermo_lo_threshold_get()
%2 = icmp sgt i8 %1, -55
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = add nsw i8 %1, -1
%5 = tail call i32 @thermo_lo_threshold_set(i8 signext %4)
br label %6
6: ; preds = %0, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int pbm_getint(int /*<<< orphan*/ *);
char pm_readmagicnumber(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void pbm_readpbminit(FILE *file, int *colsP, int *rowsP) {
  if (pm_readmagicnumber(file) != ('P' * 256 + '4')) {
    fprintf(stderr, "This is not a raw pbm file.\n");
    exit(-1);
  }
  *colsP = pbm_getint(file);
  *rowsP = pbm_getint(file);
}


x86 assembly (clang, -O0):
<pbm_readpbminit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pm_readmagicnumber@plt>
movsbl %al,%eax
cmp    $0x5034,%eax
je     118a <pbm_readpbminit+0x4a>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pbm_getint@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <pbm_getint@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbm_readpbminit>:
push   %rax
call   1040 <pm_readmagicnumber@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"This is not a raw pbm file.\0A\00"
define void @pbm_readpbminit(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = call signext i8 @pm_readmagicnumber(i32* %7)
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 20532
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %3
%16 = load i32*, i32** %4
%17 = call i32 @pbm_getint(i32* %16)
%18 = load i32*, i32** %5
store i32 %17, i32* %18
%19 = load i32*, i32** %4
%20 = call i32 @pbm_getint(i32* %19)
%21 = load i32*, i32** %6
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"This is not a raw pbm file.\0A\00"
define void @pbm_readpbminit(i32* %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call signext i8 @pm_readmagicnumber(i32* %0)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ fun();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  fork();
  int i = 1, j = 0120;
  if (1)
    fun();
  fork();
  for (i = 0; i < 3; i++) {
    j = 10 / (i - 1);
  }
  printf("%d\n", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x50,-0x18(%rbp)
mov    $0x0,%al
call   1030 <fun@plt>
mov    $0x0,%al
call   1050 <fork@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1199 <main+0x69>
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    $0xa,%eax
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <main+0x40>
mov    -0x18(%rbp),%esi
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = tail call i32 (...) @fun()
%5 = tail call i32 (...) @fork()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}