xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGCONT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void handler(int sig) {
  printf("got signal : %d\n", sig);
  kill(getpid(), SIGCONT);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1050 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2e9b(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1050 <kill@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"got signal : %d\0A\00"
@SIGCONT = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @getpid()
%6 = load i32, i32* @SIGCONT
%7 = call i32 @kill(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"got signal : %d\0A\00"
@SIGCONT = global i32 0
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @getpid()
%4 = load i32, i32* @SIGCONT
%5 = tail call i32 @kill(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strndup(char const *, int);
void test_2(const char *s) {
  char *p = strndup(s, 42);
  free(p);
}


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

x86 assembly (clang, -O2):
<test_2>:
push   %rax
mov    $0x2a,%esi
call   1040 <strndup@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @test_2(i8* nocapture %0) {
%2 = tail call i8* @strndup(i8* %0, i32 42)
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
void *dl_cur_stack() {
  int x;
  void *ptr = &x;
  return ptr;
}


x86 assembly (clang, -O0):
<dl_cur_stack>:
push   %rbp
mov    %rsp,%rbp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl_cur_stack>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @dl_cur_stack() {
%1 = alloca i32
%2 = alloca i8*
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @dl_cur_stack() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
ret i8* %2
}
/* Variables and functions */
int spec_endianness_is_little();
int arch_spec_endianness_is_little(void) { return spec_endianness_is_little(); }


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

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

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

LLVM IR (-O2):
define i32 @arch_spec_endianness_is_little() {
%1 = tail call i32 (...) @spec_endianness_is_little()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ACUTE_assert_print(int, unsigned char *);
void ACUTE_assert_false(int result, int line, unsigned char *exception) {
  if (result != 0) {
    ACUTE_assert_print(line, exception);
  }
}


x86 assembly (clang, -O0):
<ACUTE_assert_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <ACUTE_assert_false+0x28>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ACUTE_assert_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ACUTE_assert_false>:
test   %edi,%edi
je     111e <ACUTE_assert_false+0xe>
mov    %esi,%edi
mov    %rdx,%rsi
jmp    1030 <ACUTE_assert_print@plt>
ret

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

LLVM IR (-O2):
define void @ACUTE_assert_false(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @ACUTE_assert_print(i32 %1, i8* %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int random();
float g_random(float min, float max) {
  float f;
  f = (random() / 1000) % 1000;
  f = min + (max - min) * f / 1000.0;
  return f;
}


x86 assembly (clang, -O0):
<g_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe9a(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_random>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm2
subss  %xmm1,%xmm2
mulss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
divsd  0xe80(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @g_random(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = call i32 (...) @random()
%7 = sdiv i32 %6, 1000
%8 = srem i32 %7, 1000
%9 = sitofp i32 %8 to float
store float %9, float* %5
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = load float, float* %4
%13 = load float, float* %3
%14 = fsub float %12, %13
%15 = load float, float* %5
%16 = fmul float %14, %15
%17 = fpext float %16 to double
%18 = fdiv double %17, 1.000000e+03
%19 = fadd double %11, %18
%20 = fptrunc double %19 to float
store float %20, float* %5
%21 = load float, float* %5
ret float %21
}

LLVM IR (-O2):
define float @g_random(float %0, float %1) {
%3 = tail call i32 (...) @random()
%4 = sdiv i32 %3, 1000
%5 = srem i32 %4, 1000
%6 = sitofp i32 %5 to float
%7 = fpext float %0 to double
%8 = fsub float %1, %0
%9 = fmul float %8, %6
%10 = fpext float %9 to double
%11 = fdiv double %10, 1.000000e+03
%12 = fadd double %11, %7
%13 = fptrunc double %12 to float
ret float %13
}
char *_Locale_ctype_name(const void *__DUMMY_PAR1, char *__DUMMY_PAR) {
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @_Locale_ctype_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_Locale_ctype_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int getkeyinfo(uint16_t ki) {
  if (ki & (1 << (7))) {
    if (ki & (1 << (6))) {
      return 3;
    } else {
      return 1;
    }
  } else {
    if (ki & (1 << (9))) {
      return 4;
    } else {
      return 2;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<getkeyinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     113f <getkeyinfo+0x3f>
mov    -0x8(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1133 <getkeyinfo+0x33>
movl   $0x3,-0x4(%rbp)
jmp    1163 <getkeyinfo+0x63>
movl   $0x1,-0x4(%rbp)
jmp    1163 <getkeyinfo+0x63>
mov    -0x8(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     115c <getkeyinfo+0x5c>
movl   $0x4,-0x4(%rbp)
jmp    1163 <getkeyinfo+0x63>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getkeyinfo>:
mov    %edi,%eax
test   $0x80,%al
jne    1110 <getkeyinfo+0x10>
shr    $0x8,%eax
and    $0x2,%eax
add    $0x2,%eax
ret
and    $0x40,%eax
shr    $0x5,%eax
or     $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @getkeyinfo(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = and i32 %0, 64
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 3
br label %12
8: ; preds = %1
%9 = and i32 %0, 512
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 2, i32 4
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ %7, %4 ], [ %11, %8 ]
ret i32 %13
}
int *(wcheck_int_ptr)(int *to_check) { return to_check; }


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

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

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

LLVM IR (-O2):
define i32* @wcheck_int_ptr(i32* readnone returned %0) {
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ gfx_term_putstring(char const *);
void uart_send_char(char c) {
  char str[2];
  str[0] = c;
  str[1] = '\0';
  gfx_term_putstring((const char *)str);
}


x86 assembly (clang, -O0):
<uart_send_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
call   1030 <gfx_term_putstring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send_char>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <gfx_term_putstring@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @uart_send_char(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = call i32 @gfx_term_putstring(i8* %3)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void ADCComparatorIntEnable(uint32_t ui32Base, uint32_t ui32SequenceNum) {
  ASSERT((ui32Base == 0x40038000) || (ui32Base == 0x40039000));
  ASSERT(ui32SequenceNum < 4);
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= 0x10000
                                                       << ui32SequenceNum;
}


x86 assembly (clang, -O0):
<ADCComparatorIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40038000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113d <ADCComparatorIntEnable+0x2d>
cmpl   $0x40039000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x4,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    $0x10000,%edx
shl    %cl,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCComparatorIntEnable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40038000,%eax
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%ebx
setl   %dil
call   1030 <ASSERT@plt>
mov    $0x10000,%eax
mov    %ebx,%ecx
shl    %cl,%eax
movslq %ebp,%rcx
or     %eax,0x8(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ADCComparatorIntEnable(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 = icmp eq i32 %5, 1073971200
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073975296
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 4
%16 = zext i1 %15 to i32
%17 = call i32 @ASSERT(i32 %16)
%18 = load i32, i32* %4
%19 = shl i32 65536, %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 8
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
%24 = load volatile i32, i32* %23
%25 = or i32 %24, %19
store volatile i32 %25, i32* %23
ret void
}

LLVM IR (-O2):
define void @ADCComparatorIntEnable(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073971200
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp slt i32 %1, 4
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = shl i32 65536, %1
%11 = add nsw i32 %0, 8
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = or i32 %14, %10
store volatile i32 %15, i32* %13
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ ntfs_log_perror(char *, long long);
void *ntfs_calloc(size_t size) {
  void *p;
  p = calloc(1, size);
  if (!p)
    ntfs_log_perror("Failed to calloc %lld bytes", (long long)size);
  return p;
}


x86 assembly (clang, -O0):
<ntfs_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <ntfs_calloc+0x39>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <ntfs_log_perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntfs_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%edi
mov    %r14,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <ntfs_calloc+0x2b>
lea    0xebd(%rip),%rdi
mov    %r14,%rsi
call   1040 <ntfs_log_perror@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Failed to calloc %lld bytes\00"
define i8* @ntfs_calloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @ntfs_log_perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [28 x i8] c"Failed to calloc %lld bytes\00"
define i8* @ntfs_calloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @ntfs_log_perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ get_config_var_struct(char const *);
int set_config_var_struct(int /*<<< orphan*/, int);
int set_config_var(const char *name, int new_value) {
  return set_config_var_struct(get_config_var_struct(name), new_value);
}


x86 assembly (clang, -O0):
<set_config_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_config_var_struct@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1040 <set_config_var_struct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_config_var>:
push   %rbx
mov    %esi,%ebx
call   1030 <get_config_var_struct@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <set_config_var_struct@plt>

LLVM IR (-O0):
define i32 @set_config_var(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 = call i32 @get_config_var_struct(i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @set_config_var_struct(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @set_config_var(i8* %0, i32 %1) {
%3 = tail call i32 @get_config_var_struct(i8* %0)
%4 = tail call i32 @set_config_var_struct(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ helloWorld();
int main() {
  helloWorld();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <helloWorld@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @helloWorld()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @helloWorld()
ret i32 0
}
int main() {
  int x[2];
  int global = 2;
  int local = 1;
#pragma omp target device(opencl) copy_deps ndrange(1, global, local)          \
    file(dummy.cl)
#pragma omp task in([global] x)
  void foo(int *x, int global, int local);
  foo(x, 2, 1);
#pragma omp taskwait
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca i32
%3 = alloca i32
store i32 2, i32* %2
store i32 1, i32* %3
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
ret i32 0
}
int test_main(int argc, char *argv[]) { return 1; }


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

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

LLVM IR (-O0):
define i32 @test_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 1
}

LLVM IR (-O2):
define i32 @test_main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int has_key(int);
int wrap_has_key(int key) { return has_key(key); }


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

x86 assembly (clang, -O2):
<wrap_has_key>:
jmp    1030 <has_key@plt>

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

LLVM IR (-O2):
define i32 @wrap_has_key(i32 %0) {
%2 = tail call i32 @has_key(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_set_env_and_record() {
  printf("NOT IMPLEMENTED:"
         "pa_set_env_and_record"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_set_env_and_record\0A\00"
define i32 @pa_set_env_and_record() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_set_env_and_record\00"
define i32 @pa_set_env_and_record() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *fileSizeString(size_t const, char *, int);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void printSize(const size_t size) {
  char fileSize[8];
  printf("%s%s%s ", "\x1b[1;34m", fileSizeString(size, fileSize, 8), "\x1b[0m");
}


x86 assembly (clang, -O0):
<printSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <fileSizeString@plt>
mov    %rax,%rdx
lea    0xeb8(%rip),%rdi
lea    0xeb9(%rip),%rsi
lea    0xeba(%rip),%rcx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSize>:
push   %rax
mov    %rsp,%rsi
mov    $0x8,%edx
call   1040 <fileSizeString@plt>
lea    0xecb(%rip),%rdi
lea    0xecc(%rip),%rsi
lea    0xecd(%rip),%rcx
mov    %rax,%rdx
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s%s%s \00"
@.str.1 = [8 x i8] c"\1B[1;34m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @printSize(i64 %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i8* @fileSizeString(i64 %0, i8* %3, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
double getRealTime() { return -1.0; }


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

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

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

LLVM IR (-O2):
define double @getRealTime() {
ret double -1.000000e+00
}
/* Type definitions */
typedef union pthread_attr_t {
  int dummy;
} pthread_attr_t;

/* Variables and functions */
int pthread_create(unsigned long *, union pthread_attr_t const *,
                   void *(*)(void *), void *);
signed int rt_thread_create(unsigned long int *thr, void *(*fctn)(void *),
                            void *arg) {
  signed int status = 0;
  status =
      pthread_create(thr, (const union pthread_attr_t *)((void *)0), fctn, arg);
  return status;
}


x86 assembly (clang, -O0):
<rt_thread_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_create@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_thread_create>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <pthread_create@plt>

LLVM IR (-O0):
%union.pthread_attr_t = type { i32 }
define i32 @rt_thread_create(i64* %0, i8* (i8*)* %1, i8* %2) {
%4 = alloca i64*
%5 = alloca i8* (i8*)*
%6 = alloca i8*
%7 = alloca i32
store i64* %0, i64** %4
store i8* (i8*)* %1, i8* (i8*)** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%8 = load i64*, i64** %4
%9 = load i8* (i8*)*, i8* (i8*)** %5
%10 = load i8*, i8** %6
%11 = call i32 @pthread_create(i64* %8, %union.pthread_attr_t* null, i8* (i8*)* %9, i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
%union.pthread_attr_t = type { i32 }
define i32 @rt_thread_create(i64* %0, i8* (i8*)* %1, i8* %2) {
%4 = tail call i32 @pthread_create(i64* %0, %union.pthread_attr_t* null, i8* (i8*)* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int arch_irqs_disabled_flags(int /*<<< orphan*/);
int /*<<< orphan*/ arch_local_save_flags();
int arch_irqs_disabled(void) {
  return arch_irqs_disabled_flags(arch_local_save_flags());
}


x86 assembly (clang, -O0):
<arch_irqs_disabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arch_local_save_flags@plt>
mov    %eax,%edi
call   1030 <arch_irqs_disabled_flags@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_irqs_disabled>:
push   %rax
xor    %eax,%eax
call   1040 <arch_local_save_flags@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arch_irqs_disabled_flags@plt>

LLVM IR (-O0):
define i32 @arch_irqs_disabled() {
%1 = call i32 (...) @arch_local_save_flags()
%2 = call i32 @arch_irqs_disabled_flags(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @arch_irqs_disabled() {
%1 = tail call i32 (...) @arch_local_save_flags()
%2 = tail call i32 @arch_irqs_disabled_flags(i32 %1)
ret i32 %2
}
/* Variables and functions */
int belongs(char **, char *);
int hasArg(char *argv[], int index, char *allparams[]) {
  if (index < 2)
    return 0;
  return belongs(allparams, argv[index - 1]);
}


x86 assembly (clang, -O0):
<hasArg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1139 <hasArg+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1156 <hasArg+0x46>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <belongs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasArg>:
cmp    $0x2,%esi
jge    1118 <hasArg+0x8>
xor    %eax,%eax
ret
add    $0xffffffff,%esi
mov    (%rdi,%rsi,8),%rsi
mov    %rdx,%rdi
jmp    1030 <belongs@plt>

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

LLVM IR (-O2):
define i32 @hasArg(i8** nocapture %0, i32 %1, i8** %2) {
%4 = icmp slt i32 %1, 2
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = add nsw i32 %1, -1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @belongs(i8** %2, i8* %9)
br label %11
11: ; preds = %3, %5
%12 = phi i32 [ %10, %5 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
char EOF;
int /*<<< orphan*/ dec_bin(char);
char getchar();
int main() {
  char z;
  z = getchar();
  while (z != EOF) {
    if (z != '\n')
      dec_bin(z);
    z = getchar();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    0x2ea4(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1174 <main+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1165 <main+0x45>
movsbl -0x5(%rbp),%edi
call   1030 <dec_bin@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
jmp    1139 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
jmp    1147 <main+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
je     1159 <main+0x39>
cmp    $0xa,%al
je     1140 <main+0x20>
movsbl %al,%edi
call   1030 <dec_bin@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %2
br label %4
4: ; preds = %17, %0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %19
10: ; preds = %4
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 10
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i8, i8* %2
%16 = call i32 @dec_bin(i8 signext %15)
br label %17
17: ; preds = %14, %10
%18 = call signext i8 (...) @getchar()
store i8 %18, i8* %2
br label %4
19: ; preds = %4
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %9
%5 = phi i8 [ %10, %9 ], [ %1, %0 ]
%6 = icmp eq i8 %5, 10
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @dec_bin(i8 signext %5)
br label %9
9: ; preds = %7, %4
%10 = tail call signext i8 (...) @getchar()
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %9, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;
typedef int /*<<< orphan*/ ASN1_TIME;

/* Variables and functions */
int /*<<< orphan*/ ASN1_TIME_print(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_gets(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ *BIO_new(int /*<<< orphan*/);
int /*<<< orphan*/ BIO_s_mem();
int convertAsn1ToString(ASN1_TIME *notAfter, char buffer[]) {
  BIO *bio = BIO_new(BIO_s_mem());
  ASN1_TIME_print(bio, notAfter);
  BIO_gets(bio, buffer, 128);
  BIO_free(bio);
  return 0;
}


x86 assembly (clang, -O0):
<convertAsn1ToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <BIO_s_mem@plt>
mov    %eax,%edi
call   1040 <BIO_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ASN1_TIME_print@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x80,%edx
call   1060 <BIO_gets@plt>
mov    -0x18(%rbp),%rdi
call   1050 <BIO_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertAsn1ToString>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1070 <BIO_s_mem@plt>
mov    %eax,%edi
call   1040 <BIO_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <ASN1_TIME_print@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x80,%edx
call   1060 <BIO_gets@plt>
mov    %rbx,%rdi
call   1050 <BIO_free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @convertAsn1ToString(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32*
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = call i32 (...) @BIO_s_mem()
%7 = call i32* @BIO_new(i32 %6)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32*, i32** %3
%10 = call i32 @ASN1_TIME_print(i32* %8, i32* %9)
%11 = load i32*, i32** %5
%12 = load i8*, i8** %4
%13 = call i32 @BIO_gets(i32* %11, i8* %12, i32 128)
%14 = load i32*, i32** %5
%15 = call i32 @BIO_free(i32* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @convertAsn1ToString(i32* %0, i8* %1) {
%3 = tail call i32 (...) @BIO_s_mem()
%4 = tail call i32* @BIO_new(i32 %3)
%5 = tail call i32 @ASN1_TIME_print(i32* %4, i32* %0)
%6 = tail call i32 @BIO_gets(i32* %4, i8* %1, i32 128)
%7 = tail call i32 @BIO_free(i32* %4)
ret i32 0
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_deck_status(const struct cec_msg *msg, __u8 *deck_info) {
  *deck_info = msg->msg[2];
}


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

x86 assembly (clang, -O2):
<cec_ops_deck_status>:
mov    (%rdi),%rax
mov    0x8(%rax),%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_deck_status(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}
void _atomic_add_32_nv(void) {}


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

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

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

LLVM IR (-O2):
define void @_atomic_add_32_nv() {
ret void
}
int atexit(function) void (*function)();
{ return _atexit(function); }


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

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

LLVM IR (-O0):
define i32 @atexit(void (...)* %0) {
%2 = alloca void (...)*
store void (...)* %0, void (...)** %2
%3 = load void (...)*, void (...)** %2
%4 = call i32 (void (...)*, ...) bitcast (i32 (...)* @_atexit to i32 (void (...)*, ...)*)(void (...)* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atexit(void (...)* %0) {
%2 = tail call i32 (void (...)*, ...) bitcast (i32 (...)* @_atexit to i32 (void (...)*, ...)*)(void (...)* %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ time;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
unsigned long get_XEnterWindowEvent_time(void *_p) {
  return (unsigned long)((XEnterWindowEvent *)_p)->time;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEnterWindowEvent_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ trim_character(char *, char, char *);
char *timlib_trim_character(char *source_destination, char *string_of_chars) {
  char c;
  while ((c = *string_of_chars++)) {
    trim_character(source_destination, c, source_destination);
  }
  return source_destination;
}


x86 assembly (clang, -O0):
<timlib_trim_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1154 <timlib_trim_character+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x11(%rbp),%al
mov    -0x8(%rbp),%rdx
movsbl %al,%esi
call   1030 <trim_character@plt>
jmp    1120 <timlib_trim_character+0x10>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_trim_character>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%al
test   %al,%al
je     1149 <timlib_trim_character+0x39>
mov    %rsi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
mov    %r14,%rdx
call   1030 <trim_character@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <timlib_trim_character+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @timlib_trim_character(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %11, %2
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %4
%9 = load i8, i8* %7
store i8 %9, i8* %5
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %5
%14 = load i8*, i8** %3
%15 = call i32 @trim_character(i8* %12, i8 signext %13, i8* %14)
br label %6
16: ; preds = %6
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @timlib_trim_character(i8* returned %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @trim_character(i8* %0, i8 signext %6, i8* %0)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i8* %0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double wrap_time(void) {
  double time;
  struct timeval timeval;
  gettimeofday(&timeval, NULL);
  time = (timeval.tv_sec % 3600) + ((double)timeval.tv_usec / 1000000);
  return time;
}


x86 assembly (clang, -O0):
<wrap_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x18(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xebe(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xe10,%ecx,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xea9(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @wrap_time() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = srem i32 %5, 3600
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %7, %11
store double %12, double* %1
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define double @wrap_time() {
%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 = srem i32 %5, 3600
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %11, %7
ret double %12
}
int main() { int x = 7; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 7, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
char tolower(c)
char c;
{ return isupper(c) ? c + 32 : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%eax
je     113f <tolower+0x2f>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <tolower+0x36>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movsbl %bl,%ebp
mov    %ebp,%edi
call   1030 <isupper@plt>
add    $0x20,%bpl
test   %eax,%eax
movzbl %bpl,%eax
cmove  %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @tolower(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 @isupper(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = add nsw i32 %10, 32
br label %15
12: ; preds = %1
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
br label %15
15: ; preds = %12, %8
%16 = phi i32 [ %11, %8 ], [ %14, %12 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @tolower(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 @isupper(i32 %3)
%5 = icmp eq i32 %4, 0
%6 = add i32 %0, 32
%7 = select i1 %5, i32 %0, i32 %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
int is_subarray(char *vers) { return (*vers == '/' || *vers == '-'); }


x86 assembly (clang, -O0):
<is_subarray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x9(%rbp)
je     112d <is_subarray+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_subarray>:
mov    (%rdi),%cl
and    $0xfd,%cl
xor    %eax,%eax
cmp    $0x2d,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @is_subarray(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 = icmp eq i32 %5, 47
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 45
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ true, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_subarray(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -3
%4 = icmp eq i8 %3, 45
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _insw_ns(void *, void *, unsigned long);
void ioread16_rep(void *addr, void *dst, unsigned long count) {
  _insw_ns(addr, dst, count);
}


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

x86 assembly (clang, -O2):
<ioread16_rep>:
jmp    1030 <_insw_ns@plt>

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

LLVM IR (-O2):
define void @ioread16_rep(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @_insw_ns(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
void d_time_set_destroy() { empty_log("time_set_destroy\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"time_set_destroy\0A\00"
define void @d_time_set_destroy() {
%1 = call i32 @empty_log(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"time_set_destroy\0A\00"
define void @d_time_set_destroy() {
%1 = tail call i32 @empty_log(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}