xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putc(unsigned char);
unsigned char getc(void) {
  unsigned char ret;
  while (!((*(volatile unsigned char *)0x50000010) & (1 << 0)))
    ;
  ret = (*(volatile unsigned char *)0x50000024);
  if ((ret == 0x0d) || (ret == 0x0a)) {
    putc(0x0d);
    putc(0x0a);
  } else {
    putc(ret);
  }
  return ret;
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x50000010,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113a <getc+0x2a>
jmp    113f <getc+0x2f>
jmp    1118 <getc+0x8>
mov    $0x50000024,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xd,%eax
je     1163 <getc+0x53>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    117c <getc+0x6c>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%edi
call   1030 <putc@plt>
jmp    1185 <getc+0x75>
movzbl -0x1(%rbp),%edi
call   1030 <putc@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testb  $0x1,0x50000010
01
je     1120 <getc+0x10>
mov    0x50000024,%bl
cmp    $0xd,%bl
je     113d <getc+0x2d>
mov    %ebx,%eax
cmp    $0xa,%bl
jne    1149 <getc+0x39>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%al
movzbl %al,%edi
call   1030 <putc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @getc() {
%1 = alloca i8
br label %2
2: ; preds = %8, %0
%3 = load volatile i8, i8* inttoptr (i64 1342177296 to i8*)
%4 = zext i8 %3 to i32
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %2
br label %2
9: ; preds = %2
%10 = load volatile i8, i8* inttoptr (i64 1342177316 to i8*)
store i8 %10, i8* %1
%11 = load i8, i8* %1
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = load i8, i8* %1
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %21
18: ; preds = %14, %9
%19 = call i32 @putc(i8 zeroext 13)
%20 = call i32 @putc(i8 zeroext 10)
br label %24
21: ; preds = %14
%22 = load i8, i8* %1
%23 = call i32 @putc(i8 zeroext %22)
br label %24
24: ; preds = %21, %18
%25 = load i8, i8* %1
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i8, i8* inttoptr (i64 1342177296 to i8*)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 1342177316 to i8*)
switch i8 %6, label %9 [
i8 13, label %7
i8 10, label %7
]
7: ; preds = %5, %5
%8 = tail call i32 @putc(i8 zeroext 13)
br label %9
9: ; preds = %5, %7
%10 = phi i8 [ 10, %7 ], [ %6, %5 ]
%11 = tail call i32 @putc(i8 zeroext %10)
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(char *);
char *rsa_decrypt_msg(char const *, char const *);
scalar_t__ strcmp(char const *, char *);
void rsa_assert_ack(const char *priv_key_path, const char *enc_msg) {
  char *dec_ack = rsa_decrypt_msg(priv_key_path, enc_msg);
  assert(strcmp(((const char *)"ACK"), dec_ack) == 0);
  free(dec_ack);
}


x86 assembly (clang, -O0):
<rsa_assert_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <rsa_decrypt_msg@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsa_assert_ack>:
push   %rbx
call   1060 <rsa_decrypt_msg@plt>
mov    %rax,%rbx
lea    0xeb0(%rip),%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ACK\00"
define void @rsa_assert_ack(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @rsa_decrypt_msg(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %5
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ACK\00"
define void @rsa_assert_ack(i8* %0, i8* %1) {
%3 = tail call i8* @rsa_decrypt_msg(i8* %0, i8* %1)
%4 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen6_instdone1_bit(int, char *);
int /*<<< orphan*/ init_gen7_instdone();
void init_gen75_instdone(void) {
  gen6_instdone1_bit(1 << 21, "CS");
  gen6_instdone1_bit(1 << 20, "RS");
  init_gen7_instdone();
}


x86 assembly (clang, -O0):
<init_gen75_instdone>:
push   %rbp
mov    %rsp,%rbp
mov    $0x200000,%edi
lea    0xed0(%rip),%rsi
call   1030 <gen6_instdone1_bit@plt>
mov    $0x100000,%edi
lea    0xec2(%rip),%rsi
call   1030 <gen6_instdone1_bit@plt>
mov    $0x0,%al
call   1040 <init_gen7_instdone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_gen75_instdone>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x200000,%edi
call   1030 <gen6_instdone1_bit@plt>
lea    0xeca(%rip),%rsi
mov    $0x100000,%edi
call   1030 <gen6_instdone1_bit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <init_gen7_instdone@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"CS\00"
@.str.1 = [3 x i8] c"RS\00"
define void @init_gen75_instdone() {
%1 = call i32 @gen6_instdone1_bit(i32 2097152, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen6_instdone1_bit(i32 1048576, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @init_gen7_instdone()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"CS\00"
@.str.1 = [3 x i8] c"RS\00"
define void @init_gen75_instdone() {
%1 = tail call i32 @gen6_instdone1_bit(i32 2097152, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen6_instdone1_bit(i32 1048576, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @init_gen7_instdone()
ret void
}
__attribute__((always_)) __attribute__((warn_unused_result)) float
fclamp(float in, float min, float max) {
  return in <= min ? min : (in >= max ? max : in);
}


x86 assembly (clang, -O0):
<fclamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1135 <fclamp+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <fclamp+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1153 <fclamp+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <fclamp+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclamp>:
movaps %xmm2,%xmm3
cmpless %xmm0,%xmm3
andps  %xmm3,%xmm2
andnps %xmm0,%xmm3
orps   %xmm2,%xmm3
cmpnless %xmm1,%xmm0
andps  %xmm0,%xmm3
andnps %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @fclamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp ole float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp oge float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @fclamp(float %0, float %1, float %2) {
%4 = fcmp ugt float %0, %1
%5 = fcmp oge float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %6, float %1
ret float %7
}
int test_imm_EAuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xEA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EAuint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xea,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EAuint64_highword_reg>:
movabs $0xea00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EAuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 234
%6 = icmp ne i64 %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_EAuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1005022347264
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2SRxDisable(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) &= ~0x00000002;
}


x86 assembly (clang, -O0):
<I2SRxDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    %rcx,0xc00(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SRxDisable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
andq   $0xfffffffffffffffd,0xc00(%rbx)
fd
pop    %rbx
ret

LLVM IR (-O0):
define void @I2SRxDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074085888
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 3072
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, -3
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @I2SRxDisable(i64 %0) {
%2 = icmp eq i64 %0, 1074085888
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 3072
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, -3
store volatile i64 %8, i64* %6
ret void
}
int _calc_is_peak(int i, double *data) {
  if (data[i] > data[i - 1] && data[i] > data[i + 1])
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<_calc_is_peak>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    1161 <_calc_is_peak+0x61>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    1161 <_calc_is_peak+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1168 <_calc_is_peak+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_calc_is_peak>:
movslq %edi,%rcx
movsd  (%rsi,%rcx,8),%xmm0
ucomisd -0x8(%rsi,%rcx,8),%xmm0
jbe    111d <_calc_is_peak+0x1d>
mov    $0x1,%eax
ucomisd 0x8(%rsi,%rcx,8),%xmm0
ja     111f <_calc_is_peak+0x1f>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_calc_is_peak(i32 %0, double* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds double, double* %1, i64 %3
%5 = load double, double* %4
%6 = add nsw i32 %0, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = load double, double* %8
%10 = fcmp ogt double %5, %9
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = add nsw i32 %0, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %1, i64 %13
%15 = load double, double* %14
%16 = fcmp ogt double %5, %15
br i1 %16, label %18, label %17
17: ; preds = %11, %2
br label %18
18: ; preds = %11, %17
%19 = phi i32 [ 0, %17 ], [ 1, %11 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *timenow() {
  static char buffer[64];
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  strftime(buffer, 64, "%Y-%m-%d %H:%M:%S", timeinfo);
  return buffer;
}


x86 assembly (clang, -O0):
<timenow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2ef7(%rip),%rdi
mov    $0x40,%esi
lea    0xe9b(%rip),%rdx
call   1050 <strftime@plt>
lea    0x2edf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timenow>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@timenow.buffer = internal global [64 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @timenow() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = call i32 @strftime(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @timenow.buffer, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @timenow.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@timenow.buffer = internal global [64 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @timenow() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @timenow.buffer, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @timenow.buffer, i64 0, i64 0)
}
/* Variables and functions */
int sys_readlinkat(int, char const *, char *, size_t);
int sys_readlink(const char *pathname, char *buffer, size_t size) {
  return sys_readlinkat((-100), pathname, buffer, size);
}


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

x86 assembly (clang, -O2):
<sys_readlink>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xffffff9c,%edi
jmp    1030 <sys_readlinkat@plt>

LLVM IR (-O0):
define i32 @sys_readlink(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 @sys_readlinkat(i32 -100, i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_readlink(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @sys_readlinkat(i32 -100, i8* %0, i8* %1, i64 %2)
ret i32 %4
}
void highlight(const int s, const int e) {}


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

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

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

LLVM IR (-O2):
define void @highlight(i32 %0, i32 %1) {
ret void
}
int hash1(int val) {
  static int seed = 0x12345678;
  seed *= val;
  if (seed == 0) {
    seed = 0x12345678;
  }
  return val ^ seed;
}


x86 assembly (clang, -O0):
<hash1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   0x2f0f(%rip),%eax
mov    %eax,0x2f09(%rip)
cmpl   $0x0,0x2f02(%rip)
jne    112e <hash1+0x2e>
movl   $0x12345678,0x2ef2(%rip)
56 34 12
mov    -0x4(%rbp),%eax
xor    0x2ee9(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash1>:
mov    0x2f1a(%rip),%ecx
imul   %edi,%ecx
test   %ecx,%ecx
mov    $0x12345678,%eax
cmovne %ecx,%eax
mov    %eax,0x2f07(%rip)
xor    %edi,%eax
ret

LLVM IR (-O0):
@hash1.seed = internal global i32 305419896
define i32 @hash1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @hash1.seed
%5 = mul nsw i32 %4, %3
store i32 %5, i32* @hash1.seed
%6 = load i32, i32* @hash1.seed
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 305419896, i32* @hash1.seed
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %2
%11 = load i32, i32* @hash1.seed
%12 = xor i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
@hash1.seed = internal unnamed_addr global i32 305419896
define i32 @hash1(i32 %0) {
%2 = load i32, i32* @hash1.seed
%3 = mul nsw i32 %2, %0
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 305419896, i32 %3
store i32 %5, i32* @hash1.seed
%6 = xor i32 %5, %0
ret i32 %6
}
/* Variables and functions */
float FLT_MIN;
scalar_t__ isnan(float);
float sanitize_denormal(float value) {
  if (isnan(value)) {
    return FLT_MIN;
  } else {
    return value;
  }
}


x86 assembly (clang, -O0):
<sanitize_denormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1146 <sanitize_denormal+0x36>
mov    0x2eb0(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1150 <sanitize_denormal+0x40>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitize_denormal>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <isnan@plt>
movss  0x4(%rsp),%xmm0
test   %rax,%rax
je     1132 <sanitize_denormal+0x22>
mov    0x2eba(%rip),%rax
movss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@FLT_MIN = global float 0.000000e+00
define float @sanitize_denormal(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = call i64 @isnan(float %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load float, float* @FLT_MIN
store float %8, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %7
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
@FLT_MIN = global float 0.000000e+00
define float @sanitize_denormal(float %0) {
%2 = tail call i64 @isnan(float %0)
%3 = icmp eq i64 %2, 0
%4 = load float, float* @FLT_MIN
%5 = select i1 %3, float %0, float %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ fun2();
int main(int argc, char *argv[]) {
  fun2();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @fun2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fun2()
ret i32 0
}
/* Variables and functions */
int f3(int *);
int f4(int *x) { return (f3(x)); }


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

x86 assembly (clang, -O2):
<f4>:
jmp    1030 <f3@plt>

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

LLVM IR (-O2):
define i32 @f4(i32* %0) {
%2 = tail call i32 @f3(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fib(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int n;
  printf("Enter n\n");
  scanf("%d", &n);
  fib(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1050 <fib@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Enter n\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 @fib(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [8 x i8] c"Enter n\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @fib(i32 %7)
ret i32 0
}
void ABGRToAR30Row_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ABGRToAR30Row_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crmode();
int /*<<< orphan*/ md_control_keybord(int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
void start_window() {
  crmode();
  noecho();
  nonl();
  md_control_keybord(0);
}


x86 assembly (clang, -O0):
<start_window>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <crmode@plt>
mov    $0x0,%al
call   1050 <noecho@plt>
mov    $0x0,%al
call   1040 <nonl@plt>
xor    %edi,%edi
call   1030 <md_control_keybord@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_window>:
push   %rax
xor    %eax,%eax
call   1060 <crmode@plt>
xor    %eax,%eax
call   1050 <noecho@plt>
xor    %eax,%eax
call   1040 <nonl@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <md_control_keybord@plt>

LLVM IR (-O0):
define void @start_window() {
%1 = call i32 (...) @crmode()
%2 = call i32 (...) @noecho()
%3 = call i32 (...) @nonl()
%4 = call i32 @md_control_keybord(i32 0)
ret void
}

LLVM IR (-O2):
define void @start_window() {
%1 = tail call i32 (...) @crmode()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @nonl()
%4 = tail call i32 @md_control_keybord(i32 0)
ret void
}
/* Variables and functions */
double log10(double const);
double mw2dbm(const double in) { return 10.0 * log10(in); }


x86 assembly (clang, -O0):
<mw2dbm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mw2dbm>:
push   %rax
call   1030 <log10@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mw2dbm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10(double %3)
%5 = fmul double 1.000000e+01, %4
ret double %5
}

LLVM IR (-O2):
define double @mw2dbm(double %0) {
%2 = tail call double @log10(double %0)
%3 = fmul double %2, 1.000000e+01
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sig_handler(int sig) {
  printf("\nStopped.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0AStopped.\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [10 x i8] c"\0AStopped.\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int debug_display_pt_at(int);
int registers_get_integer(char *);
int debug_display_pt_ptbr() {
  int addr = registers_get_integer("PTBR");
  return debug_display_pt_at(addr);
}


x86 assembly (clang, -O0):
<debug_display_pt_ptbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <registers_get_integer@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <debug_display_pt_at@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_display_pt_ptbr>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <registers_get_integer@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <debug_display_pt_at@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"PTBR\00"
define i32 @debug_display_pt_ptbr() {
%1 = alloca i32
%2 = call i32 @registers_get_integer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @debug_display_pt_at(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"PTBR\00"
define i32 @debug_display_pt_ptbr() {
%1 = tail call i32 @registers_get_integer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @debug_display_pt_at(i32 %1)
ret i32 %2
}
int max(a, b)
register int a, b;
{ return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int getuid(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getuid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ start3(int /*<<< orphan*/, char **);
void _start() {
  int argc = 0;
  char **argv = (void *)0x0;
  start3(0, (char **)0x0);
}


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

x86 assembly (clang, -O2):
<_start>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <start3@plt>

LLVM IR (-O0):
define void @_start() {
%1 = alloca i32
%2 = alloca i8**
store i32 0, i32* %1
store i8** null, i8*** %2
%3 = call i32 @start3(i32 0, i8** null)
ret void
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 @start3(i32 0, i8** null)
ret void
}
/* Variables and functions */
int to(int /*<<< orphan*/, int);
int opa_unicode_to_upper(int codepoint) { return to(0, codepoint); }


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

x86 assembly (clang, -O2):
<opa_unicode_to_upper>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <to@plt>

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

LLVM IR (-O2):
define i32 @opa_unicode_to_upper(i32 %0) {
%2 = tail call i32 @to(i32 0, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ efaterror(char *);
void Ierror() { efaterror("input error"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"input error\00"
define void @Ierror() {
%1 = call i32 @efaterror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"input error\00"
define void @Ierror() {
%1 = tail call i32 @efaterror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
void X509V3_EXT_add_nconf(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_add_nconf() {
ret void
}
/* Variables and functions */
char *ev_api_name();
char *get_event_api_name(void) { return ev_api_name(); }


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

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

LLVM IR (-O0):
define i8* @get_event_api_name() {
%1 = call i8* (...) @ev_api_name()
ret i8* %1
}

LLVM IR (-O2):
define i8* @get_event_api_name() {
%1 = tail call i8* (...) @ev_api_name()
ret i8* %1
}
/* Variables and functions */
void *malloc(size_t);
void *objc_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<objc_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @objc_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XAnyEvent;

/* Variables and functions */
void set_XAnyEvent_type(void *_p, int _v) { ((XAnyEvent *)_p)->type = (int)_v; }


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

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

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

LLVM IR (-O2):
define void @set_XAnyEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_sigint_hdlr(struct sigaction *);
void setup_sigint_hdlr(struct sigaction *sigint_action) {
  set_sigint_hdlr(sigint_action);
}


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

x86 assembly (clang, -O2):
<setup_sigint_hdlr>:
jmp    1030 <set_sigint_hdlr@plt>

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

LLVM IR (-O2):
%struct.sigaction = type { i32 }
define void @setup_sigint_hdlr(%struct.sigaction* %0) {
%2 = tail call i32 @set_sigint_hdlr(%struct.sigaction* %0)
ret void
}
int AddTwo(int a) {
  a = a + 2;
  return a;
}


x86 assembly (clang, -O0):
<AddTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddTwo>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @AddTwo(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_creds_get_unique_name(void *c, const char **unique_name) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_bus_creds_get_unique_name>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_unique_name(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_unique_name(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 17;
  int height = 76;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall. \n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
movl   $0x4c,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%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
mov    $0x11,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x4c,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [23 x i8] c"I am %d inches tall. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 17, i32* %2
store i32 76, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [23 x i8] c"I am %d inches tall. \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 17)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 76)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gets(char **);
void fun() {
  char *str[10];
  gets(str);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
call   1030 <gets@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
sub    $0x58,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define void @fun() {
%1 = alloca [10 x i8*]
%2 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%3 = call i32 @gets(i8** %2)
ret void
}

LLVM IR (-O2):
define void @fun() {
%1 = alloca [10 x i8*]
%2 = bitcast [10 x i8*]* %1 to i8*
%3 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%4 = call i32 @gets(i8** %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ReadManifestFromPath(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
void ReadManifest(const char *manifestDir) {
  char buffer[64 * 1024];
  strcpy(buffer, manifestDir);
  strcat(buffer, "/MANIFEST");
  ReadManifestFromPath(buffer);
}


x86 assembly (clang, -O0):
<ReadManifest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10010,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10010(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x10010(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x10010(%rbp),%rdi
call   1040 <ReadManifestFromPath@plt>
add    $0x10010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadManifest>:
push   %rbx
sub    $0x10000,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1040 <ReadManifestFromPath@plt>
add    $0x10000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/MANIFEST\00"
define void @ReadManifest(i8* %0) {
%2 = alloca i8*
%3 = alloca [65536 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%10 = call i32 @ReadManifestFromPath(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/MANIFEST\00"
define void @ReadManifest(i8* %0) {
%2 = alloca [65536 x i8]
%3 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @ReadManifestFromPath(i8* %3)
ret void
}
long power(long a, long b) {
  long temp = 1;
  for (long i = 0; i < b; ++i) {
    temp = temp * a;
  }
  return temp;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1148 <power+0x48>
mov    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <power+0x1c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %rsi,%rsi
jle    111b <power+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <power+0x21>
mov    $0x1,%eax
jmp    1156 <power+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <power+0x30>
test   %rcx,%rcx
je     116a <power+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <power+0x60>
ret

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

LLVM IR (-O2):
define i64 @power(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %22
10: ; preds = %22, %4
%11 = phi i64 [ undef, %4 ], [ %32, %22 ]
%12 = phi i64 [ 1, %4 ], [ %32, %22 ]
%13 = icmp eq i64 %6, 0
br i1 %13, label %20, label %14
14: ; preds = %10, %14
%15 = phi i64 [ %17, %14 ], [ %12, %10 ]
%16 = phi i64 [ %18, %14 ], [ 0, %10 ]
%17 = mul nsw i64 %15, %0
%18 = add i64 %16, 1
%19 = icmp eq i64 %18, %6
br i1 %19, label %20, label %14
20: ; preds = %10, %14, %2
%21 = phi i64 [ 1, %2 ], [ %11, %10 ], [ %17, %14 ]
ret i64 %21
22: ; preds = %22, %8
%23 = phi i64 [ 1, %8 ], [ %32, %22 ]
%24 = phi i64 [ 0, %8 ], [ %33, %22 ]
%25 = mul nsw i64 %23, %0
%26 = mul nsw i64 %25, %0
%27 = mul nsw i64 %26, %0
%28 = mul nsw i64 %27, %0
%29 = mul nsw i64 %28, %0
%30 = mul nsw i64 %29, %0
%31 = mul nsw i64 %30, %0
%32 = mul nsw i64 %31, %0
%33 = add i64 %24, 8
%34 = icmp eq i64 %33, %9
br i1 %34, label %10, label %22
}
/* Variables and functions */
int /*<<< orphan*/ setsid();
int main() {
  setsid();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setsid()
ret i32 0
}
int ad7476_scan_from_ring(struct iio_dev *indio_dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @ad7476_scan_from_ring(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @ad7476_scan_from_ring(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ done_index();
int /*<<< orphan*/ init_index(char *, char *);
int /*<<< orphan*/ listdir(char *);
int main(int argc, char **argv) {
  init_index("/home/AKA-wSearch/", "/home/AKA-wSearch/");
  listdir(argv[1]);
  done_index();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rsi
mov    %rsi,%rdi
call   1050 <init_index@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <listdir@plt>
mov    $0x0,%al
call   1040 <done_index@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
lea    0xec5(%rip),%rdi
mov    %rdi,%rsi
call   1050 <init_index@plt>
mov    0x8(%rbx),%rdi
call   1030 <listdir@plt>
xor    %eax,%eax
call   1040 <done_index@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"/home/AKA-wSearch/\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @init_index(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @listdir(i8* %9)
%11 = call i32 (...) @done_index()
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"/home/AKA-wSearch/\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @init_index(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @listdir(i8* %5)
%7 = tail call i32 (...) @done_index()
ret i32 0
}