xunge/DecIR huggingface dataset:
/* Type definitions */
struct tcp_ip_datagram {
  int dummy;
};

/* Variables and functions */
scalar_t__ checksum_ipv4_hdr(struct tcp_ip_datagram *);
scalar_t__ checksum_tcp_hdr(struct tcp_ip_datagram *);
int checksum_datagram(struct tcp_ip_datagram *datagram) {
  if (checksum_ipv4_hdr(datagram) != 0) {
    return -1;
  }
  if (checksum_tcp_hdr(datagram) != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checksum_datagram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <checksum_ipv4_hdr@plt>
cmp    $0x0,%rax
je     114b <checksum_datagram+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <checksum_datagram+0x51>
mov    -0x10(%rbp),%rdi
call   1040 <checksum_tcp_hdr@plt>
cmp    $0x0,%rax
je     116a <checksum_datagram+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <checksum_datagram+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checksum_datagram>:
push   %rbx
mov    %rdi,%rbx
call   1030 <checksum_ipv4_hdr@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <checksum_datagram+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <checksum_tcp_hdr@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tcp_ip_datagram = type { i32 }
define i32 @checksum_datagram(%struct.tcp_ip_datagram* %0) {
%2 = alloca i32
%3 = alloca %struct.tcp_ip_datagram*
store %struct.tcp_ip_datagram* %0, %struct.tcp_ip_datagram** %3
%4 = load %struct.tcp_ip_datagram*, %struct.tcp_ip_datagram** %3
%5 = call i64 @checksum_ipv4_hdr(%struct.tcp_ip_datagram* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %14
8: ; preds = %1
%9 = load %struct.tcp_ip_datagram*, %struct.tcp_ip_datagram** %3
%10 = call i64 @checksum_tcp_hdr(%struct.tcp_ip_datagram* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.tcp_ip_datagram = type { i32 }
define i32 @checksum_datagram(%struct.tcp_ip_datagram* %0) {
%2 = tail call i64 @checksum_ipv4_hdr(%struct.tcp_ip_datagram* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @checksum_tcp_hdr(%struct.tcp_ip_datagram* %0)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
int size_roundup_power2(int size) {
  size--;
  size |= size >> 1;
  size |= size >> 2;
  size |= size >> 4;
  size |= size >> 8;
  size |= size >> 16;
  size++;
  return size;
}


x86 assembly (clang, -O0):
<size_roundup_power2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_roundup_power2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @size_roundup_power2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @size_roundup_power2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
void glGetProgramiv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetProgramiv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ioctl(int, int, int /*<<< orphan*/ *);
void cc1120_hw_reset(int fd) { ioctl(fd, 20, NULL); }


x86 assembly (clang, -O0):
<cc1120_hw_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x14,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc1120_hw_reset>:
mov    $0x14,%esi
xor    %edx,%edx
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
define void @cc1120_hw_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ioctl(i32 %3, i32 20, i32* null)
ret void
}

LLVM IR (-O2):
define void @cc1120_hw_reset(i32 %0) {
%2 = tail call i32 @ioctl(i32 %0, i32 20, i32* null)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int fsfr_base_flistxattr(int, char *, size_t);
int fsfr_filter_xattr(char *, int);
ssize_t flistxattr(int fd, char *list, size_t size) {
  int rtn = fsfr_base_flistxattr(fd, list, size);
  if (rtn > 0)
    return fsfr_filter_xattr(list, rtn);
  return rtn;
}


x86 assembly (clang, -O0):
<flistxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <fsfr_base_flistxattr@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1164 <flistxattr+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <fsfr_filter_xattr@plt>
mov    %eax,-0x4(%rbp)
jmp    116a <flistxattr+0x4a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flistxattr>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fsfr_base_flistxattr@plt>
test   %eax,%eax
jle    1138 <flistxattr+0x18>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <fsfr_filter_xattr@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @flistxattr(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @fsfr_base_flistxattr(i32 %0, i8* %1, i64 %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @fsfr_filter_xattr(i8* %1, i32 %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %4, %3 ]
ret i32 %9
}
int bitSwapRequired(int a, int b) {
  int c = a ^ b;
  int count = 0;
  while (c != 0) {
    count += c & 0x01;
    c = c >> 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<bitSwapRequired>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113e <bitSwapRequired+0x3e>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <bitSwapRequired+0x1a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitSwapRequired>:
xor    %eax,%eax
xor    %esi,%edi
je     1120 <bitSwapRequired+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitSwapRequired+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitSwapRequired(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 0, %2 ]
%7 = phi i32 [ %10, %5 ], [ %3, %2 ]
%8 = and i32 %7, 1
%9 = add nuw nsw i32 %6, %8
%10 = ashr i32 %7, 1
%11 = icmp ult i32 %7, 2
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %13
}
void cprop_result1(int *data) {
  int j = 9;
  data[0] = j;
}


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

x86 assembly (clang, -O2):
<cprop_result1>:
movl   $0x9,(%rdi)
ret

LLVM IR (-O0):
define void @cprop_result1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 9, i32* %3
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 %4, i32* %6
ret void
}

LLVM IR (-O2):
define void @cprop_result1(i32* nocapture writeonly %0) {
store i32 9, i32* %0
ret void
}
/* Variables and functions */
int ds2isprotected();
int ds2isprotected_(void) {
  int result = ds2isprotected();
  return result;
}


x86 assembly (clang, -O0):
<ds2isprotected_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ds2isprotected@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ds2isprotected_() {
%1 = alloca i32
%2 = call i32 (...) @ds2isprotected()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @ds2isprotected_() {
%1 = tail call i32 (...) @ds2isprotected()
ret i32 %1
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long currusec(void) {
  struct timeval tv;
  long long usec;
  gettimeofday(&tv, NULL);
  usec = tv.tv_sec * 1000000;
  usec += tv.tv_usec;
  return usec;
}


x86 assembly (clang, -O0):
<currusec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currusec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @currusec() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
store i64 %7, i64* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = load i64, i64* %2
%11 = add nsw i64 %10, %9
store i64 %11, i64* %2
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @currusec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
int simple3(void) {
  int array[10] = {1, 2, 3};
  return array[1];
}


x86 assembly (clang, -O0):
<simple3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movl   $0x1,-0x30(%rbp)
movl   $0x2,-0x2c(%rbp)
movl   $0x3,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @simple3() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = bitcast i8* %2 to [10 x i32]*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i32 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i32 0, i32 1
store i32 2, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i32 0, i32 2
store i32 3, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @simple3() {
ret i32 2
}
int fun1327() { return 1327; }


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

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

LLVM IR (-O0):
define i32 @fun1327() {
ret i32 1327
}

LLVM IR (-O2):
define i32 @fun1327() {
ret i32 1327
}
void a(int i) { ; }


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

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

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

LLVM IR (-O2):
define void @a(i32 %0) {
ret void
}
unsigned long long gccbugs_ullmul(unsigned long long a, unsigned long long b) {
  return a * b;
}


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

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

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

LLVM IR (-O2):
define i64 @gccbugs_ullmul(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
ret i64 %3
}
void delay_ms(int ms) {
  int i;
  while (ms--)
    for (i = 0; i < 0x10A; i++)
      __asm__("nop");
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1143 <delay_ms+0x43>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10a,-0x8(%rbp)
jge    113e <delay_ms+0x3e>
nop
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <delay_ms+0x22>
jmp    1107 <delay_ms+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
test   %edi,%edi
je     112b <delay_ms+0x2b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x10a,%eax
cs nopw 0x0(%rax,%rax,1)
nop
nop
add    $0xffffffff,%eax
jne    1120 <delay_ms+0x20>
add    $0xffffffff,%edi
jne    1110 <delay_ms+0x10>
ret

LLVM IR (-O0):
define void @delay_ms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %17
8: ; preds = %4
store i32 0, i32* %3
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 266
br i1 %11, label %12, label %16
12: ; preds = %9
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %9
16: ; preds = %9
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %6
3: ; preds = %8
%4 = add nsw i32 %7, -1
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ %0, %1 ]
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ 0, %6 ], [ %10, %8 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%10 = add nuw nsw i32 %9, 1
%11 = icmp eq i32 %10, 266
br i1 %11, label %3, label %8
12: ; preds = %3, %1
ret void
}
double min3d(double x, double y, double z) {
  return (z < y) ? ((z < x) ? z : x) : ((y < x) ? y : x);
}


x86 assembly (clang, -O0):
<min3d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1163 <min3d+0x63>
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114a <min3d+0x4a>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1154 <min3d+0x54>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    119a <min3d+0x9a>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1186 <min3d+0x86>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1190 <min3d+0x90>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3d>:
minsd  %xmm1,%xmm2
minsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @min3d(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load double, double* %6
%12 = load double, double* %4
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load double, double* %6
br label %18
16: ; preds = %10
%17 = load double, double* %4
br label %18
18: ; preds = %16, %14
%19 = phi double [ %15, %14 ], [ %17, %16 ]
br label %30
20: ; preds = %3
%21 = load double, double* %5
%22 = load double, double* %4
%23 = fcmp olt double %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load double, double* %5
br label %28
26: ; preds = %20
%27 = load double, double* %4
br label %28
28: ; preds = %26, %24
%29 = phi double [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %18
%31 = phi double [ %19, %18 ], [ %29, %28 ]
ret double %31
}

LLVM IR (-O2):
define double @min3d(double %0, double %1, double %2) {
%4 = fcmp olt double %2, %1
%5 = fcmp olt double %2, %0
%6 = select i1 %5, double %2, double %0
%7 = fcmp olt double %1, %0
%8 = select i1 %7, double %1, double %0
%9 = select i1 %4, double %6, double %8
ret double %9
}
/* Variables and functions */
char *source_out0(char const *, char);
char *source_out(const char *p) { return source_out0(p, '\0'); }


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

x86 assembly (clang, -O2):
<source_out>:
xor    %esi,%esi
jmp    1030 <source_out0@plt>

LLVM IR (-O0):
define i8* @source_out(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @source_out0(i8* %3, i8 signext 0)
ret i8* %4
}

LLVM IR (-O2):
define i8* @source_out(i8* %0) {
%2 = tail call i8* @source_out0(i8* %0, i8 signext 0)
ret i8* %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int64_t LengthRead(char *messageFileName) {
  struct stat st;
  stat(messageFileName, &st);
  return st.st_size;
}


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

x86 assembly (clang, -O2):
<LengthRead>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @LengthRead(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @LengthRead(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
double f(double x, double y) { return ((2 * (x) * (x)) + (2 * (y))); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xed8(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double 2.000000e+00, %5
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fmul double 2.000000e+00, %8
%10 = call double @llvm.fmuladd.f64(double %6, double %7, double %9)
ret double %10
}

LLVM IR (-O2):
define double @f(double %0, double %1) {
%3 = fmul double %0, 2.000000e+00
%4 = fmul double %1, 2.000000e+00
%5 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %4)
ret double %5
}
cbuf4(f, n) int f, n;
{ cbuf(f, n, 4); }


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

x86 assembly (clang, -O2):
<cbuf4>:
mov    $0x4,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 4)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf4(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 4)
ret i32 undef
}
unsigned int CharClass_IsWhiteSpace(char ch) {
  return (((ch == ' ') || (ch == (char)015)) || (ch == (char)012)) ||
         (ch == (char)011);
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<CharClass_IsWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <CharClass_IsWhiteSpace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <CharClass_IsWhiteSpace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <CharClass_IsWhiteSpace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharClass_IsWhiteSpace>:
cmp    $0x20,%dil
ja     1120 <CharClass_IsWhiteSpace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002400,%rdx
bt     %rcx,%rdx
jae    1120 <CharClass_IsWhiteSpace+0x20>
ret
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @CharClass_IsWhiteSpace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 13
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @CharClass_IsWhiteSpace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ alwaysInline();
void use100() { alwaysInline(); }


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

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

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

LLVM IR (-O2):
define void @use100() {
%1 = tail call i32 (...) @alwaysInline()
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int time_diff(struct timeval *now, struct timeval *then) {
  return (then->tv_sec - now->tv_sec) * 1000000 +
         (then->tv_usec - now->tv_usec);
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x8(%rbp),%rdx
sub    0x4(%rdx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
mov    (%rsi),%ecx
mov    0x4(%rsi),%eax
sub    (%rdi),%ecx
imul   $0xf4240,%ecx,%ecx
sub    0x4(%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @time_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000
%13 = load %struct.timeval*, %struct.timeval** %4
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.timeval*, %struct.timeval** %3
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = sub nsw i32 %15, %18
%20 = add nsw i32 %12, %19
ret i32 %20
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @time_diff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%12 = load i32, i32* %11
%13 = sub i32 %10, %12
%14 = add nsw i32 %13, %8
ret i32 %14
}
unsigned long blz_hash4(const unsigned char *s) {
  unsigned long val = (unsigned long)s[0] | ((unsigned long)s[1] << 8) |
                      ((unsigned long)s[2] << 16) | ((unsigned long)s[3] << 24);
  return ((val * 2654435761UL) & 0xFFFFFFFFUL) >> (32 - 17);
}


x86 assembly (clang, -O0):
<blz_hash4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
movabs $0x9e3779b1,%rax
imul   -0x10(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
shr    $0xf,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blz_hash4>:
imul   $0x9e3779b1,(%rdi),%eax
shr    $0xf,%eax
ret

LLVM IR (-O0):
define i64 @blz_hash4(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl i64 %11, 8
%13 = or i64 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = shl i64 %17, 16
%19 = or i64 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i64
%24 = shl i64 %23, 24
%25 = or i64 %19, %24
store i64 %25, i64* %3
%26 = load i64, i64* %3
%27 = mul i64 %26, 2654435761
%28 = and i64 %27, 4294967295
%29 = lshr i64 %28, 15
ret i64 %29
}

LLVM IR (-O2):
define i64 @blz_hash4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
%19 = mul nuw i64 %18, 2654435761
%20 = lshr i64 %19, 15
%21 = and i64 %20, 131071
ret i64 %21
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
char *strecat(char const *, char *, char const *, char *, int /*<<< orphan*/ *);
FILE *try_font(const char *dir, const char *fontname) {
  char *path = strecat(dir, "/fonts/", fontname, ".pfa", NULL);
  FILE *res = fopen(path, "r");
  free(path);
  return res;
}


x86 assembly (clang, -O0):
<try_font>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
lea    0xeb2(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <strecat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_font>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rdx
lea    0xec2(%rip),%rsi
lea    0xec3(%rip),%rcx
xor    %r8d,%r8d
call   1030 <strecat@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rsi
mov    %rax,%rdi
call   1050 <fopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/fonts/\00"
@.str.1 = [5 x i8] c".pfa\00"
@.str.2 = [2 x i8] c"r\00"
define i32* @try_font(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @strecat(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %11, i32** %6
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
%14 = load i32*, i32** %6
ret i32* %14
}

LLVM IR (-O2):
@.str = [8 x i8] c"/fonts/\00"
@.str.1 = [5 x i8] c".pfa\00"
@.str.2 = [2 x i8] c"r\00"
define noalias i32* @try_font(i8* %0, i8* %1) {
%3 = tail call i8* @strecat(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
%4 = tail call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @free(i8* %3)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int x = 10, a, b, n;
  unsigned c;
  scanf("%d", &n);
  a = x >> n;
  c = 0xffff;
  c = c >> (16 - n);
  b = x & c;
  b = b << (16 - n);
  printf("%d", a | b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
movl   $0xffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
or     -0xc(%rbp),%esi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%cl
mov    $0xa,%edx
shr    %cl,%edx
mov    $0x10,%al
sub    %cl,%al
mov    $0xffff,%esi
mov    %eax,%ecx
shr    %cl,%esi
and    $0xa,%esi
shl    %cl,%esi
or     %edx,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 10, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%7 = load i32, i32* %1
%8 = load i32, i32* %4
%9 = ashr i32 %7, %8
store i32 %9, i32* %2
store i32 65535, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = sub nsw i32 16, %11
%13 = lshr i32 %10, %12
store i32 %13, i32* %5
%14 = load i32, i32* %1
%15 = load i32, i32* %5
%16 = and i32 %14, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = sub nsw i32 16, %18
%20 = shl i32 %17, %19
store i32 %20, i32* %3
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = or i32 %21, %22
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = lshr i32 10, %4
%6 = sub nsw i32 16, %4
%7 = lshr i32 65535, %6
%8 = and i32 %7, 10
%9 = shl i32 %8, %6
%10 = or i32 %9, %5
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int day;
  scanf("%d", &day);
  if (day == 366) {
    printf("yes\n");
  } else if (day == 365) {
    printf("no\n");
  } else {
    printf("«Invalid param»\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x16e,-0x8(%rbp)
jne    115d <main+0x3d>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x6c>
cmpl   $0x16d,-0x8(%rbp)
jne    117b <main+0x5b>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <main+0x67>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x6c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x16d,%eax
lea    0xed3(%rip),%rcx
lea    0xeba(%rip),%rdx
cmove  %rcx,%rdx
cmp    $0x16e,%eax
lea    0xebf(%rip),%rdi
cmovne %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
@.str.3 = [19 x i8] c"\C2\ABInvalid param\C2\BB\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 366
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %16
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 365
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %15
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [18 x i8] c"\C2\ABInvalid param\C2\BB\00"
@str.4 = [3 x i8] c"no\00"
@str.5 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 365
%6 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0)
%7 = icmp eq i32 %4, 366
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.5, i64 0, i64 0), i8* %6
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_node_count_statistics();
void soar_ecPrintReteStatistics(void) {
  print_node_count_statistics();
  {};
}


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

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

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

LLVM IR (-O2):
define void @soar_ecPrintReteStatistics() {
%1 = tail call i32 (...) @print_node_count_statistics()
ret void
}
unsigned short hash_sip_dip(unsigned int sip, unsigned int dip) {
  unsigned short ht = dip ^ sip;
  unsigned short ht_l16 = (ht & 0xFFFF0000 >> 16);
  unsigned short ht_h16 = (ht & 0xFFFF);
  unsigned short ht16 = ht_l16 ^ ht_h16;
  unsigned short ht16_h4 = (ht16 & 0xF000);
  unsigned short ht16_m4 = (ht16 & 0x0F00);
  unsigned short ht4 = ht16_h4 ^ ht16_m4;
  unsigned char ht_l8 = ht16 & 0xFF;
  unsigned short ht12 = ht_l8 | (ht4 << 8);
  return ht12 >> 2;
}


x86 assembly (clang, -O0):
<hash_sip_dip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0xc(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0xe(%rbp)
movzwl -0xc(%rbp),%eax
movzwl -0xe(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0x10(%rbp)
movzwl -0x10(%rbp),%eax
and    $0xf000,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x10(%rbp),%eax
and    $0xf00,%eax
mov    %ax,-0x14(%rbp)
movzwl -0x12(%rbp),%eax
movzwl -0x14(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0x16(%rbp)
movzwl -0x10(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x17(%rbp)
movzbl -0x17(%rbp),%eax
movzwl -0x16(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
sar    $0x2,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @hash_sip_dip(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i8
%13 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = xor i32 %14, %15
%17 = trunc i32 %16 to i16
store i16 %17, i16* %5
%18 = load i16, i16* %5
%19 = zext i16 %18 to i32
%20 = and i32 %19, 65535
%21 = trunc i32 %20 to i16
store i16 %21, i16* %6
%22 = load i16, i16* %5
%23 = zext i16 %22 to i32
%24 = and i32 %23, 65535
%25 = trunc i32 %24 to i16
store i16 %25, i16* %7
%26 = load i16, i16* %6
%27 = zext i16 %26 to i32
%28 = load i16, i16* %7
%29 = zext i16 %28 to i32
%30 = xor i32 %27, %29
%31 = trunc i32 %30 to i16
store i16 %31, i16* %8
%32 = load i16, i16* %8
%33 = zext i16 %32 to i32
%34 = and i32 %33, 61440
%35 = trunc i32 %34 to i16
store i16 %35, i16* %9
%36 = load i16, i16* %8
%37 = zext i16 %36 to i32
%38 = and i32 %37, 3840
%39 = trunc i32 %38 to i16
store i16 %39, i16* %10
%40 = load i16, i16* %9
%41 = zext i16 %40 to i32
%42 = load i16, i16* %10
%43 = zext i16 %42 to i32
%44 = xor i32 %41, %43
%45 = trunc i32 %44 to i16
store i16 %45, i16* %11
%46 = load i16, i16* %8
%47 = zext i16 %46 to i32
%48 = and i32 %47, 255
%49 = trunc i32 %48 to i8
store i8 %49, i8* %12
%50 = load i8, i8* %12
%51 = zext i8 %50 to i32
%52 = load i16, i16* %11
%53 = zext i16 %52 to i32
%54 = shl i32 %53, 8
%55 = or i32 %51, %54
%56 = trunc i32 %55 to i16
store i16 %56, i16* %13
%57 = load i16, i16* %13
%58 = zext i16 %57 to i32
%59 = ashr i32 %58, 2
%60 = trunc i32 %59 to i16
ret i16 %60
}

LLVM IR (-O2):
define zeroext i16 @hash_sip_dip(i32 %0, i32 %1) {
ret i16 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
long to_millis(struct timeval tv) {
  long ret = 0;
  ret += tv.tv_sec * 1000;
  ret += tv.tv_usec / 1000;
  return ret;
}


x86 assembly (clang, -O0):
<to_millis>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x8(%rbp),%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_millis>:
movabs $0x3e800000000,%rcx
imul   %rdi,%rcx
sar    $0x20,%rcx
sar    $0x20,%rdi
imul   $0x10624dd3,%rdi,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @to_millis(i64 %0) {
%2 = alloca %struct.timeval
%3 = alloca i64
%4 = bitcast %struct.timeval* %2 to i64*
store i64 %0, i64* %4
store i64 0, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = sext i32 %7 to i64
%9 = load i64, i64* %3
%10 = add nsw i64 %9, %8
store i64 %10, i64* %3
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%12 = load i32, i32* %11
%13 = sdiv i32 %12, 1000
%14 = sext i32 %13 to i64
%15 = load i64, i64* %3
%16 = add nsw i64 %15, %14
store i64 %16, i64* %3
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @to_millis(i64 %0) {
%2 = lshr i64 %0, 32
%3 = trunc i64 %2 to i32
%4 = mul i64 %0, 4294967296000
%5 = ashr exact i64 %4, 32
%6 = sdiv i32 %3, 1000
%7 = sext i32 %6 to i64
%8 = add nsw i64 %5, %7
ret i64 %8
}
/* Variables and functions */
unsigned long get_error_values(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *);
unsigned long ERR_peek_error(void) {
  return (get_error_values(0, 0, NULL, NULL, NULL, NULL));
}


x86 assembly (clang, -O0):
<ERR_peek_error>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%r9d
mov    %esi,%edi
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <get_error_values@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_peek_error>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <get_error_values@plt>

LLVM IR (-O0):
define i64 @ERR_peek_error() {
%1 = call i64 @get_error_values(i32 0, i32 0, i32* null, i32* null, i32* null, i32* null)
ret i64 %1
}

LLVM IR (-O2):
define i64 @ERR_peek_error() {
%1 = tail call i64 @get_error_values(i32 0, i32 0, i32* null, i32* null, i32* null, i32* null)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *free_object(void *obj) {
  if (obj != NULL)
    free(obj);
  return NULL;
}


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

x86 assembly (clang, -O2):
<free_object>:
test   %rdi,%rdi
je     111f <free_object+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @free_object(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 i8* null
}

LLVM IR (-O2):
define noalias i8* @free_object(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 i8* null
}
/* Variables and functions */
int YabThreadStart(unsigned int id, void (*func)(void *), void *arg) {
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @YabThreadStart(i32 %0, void (i8*)* %1, i8* %2) {
%4 = alloca i32
%5 = alloca void (i8*)*
%6 = alloca i8*
store i32 %0, i32* %4
store void (i8*)* %1, void (i8*)** %5
store i8* %2, i8** %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @YabThreadStart(i32 %0, void (i8*)* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
double ones() { return 1.0; }


x86 assembly (clang, -O0):
<ones>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ones() {
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @ones() {
ret double 1.000000e+00
}