xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xd9() {
  Assert_real((isbdigit(217) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1090, ("isbdigit should be 0 for 0xd9"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0xd9>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x442,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0xd9>:
push   %rax
mov    $0xd9,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x442,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xd9\00"
define void @t_isbdigit_0xd9() {
%1 = call i64 @isbdigit(i32 217)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1090, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xd9\00"
define void @t_isbdigit_0xd9() {
%1 = tail call i64 @isbdigit(i32 217)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1090, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo(void) {
  int i;
  char *name;
  i = 5;
  name = "bob";
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"bob\00"
define void @foo() {
%1 = alloca i32
%2 = alloca i8*
store i32 5, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ FRGL_PNG_WriteInt32LE(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
void FRGL_AVI_UpdateSize(FILE *fd, int o) {
  int i;
  i = ftell(fd);
  fseek(fd, o, 0);
  FRGL_PNG_WriteInt32LE(fd, i - o - 4);
  fseek(fd, i, 0);
}


x86 assembly (clang, -O0):
<FRGL_AVI_UpdateSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
sub    -0xc(%rbp),%esi
sub    $0x4,%esi
call   1030 <FRGL_PNG_WriteInt32LE@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1050 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FRGL_AVI_UpdateSize>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ftell@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1050 <fseek@plt>
mov    %r14d,%esi
sub    %ebp,%esi
add    $0xfffffffc,%esi
mov    %rbx,%rdi
call   1030 <FRGL_PNG_WriteInt32LE@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %edx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fseek@plt>

LLVM IR (-O0):
define void @FRGL_AVI_UpdateSize(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @ftell(i32* %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = call i32 @fseek(i32* %8, i32 %9, i32 0)
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = sub nsw i32 %14, 4
%16 = call i32 @FRGL_PNG_WriteInt32LE(i32* %11, i32 %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = call i32 @fseek(i32* %17, i32 %18, i32 0)
ret void
}

LLVM IR (-O2):
define void @FRGL_AVI_UpdateSize(i32* %0, i32 %1) {
%3 = tail call i32 @ftell(i32* %0)
%4 = tail call i32 @fseek(i32* %0, i32 %1, i32 0)
%5 = sub i32 -4, %1
%6 = add i32 %5, %3
%7 = tail call i32 @FRGL_PNG_WriteInt32LE(i32* %0, i32 %6)
%8 = tail call i32 @fseek(i32* %0, i32 %3, i32 0)
ret void
}
signed long long int signedlonglongint_ignoring_longlong(signed long long int x,
                                                         long long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlonglongint_ignoring_longlong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglongint_ignoring_longlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_length_dobldobl_solution_string(int k, int *n) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(370, &k, n, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_length_dobldobl_solution_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x172,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_length_dobldobl_solution_string>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x172,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @solcon_length_dobldobl_solution_string(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 370, i32* %3, i32* %1, double* undef)
ret i32 %4
}
unsigned b(unsigned x, unsigned y) { return x & ((1U << y) - 1U); }


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

x86 assembly (clang, -O2):
<b>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @b(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 = shl i32 1, %6
%8 = sub i32 %7, 1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @b(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
void vx_unhold_task(struct task_struct *p, struct rq *rq) { return; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
%struct.rq = type opaque
define void @vx_unhold_task(%struct.task_struct* nocapture %0, %struct.rq* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_send_byte(char);
void uart_send_u8(unsigned char n) {
  static char hex_assic_table[] = "0123456789ABCDEF";
  unsigned char m;
  m = n >> 4;
  uart_send_byte(hex_assic_table[m & 15]);
  uart_send_byte(hex_assic_table[n & 15]);
}


x86 assembly (clang, -O0):
<uart_send_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2ef7(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_send_byte@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2edd(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_send_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send_u8>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rbx,%rax
shr    $0x4,%rax
lea    0xedc(%rip),%r14
movsbl (%rax,%r14,1),%edi
call   1030 <uart_send_byte@plt>
and    $0xf,%ebx
movsbl (%rbx,%r14,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <uart_send_byte@plt>

LLVM IR (-O0):
@uart_send_u8.hex_assic_table = internal global [17 x i8] c"0123456789ABCDEF\00"
define void @uart_send_u8(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = ashr i32 %5, 4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [17 x i8], [17 x i8]* @uart_send_u8.hex_assic_table, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = call i32 @uart_send_byte(i8 signext %13)
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = and i32 %16, 15
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [17 x i8], [17 x i8]* @uart_send_u8.hex_assic_table, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @uart_send_byte(i8 signext %20)
ret void
}

LLVM IR (-O2):
@uart_send_u8.hex_assic_table = internal unnamed_addr constant [17 x i8] c"0123456789ABCDEF\00"
define void @uart_send_u8(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @uart_send_u8.hex_assic_table, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @uart_send_byte(i8 signext %5)
%7 = and i8 %0, 15
%8 = zext i8 %7 to i64
%9 = getelementptr inbounds [17 x i8], [17 x i8]* @uart_send_u8.hex_assic_table, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @uart_send_byte(i8 signext %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arikkei_memcpy(unsigned char *, unsigned int,
                                  unsigned char const *, unsigned int);
scalar_t__ strlen(char const *);
unsigned int arikkei_memcpy_str(unsigned char *d, unsigned int d_len,
                                const unsigned char *s) {
  unsigned int s_len = (unsigned int)strlen((const char *)s);
  arikkei_memcpy(d, d_len, s, s_len);
  return s_len;
}


x86 assembly (clang, -O0):
<arikkei_memcpy_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <arikkei_memcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arikkei_memcpy_str>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1040 <arikkei_memcpy@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @arikkei_memcpy_str(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i32 @arikkei_memcpy(i8* %11, i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @arikkei_memcpy_str(i8* %0, i32 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @arikkei_memcpy(i8* %0, i32 %1, i8* %2, i32 %5)
ret i32 %5
}
/* Type definitions */
typedef unsigned long long uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ jenkins_hashlittle2(void const *, size_t, scalar_t__ *,
                                       scalar_t__ *);
uint64_t hash64(const void *data, size_t length) {
  uint32_t a = 0, b = 0;
  jenkins_hashlittle2(data, length, &a, &b);
  return ((uint64_t)a << 32ULL) | (uint64_t)b;
}


x86 assembly (clang, -O0):
<hash64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <jenkins_hashlittle2@plt>
mov    -0x18(%rbp),%rax
shl    $0x20,%rax
or     -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash64>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <jenkins_hashlittle2@plt>
mov    0x10(%rsp),%rax
shl    $0x20,%rax
or     0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @hash64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
store i64 0, i64* %6
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @jenkins_hashlittle2(i8* %7, i64 %8, i64* %5, i64* %6)
%10 = load i64, i64* %5
%11 = shl i64 %10, 32
%12 = load i64, i64* %6
%13 = or i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @hash64(i8* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%6 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%7 = call i32 @jenkins_hashlittle2(i8* %0, i64 %1, i64* %3, i64* %4)
%8 = load i64, i64* %3
%9 = shl i64 %8, 32
%10 = load i64, i64* %4
%11 = or i64 %9, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void ThreadYield() { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @ThreadYield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_udiv(void) {
  gen_pop();
  gen_call("ccudiv");
}


x86 assembly (clang, -O0):
<gen_udiv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_udiv>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ccudiv\00"
define void @gen_udiv() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ccudiv\00"
define void @gen_udiv() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(int argc, char *argv[]) {
  printf("\n  Usage: %s <inputfile> <outputfile> \n\n", argv[0]);
}


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

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

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

LLVM IR (-O2):
@.str = [41 x i8] c"\0A Usage: %s <inputfile> <outputfile> \0A\0A\00"
define void @print_usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
MESSAGE1(msg1, id, msg2, pos) char *msg1;
long id;
char *msg2;
long pos;
{
  char buf[200];
  char *str;
  id_to_string(id, &str);
  sprintf(buf, "%s%s%s", msg1, str, msg2);
  MESSAGE(buf, pos);
}


x86 assembly (clang, -O0):
<MESSAGE1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xf8(%rbp),%rsi
mov    $0x0,%al
call   1040 <id_to_string@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0xf8(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xe86(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1030 <MESSAGE@plt>
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MESSAGE1>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <id_to_string@plt>
mov    0x8(%rsp),%rcx
lea    0xe9b(%rip),%rsi
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    %rbx,%rdx
mov    %r15,%r8
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <MESSAGE@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s%s%s\00"
define i32 @MESSAGE1(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca [200 x i8]
%11 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%12 = load i64, i64* %7
%13 = call i32 (i64, i8**, ...) bitcast (i32 (...)* @id_to_string to i32 (i64, i8**, ...)*)(i64 %12, i8** %11)
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%15 = load i8*, i8** %6
%16 = load i8*, i8** %11
%17 = load i8*, i8** %8
%18 = call i32 (i8*, i8*, ...) @sprintf(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i8* %17)
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%20 = load i64, i64* %9
%21 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @MESSAGE to i32 (i8*, i64, ...)*)(i8* %19, i64 %20)
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
define i32 @MESSAGE1(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca [200 x i8]
%6 = alloca i8*
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%8 = bitcast i8** %6 to i8*
%9 = call i32 (i64, i8**, ...) bitcast (i32 (...)* @id_to_string to i32 (i64, i8**, ...)*)(i64 %1, i8** %6)
%10 = load i8*, i8** %6
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %10, i8* %2)
%12 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @MESSAGE to i32 (i8*, i64, ...)*)(i8* %7, i64 %3)
ret i32 undef
}
/* Variables and functions */
double add(int, double volatile);
int main() {
  volatile double x, y, z1, z2, z3;
  z1 = 5;
  z2 = 6;
  z3 = z1 + z2;
  x = add(4, 5);
  y = add(6, z3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x4,%edi
movsd  0xeae(%rip),%xmm0
call   1030 <add@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    $0x6,%edi
call   1030 <add@plt>
movsd  %xmm0,-0x10(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x4014000000000000,%rax
mov    %rax,0x10(%rsp)
movabs $0x4018000000000000,%rax
mov    %rax,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xeb5(%rip),%xmm0
mov    $0x4,%edi
call   1030 <add@plt>
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
mov    $0x6,%edi
call   1030 <add@plt>
movsd  %xmm0,0x18(%rsp)
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store volatile double 5.000000e+00, double* %3
store volatile double 6.000000e+00, double* %4
%6 = load volatile double, double* %3
%7 = load volatile double, double* %4
%8 = fadd double %6, %7
store volatile double %8, double* %5
%9 = call double @add(i32 4, double 5.000000e+00)
store volatile double %9, double* %1
%10 = load volatile double, double* %5
%11 = call double @add(i32 6, double %10)
store volatile double %11, double* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %1 to i8*
%7 = bitcast double* %2 to i8*
%8 = bitcast double* %3 to i8*
%9 = bitcast double* %4 to i8*
%10 = bitcast double* %5 to i8*
store volatile double 5.000000e+00, double* %3
store volatile double 6.000000e+00, double* %4
%11 = load volatile double, double* %3
%12 = load volatile double, double* %4
%13 = fadd double %11, %12
store volatile double %13, double* %5
%14 = tail call double @add(i32 4, double 5.000000e+00)
store volatile double %14, double* %1
%15 = load volatile double, double* %5
%16 = tail call double @add(i32 6, double %15)
store volatile double %16, double* %2
ret i32 0
}
/* Variables and functions */
long long htonl(long long);
int ntohs(int);
long long htonll(long long value) {
  if (ntohs(1) != 1) {
    const long long high_part = htonl(value >> 32);
    const long long low_part = htonl(value & 0xFFFFFFFFLL);
    return (low_part << 32) | high_part;
  } else
    return value;
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <ntohs@plt>
cmp    $0x1,%eax
je     117c <htonll+0x5c>
mov    -0x10(%rbp),%rdi
sar    $0x20,%rdi
call   1030 <htonl@plt>
mov    %rax,-0x18(%rbp)
movabs $0xffffffff,%rdi
and    -0x10(%rbp),%rdi
call   1030 <htonl@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x20,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <htonll+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%edi
call   1040 <ntohs@plt>
cmp    $0x1,%eax
je     1156 <htonll+0x36>
mov    %rbx,%rdi
sar    $0x20,%rdi
call   1030 <htonl@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1030 <htonl@plt>
mov    %rax,%rbx
shl    $0x20,%rbx
or     %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @htonll(i64 %0) {
%2 = tail call i32 @ntohs(i32 1)
%3 = icmp eq i32 %2, 1
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = ashr i64 %0, 32
%6 = tail call i64 @htonl(i64 %5)
%7 = and i64 %0, 4294967295
%8 = tail call i64 @htonl(i64 %7)
%9 = shl i64 %8, 32
%10 = or i64 %9, %6
br label %11
11: ; preds = %1, %4
%12 = phi i64 [ %10, %4 ], [ %0, %1 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("My name is 홍길동");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"My name is \ED\99\8D\EA\B8\B8\EB\8F\99\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"My name is \ED\99\8D\EA\B8\B8\EB\8F\99\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int int_hash(int, int);
unsigned numhash(int i) { return int_hash(i, 1009); }


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

x86 assembly (clang, -O2):
<numhash>:
mov    $0x3f1,%esi
jmp    1030 <int_hash@plt>

LLVM IR (-O0):
define i32 @numhash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @int_hash(i32 %3, i32 1009)
ret i32 %4
}

LLVM IR (-O2):
define i32 @numhash(i32 %0) {
%2 = tail call i32 @int_hash(i32 %0, i32 1009)
ret i32 %2
}
void CRYPTO_get_locked_mem_ex_functions(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_get_locked_mem_ex_functions() {
ret void
}
int execute_getdents() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_getdents() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_getdents() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
int OnError(char *errormsg, int errorint) {
  printf("Error: <%s> occurret. Error code is: %d\n", errormsg, errorint);
  exit(errorint);
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Error: <%s> occurret. Error code is: %d\0A\00"
define i32 @OnError(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 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"Error: <%s> occurret. Error code is: %d\0A\00"
define i32 @OnError(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ del_entry(unsigned char *, int *);
int switch_clr_portmap(unsigned char *maddr) {
  int ports;
  del_entry(maddr, &ports);
  do {
  } while (0);
  return ports;
}


x86 assembly (clang, -O0):
<switch_clr_portmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <del_entry@plt>
jmp    112e <switch_clr_portmap+0x1e>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_clr_portmap>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <del_entry@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @switch_clr_portmap(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @del_entry(i8* %4, i32* %3)
br label %6
6: ; preds = %1
br label %7
7: ; preds = %6
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @switch_clr_portmap(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @del_entry(i8* %0, i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
int track_major_axis(int ch, int i) {}


x86 assembly (clang, -O0):
<track_major_axis>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @track_major_axis(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @track_major_axis(i32 %0, i32 %1) {
ret i32 undef
}
void gtk_window_set_skip_taskbar_hint() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_skip_taskbar_hint() {
ret void
}
/* Type definitions */
struct iphdr {
  int dummy;
};
struct icmphdr {
  int dummy;
};

/* Variables and functions */
int main(void) {
  struct iphdr my_iphdr = {};
  struct icmphdr my_icmphdr = {};
  (void)my_iphdr;
  (void)my_icmphdr;
  return sizeof(struct iphdr) + sizeof(struct icmphdr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    $0x8,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.iphdr = type { i32 }
%struct.icmphdr = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.iphdr
%3 = alloca %struct.icmphdr
store i32 0, i32* %1
%4 = bitcast %struct.iphdr* %2 to i8*
%5 = bitcast %struct.icmphdr* %3 to i8*
ret i32 8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
int test_imm_6Aint8_mem(signed char *val) {
  return ((*val) & (0x6A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Aint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x6a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Aint8_mem>:
testb  $0x6a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 106
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int O_CREAT;
int /*<<< orphan*/ __fortify_fail(char *);
int __openat64(int, char const *, int);
int __openat64_2(int fd, const char *file, int oflag) {
  if (oflag & O_CREAT)
    __fortify_fail("invalid openat64 call: O_CREAT without mode");
  return __openat64(fd, file, oflag);
}


x86 assembly (clang, -O0):
<__openat64_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ebc(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1153 <__openat64_2+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <__fortify_fail@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__openat64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__openat64_2>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x2ec6(%rip),%rax
test   %edx,(%rax)
je     1142 <__openat64_2+0x22>
lea    0xec3(%rip),%rdi
call   1040 <__fortify_fail@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <__openat64@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@.str = [44 x i8] c"invalid openat64 call: O_CREAT without mode\00"
define i32 @__openat64_2(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* @O_CREAT
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 @__fortify_fail(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i32 @__openat64(i32 %14, i8* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@.str = [44 x i8] c"invalid openat64 call: O_CREAT without mode\00"
define i32 @__openat64_2(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @O_CREAT
%5 = and i32 %4, %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @__fortify_fail(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
%10 = tail call i32 @__openat64(i32 %0, i8* %1, i32 %2)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
void print_usage(char *prog) {
  printf("Usage: %s [-DsbdlHOLC3]\n", prog);
  puts("  -D --device   device to use (default /dev/spidev1.1)\n"
       "  -s --speed    max speed (Hz)\n"
       "  -d --delay    delay (usec)\n"
       "  -b --bpw      bits per word \n"
       "  -l --loop     loopback\n"
       "  -H --cpha     clock phase\n"
       "  -O --cpol     clock polarity\n"
       "  -L --lsb      least significant bit first\n"
       "  -C --cs-high  chip select active high\n"
       "  -3 --3wire    SI/SO signals shared\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: %s [-DsbdlHOLC3]\0A\00"
@.str.1 = [352 x i8] c" -D --device device to use (default /dev/spidev1.1)\0A -s --speed max speed (Hz)\0A -d --delay delay (usec)\0A -b --bpw bits per word \0A -l --loop loopback\0A -H --cpha clock phase\0A -O --cpol clock polarity\0A -L --lsb least significant bit first\0A -C --cs-high chip select active high\0A -3 --3wire SI/SO signals shared\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([352 x i8], [352 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: %s [-DsbdlHOLC3]\0A\00"
@.str.1 = [352 x i8] c" -D --device device to use (default /dev/spidev1.1)\0A -s --speed max speed (Hz)\0A -d --delay delay (usec)\0A -b --bpw bits per word \0A -l --loop loopback\0A -H --cpha clock phase\0A -O --cpol clock polarity\0A -L --lsb least significant bit first\0A -C --cs-high chip select active high\0A -3 --3wire SI/SO signals shared\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([352 x i8], [352 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct data *);
void destroy_data(struct data *data) { free(data); }


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

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

LLVM IR (-O0):
%struct.data = type { i32 }
define void @destroy_data(%struct.data* %0) {
%2 = alloca %struct.data*
store %struct.data* %0, %struct.data** %2
%3 = load %struct.data*, %struct.data** %2
%4 = call i32 @free(%struct.data* %3)
ret void
}

LLVM IR (-O2):
%struct.data = type { i32 }
define void @destroy_data(%struct.data* nocapture %0) {
%2 = tail call i32 @free(%struct.data* %0)
ret void
}
/* Type definitions */
struct slist_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ slist_destroy(struct slist_t *);
void config_destroy_slist(struct slist_t *slist) { slist_destroy(slist); }


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

x86 assembly (clang, -O2):
<config_destroy_slist>:
jmp    1030 <slist_destroy@plt>

LLVM IR (-O0):
%struct.slist_t = type { i32 }
define void @config_destroy_slist(%struct.slist_t* %0) {
%2 = alloca %struct.slist_t*
store %struct.slist_t* %0, %struct.slist_t** %2
%3 = load %struct.slist_t*, %struct.slist_t** %2
%4 = call i32 @slist_destroy(%struct.slist_t* %3)
ret void
}

LLVM IR (-O2):
%struct.slist_t = type { i32 }
define void @config_destroy_slist(%struct.slist_t* %0) {
%2 = tail call i32 @slist_destroy(%struct.slist_t* %0)
ret void
}
int fn1() {
  static char a[] = "foo";
  static void *b[] = {&&l1, &&l2};
  goto *(b[1]);
l1:
  goto *(a[0]);
l2:
  return 0;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f3d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1129 <fn1+0x29>
movsbq 0x2f14(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1129 <fn1+0x29>
xor    %eax,%eax
pop    %rbp
ret
mov    -0x8(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
@fn1.a = internal global [4 x i8] c"foo\00"
@fn1.b = internal global [2 x i8*] [i8* blockaddress(@fn1, %2), i8* blockaddress(@fn1, %6)]
define i32 @fn1() {
%1 = load i8*, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @fn1.b, i64 0, i64 1)
br label %7
2: ; preds = %7
%3 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @fn1.a, i64 0, i64 0)
%4 = sext i8 %3 to i64
%5 = inttoptr i64 %4 to i8*
br label %7
6: ; preds = %7
ret i32 0
7: ; preds = %2, %0
%8 = phi i8* [ %1, %0 ], [ %5, %2 ]
indirectbr i8* %8, [label %2, label %6]
}

LLVM IR (-O2):
define i32 @fn1() {
ret i32 0
}
/* Variables and functions */
char *stb__splitpath_raw(char *, char *, int);
char *stb_splitpath(char *output, char *src, int flag) {
  return stb__splitpath_raw(output, src, flag);
}


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

x86 assembly (clang, -O2):
<stb_splitpath>:
jmp    1030 <stb__splitpath_raw@plt>

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

LLVM IR (-O2):
define i8* @stb_splitpath(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @stb__splitpath_raw(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ memoryCheck();
unsigned char *allocateCharVector(int n) {
  int i;
  unsigned char *vector;
  if ((vector = (unsigned char *)calloc(n, sizeof(unsigned char))) == NULL)
    memoryCheck();
  for (i = 0; i < n; i++)
    vector[i] = 0.0;
  return vector;
}


x86 assembly (clang, -O0):
<allocateCharVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114d <allocateCharVector+0x2d>
mov    $0x0,%al
call   1040 <memoryCheck@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117a <allocateCharVector+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <allocateCharVector+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateCharVector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <allocateCharVector+0x31>
test   %ebp,%ebp
jle    1157 <allocateCharVector+0x27>
mov    %ebp,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1050 <memoryCheck@plt>
test   %ebp,%ebp
jg     114b <allocateCharVector+0x1b>
jmp    1157 <allocateCharVector+0x27>

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

LLVM IR (-O2):
define i8* @allocateCharVector(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 1)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @memoryCheck()
br label %7
7: ; preds = %5, %1
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %7
ret i8* %3
}
void I2CMasterIntClearEx(unsigned int baseAdd, unsigned int intFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x28)))) = intFlag;
}


x86 assembly (clang, -O0):
<I2CMasterIntClearEx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntClearEx>:
add    $0x28,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterIntClearEx(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 = load i32, i32* %3
%7 = add i32 %6, 40
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntClearEx(i32 %0, i32 %1) {
%3 = add i32 %0, 40
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
int test_imm_A2uint16_reg(unsigned short val) {
  return ((val) & (0xA2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A2uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xa2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A2uint16_reg>:
test   $0xa2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A2uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 162
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void inflate_free(void *buffer) { free(buffer); }


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

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

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

LLVM IR (-O2):
define void @inflate_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}