xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ findChar(char, char *, int);
int /*<<< orphan*/ test(int /*<<< orphan*/, int);
void testFindChar(void) {
  test(findChar('c', "abcabc", 0), 2);
  test(findChar('c', "abcabc", 3), 5);
  test(findChar('a', "abcabc", 5), -1);
}


x86 assembly (clang, -O0):
<testFindChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x63,%edi
lea    0xed0(%rip),%rsi
xor    %edx,%edx
call   1030 <findChar@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <test@plt>
mov    $0x63,%edi
lea    0xeb1(%rip),%rsi
mov    $0x3,%edx
call   1030 <findChar@plt>
mov    %eax,%edi
mov    $0x5,%esi
call   1040 <test@plt>
mov    $0x61,%edi
lea    0xe8f(%rip),%rsi
mov    $0x5,%edx
call   1030 <findChar@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFindChar>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0x63,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <findChar@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <test@plt>
mov    $0x63,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <findChar@plt>
mov    %eax,%edi
mov    $0x5,%esi
call   1040 <test@plt>
mov    $0x61,%edi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1030 <findChar@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
pop    %rbx
jmp    1040 <test@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"abcabc\00"
define void @testFindChar() {
%1 = call i32 @findChar(i8 signext 99, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @test(i32 %1, i32 2)
%3 = call i32 @findChar(i8 signext 99, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = call i32 @test(i32 %3, i32 5)
%5 = call i32 @findChar(i8 signext 97, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = call i32 @test(i32 %5, i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"abcabc\00"
define void @testFindChar() {
%1 = tail call i32 @findChar(i8 signext 99, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @test(i32 %1, i32 2)
%3 = tail call i32 @findChar(i8 signext 99, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @test(i32 %3, i32 5)
%5 = tail call i32 @findChar(i8 signext 97, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = tail call i32 @test(i32 %5, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ph_smtp_destroy(void *handler) {
  free(handler);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ph_smtp_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
int link(a, b)
char *a, *b;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int /*<<< orphan*/ True;
Bool evpredicate() { return True; }


x86 assembly (clang, -O0):
<evpredicate>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evpredicate>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@True = global i32 0
define i32 @evpredicate() {
%1 = load i32, i32* @True
ret i32 %1
}

LLVM IR (-O2):
@True = global i32 0
define i32 @evpredicate() {
%1 = load i32, i32* @True
ret i32 %1
}
int is_string_end(int c) { return ((char)(c) == '"') ? 1 : 0; }


x86 assembly (clang, -O0):
<is_string_end>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x22,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_string_end>:
xor    %eax,%eax
cmp    $0x22,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_string_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 34
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_string_end(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 34
%4 = zext i1 %3 to i32
ret i32 %4
}
float Signf(float x) { return (float)((0.0f < x) - (x < 0.0f)); }


x86 assembly (clang, -O0):
<Signf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Signf>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @Signf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float 0.000000e+00, %3
%5 = zext i1 %4 to i32
%6 = load float, float* %2
%7 = fcmp olt float %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @Signf(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt float %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
%7 = sitofp i32 %6 to float
ret float %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long root;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_root(void *_p, unsigned long _v) {
  ((XWindowAttributes *)_p)->root = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XWindowAttributes_root(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_root(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void rop3_99_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_99_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_99_1_1>:
or     %edx,%esi
mov    %edx,%eax
not    %al
mov    (%rdi),%cl
or     %cl,%al
not    %sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_99_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = or i8 %2, %1
%8 = xor i8 %7, -1
%9 = and i8 %6, %8
%10 = or i8 %5, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char const *, int /*<<< orphan*/);
int read_int(int);
int read_int_prop(const char *filename_value) {
  int fd;
  int value;
  fd = open(filename_value, O_RDONLY);
  value = read_int(fd);
  close(fd);
  return value;
}


x86 assembly (clang, -O0):
<read_int_prop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <read_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int_prop>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <read_int@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @read_int_prop(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @read_int(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @close(i32 %10)
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @read_int_prop(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = tail call i32 @read_int(i32 %3)
%5 = tail call i32 @close(i32 %3)
ret i32 %4
}
unsigned int rgb_to_pixel15bgr(unsigned int r, unsigned int g, unsigned int b) {
  return ((b >> 3) << 10) | ((g >> 3) << 5) | (r >> 3);
}


x86 assembly (clang, -O0):
<rgb_to_pixel15bgr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x3,%eax
shl    $0xa,%eax
mov    -0x8(%rbp),%ecx
shr    $0x3,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_pixel15bgr>:
and    $0xfffffff8,%edx
shl    $0x7,%edx
lea    0x0(,%rsi,4),%eax
and    $0xffffffe0,%eax
shr    $0x3,%edi
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @rgb_to_pixel15bgr(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = lshr i32 %7, 3
%9 = shl i32 %8, 10
%10 = load i32, i32* %5
%11 = lshr i32 %10, 3
%12 = shl i32 %11, 5
%13 = or i32 %9, %12
%14 = load i32, i32* %4
%15 = lshr i32 %14, 3
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @rgb_to_pixel15bgr(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 7
%5 = and i32 %4, -1024
%6 = shl i32 %1, 2
%7 = and i32 %6, -32
%8 = lshr i32 %0, 3
%9 = or i32 %7, %8
%10 = or i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ c();
void d() {
  c();
  c();
}


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

x86 assembly (clang, -O2):
<d>:
push   %rax
xor    %eax,%eax
call   1030 <c@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <c@plt>

LLVM IR (-O0):
define void @d() {
%1 = call i32 (...) @c()
%2 = call i32 (...) @c()
ret void
}

LLVM IR (-O2):
define void @d() {
%1 = tail call i32 (...) @c()
%2 = tail call i32 (...) @c()
ret void
}
int funct(int instruction) { return instruction & 0x0000003f; }


x86 assembly (clang, -O0):
<funct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funct>:
mov    %edi,%eax
and    $0x3f,%eax
ret

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

LLVM IR (-O2):
define i32 @funct(i32 %0) {
%2 = and i32 %0, 63
ret i32 %2
}
long long f4(long long *p, int i) { return p[i]; }


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

x86 assembly (clang, -O2):
<f4>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i64 @f4(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %5, i64 %7
%9 = load i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @f4(i64* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i64, i64* %0, i64 %3
%5 = load i64, i64* %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sscanf(char *, char *, int *);
int main(int argc, char **argv) {
  int i = -1, n;
  char *s;
  if (argc < 2)
    return 1;
  n = sscanf(argv[1], "%*[0-9]%n", &i);
  printf("%d\n", i);
  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)
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1153 <main+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1184 <main+0x64>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9e(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
mov    $0x1,%eax
cmp    $0x2,%edi
jl     115a <main+0x3a>
mov    0x8(%rsi),%rdi
lea    0xec2(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0x4(%rsp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%*[0-9]%n\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = icmp slt i32 %0, 2
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %2, %6
%13 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %13
}
int vde_chain_nm8_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm8_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <vde_chain_nm8_alloc+0x26>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm8_alloc>:
test   %rdi,%rdi
je     110c <vde_chain_nm8_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm8_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
void DetectTlsJa3StringRegisterTests(void) {}


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

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

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

LLVM IR (-O2):
define void @DetectTlsJa3StringRegisterTests() {
ret void
}
int test_imm_0Dint64_lowword_reg(long long val) {
  return ((val) & (0x0D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Dint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 13
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t make_vgaentry(char c, uint8_t color) {
  return (uint16_t)c | (uint16_t)color << 8;
}


x86 assembly (clang, -O0):
<make_vgaentry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_vgaentry>:
mov    %rsi,%rax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @make_vgaentry(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @make_vgaentry(i8 signext %0, i64 %1) {
%3 = sext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 8
%6 = or i32 %5, %3
ret i32 %6
}
char *langRomTypeEseSCC() { return "Ese-SCC"; }


x86 assembly (clang, -O0):
<langRomTypeEseSCC>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"Ese-SCC\00"
define i8* @langRomTypeEseSCC() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"Ese-SCC\00"
define i8* @langRomTypeEseSCC() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
void foo272() {}


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

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

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

LLVM IR (-O2):
define void @foo272() {
ret void
}
void INT_Excep_SCI5_TEI5(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI5_TEI5() {
ret void
}
void tfree(a) void *a;
{ free(a); }


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

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

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

LLVM IR (-O2):
define void @tfree(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
void bdecode_2(b, p) void *b;
void *p;
{ bcopy(b, p, 2); }


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

x86 assembly (clang, -O2):
<bdecode_2>:
mov    $0x2,%edx
xor    %eax,%eax
jmp    1030 <bcopy@plt>

LLVM IR (-O0):
define void @bdecode_2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %5, i8* %6, i32 2)
ret void
}

LLVM IR (-O2):
define void @bdecode_2(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 2)
ret void
}
/* Variables and functions */
double fabs(double);
int dequals(double a, double b) {
  double thresh = 1e-9;
  return (fabs(a - b) < thresh);
}


x86 assembly (clang, -O0):
<dequals>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xefa(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xed4(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dequals>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
movsd  0xefc(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @dequals(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 1.000000e-09, double* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = call double @llvm.fabs.f64(double %8)
%10 = load double, double* %5
%11 = fcmp olt double %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @dequals(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 1.000000e-09
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
long double fmod(double, double);
long double fmodl(long double x, long double y) {
  return fmod((double)x, (double)y);
}


x86 assembly (clang, -O0):
<fmodl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
call   1030 <fmod@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodl>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm1
jmp    1030 <fmod@plt>

LLVM IR (-O0):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call x86_fp80 @fmod(double %6, double %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call x86_fp80 @fmod(double %3, double %4)
ret x86_fp80 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void splay_tree_xmalloc_deallocate(void *object,
                                   void *data __attribute__((__unused__))) {
  free(object);
}


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

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

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

LLVM IR (-O2):
define void @splay_tree_xmalloc_deallocate(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
void input_toggle() {}


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

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

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

LLVM IR (-O2):
define void @input_toggle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int example_function2(int *array, int array_size) {
  compute(10);
  return 0;
}


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

x86 assembly (clang, -O2):
<example_function2>:
push   %rax
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @example_function2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @compute(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @example_function2(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @compute(i32 10)
ret i32 0
}
void block_cli_if_invoke_IDL_fname(IDL_parsdecl) {}


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

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

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

LLVM IR (-O2):
define void @block_cli_if_invoke_IDL_fname(i32 %0) {
ret void
}
int sign(int x) {
  if (x > 0) {
    return 1;
  } else if (x < 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111d <sign+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113a <sign+0x3a>
cmpl   $0x0,-0x8(%rbp)
jge    1133 <sign+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <sign+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%ecx
sar    $0x1f,%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = ashr i32 %0, 31
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 %2, i32 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasTicks() { wPushNumber(clock()); }


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

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

LLVM IR (-O0):
define void @wBasTicks() {
%1 = call i32 (...) @clock()
%2 = call i32 @wPushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBasTicks() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @wPushNumber(i32 %1)
ret void
}
unsigned int func(void *A) {
  return ((((unsigned long long)A) >> 5) | (((unsigned long long)A) << 27));
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x5,%rax
mov    -0x8(%rbp),%rcx
shl    $0x1b,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    %rdi,%rax
shr    $0x5,%rax
shl    $0x1b,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = lshr i64 %4, 5
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
%8 = shl i64 %7, 27
%9 = or i64 %5, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @func(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 5
%4 = shl i64 %2, 27
%5 = or i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
int wpa_ft_prepare_auth_request(struct wpa_sm *sm) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpa_sm = type opaque
define i32 @wpa_ft_prepare_auth_request(%struct.wpa_sm* nocapture readnone %0) {
ret i32 0
}
float test_asinhf(float x) { return __builtin_asinhf(x); }


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

x86 assembly (clang, -O2):
<test_asinhf>:
jmp    1030 <asinhf@plt>

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

LLVM IR (-O2):
define float @test_asinhf(float %0) {
%2 = tail call float @asinhf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int get_ingress_egress(int /*<<< orphan*/ *);
uint16_t get_ingress_if(uint8_t *hof) { return get_ingress_egress(hof) >> 12; }


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

x86 assembly (clang, -O2):
<get_ingress_if>:
push   %rax
call   1030 <get_ingress_egress@plt>
sar    $0xc,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_ingress_if(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @get_ingress_egress(i32* %3)
%5 = ashr i32 %4, 12
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_ingress_if(i32* %0) {
%2 = tail call i32 @get_ingress_egress(i32* %0)
%3 = ashr i32 %2, 12
ret i32 %3
}
/* Variables and functions */
scalar_t__ getch();
scalar_t__ kbhit();
int pc_checkkey() {
  if (kbhit())
    return ((int)getch());
  return (0);
}


x86 assembly (clang, -O0):
<pc_checkkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <kbhit@plt>
cmp    $0x0,%rax
je     1148 <pc_checkkey+0x28>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
jmp    114f <pc_checkkey+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_checkkey>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <kbhit@plt>
test   %rax,%rax
je     1139 <pc_checkkey+0x19>
xor    %eax,%eax
call   1040 <getch@plt>
mov    %rax,%rbx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pc_checkkey() {
%1 = alloca i32
%2 = call i64 (...) @kbhit()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 (...) @getch()
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @pc_checkkey() {
%1 = tail call i64 (...) @kbhit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 (...) @getch()
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
size_t INT_MAX;
int StrLen(const char *str) {
  size_t n;
  const char *sp = str;
  while (*sp)
    ++sp;
  n = sp - str;
  if (n > INT_MAX)
    return INT_MAX;
  return (int)n;
}


x86 assembly (clang, -O0):
<StrLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <StrLen+0x2e>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1110 <StrLen+0x10>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%rax
jbe    1163 <StrLen+0x63>
mov    0x2e90(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
jmp    116a <StrLen+0x6a>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrLen>:
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1110 <StrLen+0x10>
mov    0x2ec6(%rip),%rax
mov    (%rax),%rax
cmp    %rax,%rcx
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i64 0
define i32 @StrLen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %1
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
br label %7
14: ; preds = %7
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
store i64 %19, i64* %4
%20 = load i64, i64* %4
%21 = load i64, i64* @INT_MAX
%22 = icmp ugt i64 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %14
%24 = load i64, i64* @INT_MAX
%25 = trunc i64 %24 to i32
store i32 %25, i32* %2
br label %29
26: ; preds = %14
%27 = load i64, i64* %4
%28 = trunc i64 %27 to i32
store i32 %28, i32* %2
br label %29
29: ; preds = %26, %23
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define i32 @StrLen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = load i64, i64* @INT_MAX
%12 = icmp ugt i64 %10, %11
%13 = select i1 %12, i64 %11, i64 %10
%14 = trunc i64 %13 to i32
ret i32 %14
}
unsigned long gcd(unsigned long x, unsigned long y) {
  unsigned long z;
  for (;;) {
    if (y == 0)
      return x;
    z = x % y;
    x = y;
    y = z;
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111d <gcd+0x1d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
jne    1120 <gcd+0x20>
ret
nopl   0x0(%rax)
xor    %edx,%edx
div    %rsi
mov    %rsi,%rax
mov    %rdx,%rsi
test   %rdx,%rdx
je     1108 <gcd+0x8>
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %esi
jmp    1115 <gcd+0x15>

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %6
6: ; preds = %11, %2
%7 = load i64, i64* %4
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i64, i64* %3
ret i64 %10
11: ; preds = %6
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = urem i64 %12, %13
store i64 %14, i64* %5
%15 = load i64, i64* %4
store i64 %15, i64* %3
%16 = load i64, i64* %5
store i64 %16, i64* %4
br label %6
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = phi i64 [ %0, %2 ], [ %8, %6 ]
ret i64 %5
6: ; preds = %2, %6
%7 = phi i64 [ %8, %6 ], [ %0, %2 ]
%8 = phi i64 [ %9, %6 ], [ %1, %2 ]
%9 = urem i64 %7, %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XRestackWindows() {
  printf("XRestackWindows called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"XRestackWindows called\0A\00"
define i32 @XRestackWindows() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"XRestackWindows called\00"
define i32 @XRestackWindows() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void free_strings(char **s) {
  if (!s) {
    return;
  }
  int i;
  for (i = 0; s[i]; i++) {
    free(s[i]);
  }
  free(s);
}


x86 assembly (clang, -O0):
<free_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_strings+0x1c>
jmp    116e <free_strings+0x5e>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1165 <free_strings+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <free_strings+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_strings>:
test   %rdi,%rdi
je     1150 <free_strings+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_strings+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_strings+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_strings(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %1, %13
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n;
  while (scanf("%d", &n) != EOF)
    printf("%d\n", 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    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
mov    -0x14(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea8(%rip),%r12
cmp    (%r12),%rax
je     117d <main+0x5d>
lea    0xeb6(%rip),%r14
lea    0xeac(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %2, %8
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %8
14: ; preds = %8, %2
ret i32 0
}
/* Variables and functions */
char *strcat(char *, char const *);
char *add_label(char *s) {
  static const char *label = "#";
  return strcat(s, label);
}


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

x86 assembly (clang, -O2):
<add_label>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movw   $0x23,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@add_label.label = internal global i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0)
@.str = [2 x i8] c"#\00"
define i8* @add_label(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** @add_label.label
%5 = call i8* @strcat(i8* %3, i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @add_label(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr i8, i8* %0, i64 %2
%4 = bitcast i8* %3 to i16*
store i16 35, i16* %4
ret i8* %0
}