xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
main() { waitpid(0, 0, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <waitpid@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @waitpid(i32 0, i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @waitpid(i32 0, i32 0, i32 0)
ret i32 0
}
int ft_strlen(char *str) {
  int n;
  n = 0;
  while (str[n])
    ++n;
  return (n);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <ft_strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

LLVM IR (-O0):
define i32 @ft_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int daemonize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @daemonize() {
ret i32 0
}
int rngcalc(chartyp)
int chartyp;
{
  static int rngtab[] = {0, 10, 20, 13, 25, 40, 20};
  if (chartyp > 10)
    chartyp -= 10;
  return (rngtab[chartyp - 1]);
}


x86 assembly (clang, -O0):
<rngcalc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    111a <rngcalc+0x1a>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2f06(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rngcalc>:
lea    -0xa(%rdi),%eax
cmp    $0xb,%edi
cmovl  %edi,%eax
cltq
lea    0xeee(%rip),%rcx
mov    -0x4(%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@rngcalc.rngtab = internal global [7 x i32] [i32 0, i32 10, i32 20, i32 13, i32 25, i32 40, i32 20]
define i32 @rngcalc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 10
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [7 x i32], [7 x i32]* @rngcalc.rngtab, i64 0, i64 %11
%13 = load i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
@rngcalc.rngtab = internal unnamed_addr constant [7 x i32] [i32 0, i32 10, i32 20, i32 13, i32 25, i32 40, i32 20]
define i32 @rngcalc(i32 %0) {
%2 = icmp sgt i32 %0, 10
%3 = add nsw i32 %0, -10
%4 = select i1 %2, i32 %3, i32 %0
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [7 x i32], [7 x i32]* @rngcalc.rngtab, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}
int test_imm_3Fint64_highword_reg(long long val) {
  return ((val >> 32) & (0x3F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Fint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 63
%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_3Fint64_highword_reg(i64 %0) {
%2 = and i64 %0, 270582939648
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void AnanlogConversionOn(void) {}


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

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

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

LLVM IR (-O2):
define void @AnanlogConversionOn() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int get_magic_number(int, int, int);
int is_irrelevant(uint32_t rn, int rank, int var_p) {
  register uint32_t m = get_magic_number(rank, var_p, 1);
  return ((rn & m) >> (1 << var_p)) == (rn & (~m));
}


x86 assembly (clang, -O0):
<is_irrelevant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <get_magic_number@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_irrelevant>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %edi,%r14d
mov    $0x1,%ebp
mov    %esi,%edi
mov    %edx,%esi
mov    $0x1,%edx
call   1030 <get_magic_number@plt>
mov    %eax,%edx
and    %r14d,%edx
mov    %ebx,%ecx
shl    %cl,%ebp
mov    %ebp,%ecx
sar    %cl,%edx
not    %eax
and    %r14d,%eax
xor    %ecx,%ecx
cmp    %eax,%edx
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_irrelevant(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @get_magic_number(i32 %8, i32 %9, i32 1)
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %7
%13 = and i32 %11, %12
%14 = load i32, i32* %6
%15 = shl i32 1, %14
%16 = ashr i32 %13, %15
%17 = load i32, i32* %4
%18 = load i32, i32* %7
%19 = xor i32 %18, -1
%20 = and i32 %17, %19
%21 = icmp eq i32 %16, %20
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_irrelevant(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @get_magic_number(i32 %1, i32 %2, i32 1)
%5 = and i32 %4, %0
%6 = shl nuw i32 1, %2
%7 = ashr i32 %5, %6
%8 = xor i32 %4, -1
%9 = and i32 %8, %0
%10 = icmp eq i32 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int f3_cmp(long double, long double);
int __letf2(long double a, long double b) { return f3_cmp(a, b); }


x86 assembly (clang, -O0):
<__letf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <f3_cmp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__letf2>:
jmp    1030 <f3_cmp@plt>

LLVM IR (-O0):
define i32 @__letf2(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 = load x86_fp80, x86_fp80* %4
%7 = call i32 @f3_cmp(x86_fp80 %5, x86_fp80 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__letf2(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i32 @f3_cmp(x86_fp80 %0, x86_fp80 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ io_read_004x(int /*<<< orphan*/);
void io_read_0040() { io_read_004x(0); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <io_read_004x@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @io_read_0040() {
%1 = call i32 @io_read_004x(i32 0)
ret void
}

LLVM IR (-O2):
define void @io_read_0040() {
%1 = tail call i32 @io_read_004x(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void set_mask(int mask) { outb(mask, 0x3cf); }


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

x86 assembly (clang, -O2):
<set_mask>:
mov    $0x3cf,%esi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @set_mask(i32 %0) {
%2 = tail call i32 @outb(i32 %0, i32 975)
ret void
}
int atexit(void func(void)) {
  (void)func;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @atexit(void ()* nocapture readnone %0) {
ret i32 0
}
int dtls1_get_queue_priority(unsigned short seq, int is_ccs) {
  return seq * 2 - is_ccs;
}


x86 assembly (clang, -O0):
<dtls1_get_queue_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x1,%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtls1_get_queue_priority>:
lea    (%rdi,%rdi,1),%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @dtls1_get_queue_priority(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = mul nsw i32 %6, 2
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @dtls1_get_queue_priority(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = shl nuw nsw i32 %3, 1
%5 = sub nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, world! I am an Android app.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Hello, world! I am an Android app.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Hello, world! I am an Android app.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float ff1(float par) { return par; }


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

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

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

LLVM IR (-O2):
define float @ff1(float returned %0) {
ret float %0
}
int reconnect_server() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @reconnect_server() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AT_SECURE;
unsigned long getauxval(int /*<<< orphan*/);
char *getenv(char const *);
char *secure_getenv(const char *name) {
  unsigned long secure = getauxval(AT_SECURE);
  if (secure != 0) {
    return NULL;
  }
  return getenv(name);
}


x86 assembly (clang, -O0):
<secure_getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <getauxval@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <secure_getenv+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1163 <secure_getenv+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_getenv>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <getauxval@plt>
test   %rax,%rax
je     113b <secure_getenv+0x1b>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
@AT_SECURE = global i32 0
define i8* @secure_getenv(i8* nocapture %0) {
%2 = load i32, i32* @AT_SECURE
%3 = tail call i64 @getauxval(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i8* @getenv(i8* %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ null, %1 ]
ret i8* %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t wd_mca_feedb(void *priv) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @wd_mca_feedb(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  char buf[256];
  strcpy(buf, argv[1]);
  strcat(buf, argv[2]);
  printf("%s\n", buf);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbx),%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
lea    0xea1(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strcpy(i8* %7, i8* %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @strcat(i8* %12, i8* %15)
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = call i32 @strcat(i8* %4, i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
FILE *openfile(char *file) {
  FILE *my_file;
  if (!(my_file = fopen(file, "r"))) {
    fprintf(stderr, "Can not openning file\n");
    return 0;
  }
  return my_file;
}


x86 assembly (clang, -O0):
<openfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    116c <openfile+0x4c>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1174 <openfile+0x54>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openfile>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <openfile+0x2a>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [23 x i8] c"Can not openning file\0A\00"
define i32* @openfile(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = icmp ne i32* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32* null, i32** %2
br label %13
11: ; preds = %1
%12 = load i32*, i32** %4
store i32* %12, i32** %2
br label %13
13: ; preds = %11, %8
%14 = load i32*, i32** %2
ret i32* %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [23 x i8] c"Can not openning file\0A\00"
define noalias i32* @openfile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %1, %4
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void popfd() { db(0x9D); }


x86 assembly (clang, -O0):
<popfd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9d,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<popfd>:
mov    $0x9d,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @popfd() {
%1 = call i32 @db(i32 157)
ret void
}

LLVM IR (-O2):
define void @popfd() {
%1 = tail call i32 @db(i32 157)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vassert(int /*<<< orphan*/, char *);
size_t strlen(const char *str) {
  size_t len = 0;
  vassert(str != NULL, "str == NULL");
  while (*str++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec8(%rip),%rsi
call   1030 <vassert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1166 <strlen+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113d <strlen+0x2d>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
lea    0xedc(%rip),%rsi
call   1030 <vassert@plt>
cmpb   $0x0,(%rbx)
je     1140 <strlen+0x30>
xor    %ecx,%ecx
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rbx,%rcx,1)
mov    %rax,%rcx
jne    1130 <strlen+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"str == NULL\00"
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @vassert(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %13, %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i64, i64* %3
%15 = add i64 %14, 1
store i64 %15, i64* %3
br label %8
16: ; preds = %8
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
@.str = [12 x i8] c"str == NULL\00"
define i64 @strlen(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @vassert(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %7
%8 = phi i64 [ %11, %7 ], [ 0, %1 ]
%9 = phi i8* [ %10, %7 ], [ %0, %1 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = add i64 %8, 1
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %1
%15 = phi i64 [ 0, %1 ], [ %11, %7 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0On();
void TestAppP__Leds__led0On(void) { LedsP__Leds__led0On(); }


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

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

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

LLVM IR (-O2):
define void @TestAppP__Leds__led0On() {
%1 = tail call i32 (...) @LedsP__Leds__led0On()
ret void
}
/* Variables and functions */
int returns_zero();
int main() { return returns_zero(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @returns_zero()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ AlarmToTimerC__0__Timer__stop();
void VirtualizeTimerC__0__TimerFrom__stop(void) {
  AlarmToTimerC__0__Timer__stop();
}


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

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

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

LLVM IR (-O2):
define void @VirtualizeTimerC__0__TimerFrom__stop() {
%1 = tail call i32 (...) @AlarmToTimerC__0__Timer__stop()
ret void
}
void gshead_(scan_no, feed_no, record, return_code) int *scan_no, *feed_no,
    *record, *return_code;
{}


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

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

LLVM IR (-O0):
define void @gshead_(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
ret void
}

LLVM IR (-O2):
define void @gshead_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
ret void
}
/* Variables and functions */
int __stub_true() { return true; }


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

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

LLVM IR (-O0):
define i32 @__stub_true() {
ret i32 1
}

LLVM IR (-O2):
define i32 @__stub_true() {
ret i32 1
}
create_allocate_bmp_file(file_name, file_header, bmheader) char *file_name;
struct bmpfileheader *file_header;
struct bitmapheader *bmheader;
{
}


x86 assembly (clang, -O0):
<create_allocate_bmp_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bmpfileheader = type opaque
%struct.bitmapheader = type opaque
define i32 @create_allocate_bmp_file(i8* %0, %struct.bmpfileheader* %1, %struct.bitmapheader* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.bmpfileheader*
%7 = alloca %struct.bitmapheader*
store i8* %0, i8** %5
store %struct.bmpfileheader* %1, %struct.bmpfileheader** %6
store %struct.bitmapheader* %2, %struct.bitmapheader** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.bmpfileheader = type opaque
%struct.bitmapheader = type opaque
define i32 @create_allocate_bmp_file(i8* nocapture readnone %0, %struct.bmpfileheader* nocapture readnone %1, %struct.bitmapheader* nocapture readnone %2) {
ret i32 undef
}
int test_imm_75int16_reg(short val) {
  return ((val) & (-0x75 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_75int16_reg>:
test   $0xff8b,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_75int16_reg(i16 signext %0) {
%2 = and i16 %0, -117
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_put_two_int(int, int);
void ft_print_comb2(void) {
  int first;
  int second;
  first = 0;
  while (first <= 99) {
    second = first + 1;
    while (second <= 99) {
      ft_put_two_int(first, second);
      second++;
    }
    first++;
  }
}


x86 assembly (clang, -O0):
<ft_print_comb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x63,-0x4(%rbp)
jg     1163 <ft_print_comb2+0x53>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x63,-0x8(%rbp)
jg     1155 <ft_print_comb2+0x45>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ft_put_two_int@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <ft_print_comb2+0x22>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ft_print_comb2+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_comb2>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
jmp    1126 <ft_print_comb2+0x16>
nopl   0x0(%rax)
cmp    $0x64,%r14d
je     1153 <ft_print_comb2+0x43>
mov    %r14d,%ebx
lea    0x1(%rbx),%r14d
cmp    $0x62,%ebx
ja     1120 <ft_print_comb2+0x10>
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <ft_put_two_int@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
jne    1140 <ft_print_comb2+0x30>
jmp    1120 <ft_print_comb2+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_print_comb2() {
br label %3
1: ; preds = %7, %3
%2 = icmp eq i32 %5, 100
br i1 %2, label %12, label %3
3: ; preds = %0, %1
%4 = phi i32 [ 0, %0 ], [ %5, %1 ]
%5 = add nuw nsw i32 %4, 1
%6 = icmp ult i32 %4, 99
br i1 %6, label %7, label %1
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ %5, %3 ]
%9 = tail call i32 @ft_put_two_int(i32 %4, i32 %8)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, 100
br i1 %11, label %1, label %7
12: ; preds = %1
ret void
}
const char *sysfsparser_thermal_sysfs_path() {
  return "/sys/class"
         "/thermal";
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"/sys/class/thermal\00"
define i8* @sysfsparser_thermal_sysfs_path() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"/sys/class/thermal\00"
define i8* @sysfsparser_thermal_sysfs_path() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
void ft_swap(char **s1, char **s2) {
  char *tmp;
  tmp = *s1;
  *s1 = *s2;
  *s2 = tmp;
}


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

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

LLVM IR (-O0):
define void @ft_swap(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** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @ft_swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
void unmapped_vector(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<unmapped_vector>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <unmapped_vector+0x9>
jmp    1109 <unmapped_vector+0x9>

x86 assembly (clang, -O2):
<unmapped_vector>:
jmp    1100 <unmapped_vector>

LLVM IR (-O0):
define void @unmapped_vector() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @unmapped_vector() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int ex1t(int errorlevel) { return syscall(60, errorlevel, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<ex1t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x3c,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex1t>:
push   %rax
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0x3c,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ex1t(i32 %0) {
%2 = tail call i32 @syscall(i32 60, i32 %0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %2
}
void cpu_pause() { asm volatile("rep;nop"); }


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

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

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

LLVM IR (-O2):
define void @cpu_pause() {
tail call void asm sideeffect "rep;nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
char *driver_version(void) {
  static char *dv = "linux socket packet";
  return dv;
}


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

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

LLVM IR (-O0):
@driver_version.dv = internal global i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i32 0, i32 0)
@.str = [20 x i8] c"linux socket packet\00"
define i8* @driver_version() {
%1 = load i8*, i8** @driver_version.dv
ret i8* %1
}

LLVM IR (-O2):
@.str = [20 x i8] c"linux socket packet\00"
define i8* @driver_version() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ RangefinderDistanceHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void RangefinderDistanceUpdated() {
  UAVObjUpdated(RangefinderDistanceHandle());
}


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

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

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

LLVM IR (-O2):
define void @RangefinderDistanceUpdated() {
%1 = tail call i32 (...) @RangefinderDistanceHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void remove_bt_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @remove_bt_handler() {
ret void
}
/* Variables and functions */
int sarwaitbar_std_close();
int sarwaitbar_close(void) { return sarwaitbar_std_close(); }


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

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

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

LLVM IR (-O2):
define i32 @sarwaitbar_close() {
%1 = tail call i32 (...) @sarwaitbar_std_close()
ret i32 %1
}
/* Variables and functions */
char start_game();
int main(int argc, char *argv[]) {
  char play = 1;
  while (play = start_game()) {
    if (!play) {
      break;
    }
  }
  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)
movb   $0x1,-0x11(%rbp)
mov    $0x0,%al
call   1030 <start_game@plt>
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1150 <main+0x40>
cmpb   $0x0,-0x11(%rbp)
jne    114b <main+0x3b>
jmp    1150 <main+0x40>
jmp    112a <main+0x1a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <start_game@plt>
test   %al,%al
jne    1120 <main+0x10>
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**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 1, i8* %6
br label %7
7: ; preds = %14, %2
%8 = call signext i8 (...) @start_game()
store i8 %8, i8* %6
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i8, i8* %6
%12 = icmp ne i8 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10
br label %15
14: ; preds = %10
br label %7
15: ; preds = %13, %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call signext i8 (...) @start_game()
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret i32 0
}
/* Type definitions */
struct iso_file {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct iso_file *);
int iso_fclose(struct iso_file *file) {
  if (file) {
    kfree(file);
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<iso_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <iso_fclose+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <kfree@plt>
movl   $0x0,-0x4(%rbp)
jmp    1143 <iso_fclose+0x33>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_fclose>:
test   %rdi,%rdi
je     1122 <iso_fclose+0x12>
push   %rax
call   1030 <kfree@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.iso_file = type { i32 }
define i32 @iso_fclose(%struct.iso_file* %0) {
%2 = alloca i32
%3 = alloca %struct.iso_file*
store %struct.iso_file* %0, %struct.iso_file** %3
%4 = load %struct.iso_file*, %struct.iso_file** %3
%5 = icmp ne %struct.iso_file* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.iso_file*, %struct.iso_file** %3
%8 = call i32 @kfree(%struct.iso_file* %7)
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.iso_file = type { i32 }
define i32 @iso_fclose(%struct.iso_file* %0) {
%2 = icmp eq %struct.iso_file* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @kfree(%struct.iso_file* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
int lowpan_dev_debugfs_init(struct net_device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define i32 @lowpan_dev_debugfs_init(%struct.net_device* nocapture readnone %0) {
ret i32 0
}
double doy2mjd(year, doy)
int year;
double doy;
{
  double dj0;
  double date;
  double time;
  date = (double)year + 0.0101;
  time = 0.0;
  dj0 = dt2jd(date, time);
  return (dj0 + doy - 1.0 - 2400000.5);
}


x86 assembly (clang, -O0):
<doy2mjd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    $0x2,%al
call   1030 <dt2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe8a(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doy2mjd>:
push   %rax
movsd  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
addsd  0xedb(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   1030 <dt2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  (%rsp),%xmm0
addsd  0xec5(%rip),%xmm0
addsd  0xec5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @doy2mjd(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fadd double %9, 1.010000e-02
store double %10, double* %6
store double 0.000000e+00, double* %7
%11 = load double, double* %6
%12 = load double, double* %7
%13 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %11, double %12)
%14 = sitofp i32 %13 to double
store double %14, double* %5
%15 = load double, double* %5
%16 = load double, double* %4
%17 = fadd double %15, %16
%18 = fsub double %17, 1.000000e+00
%19 = fsub double %18, 0x41424F8040000000
ret double %19
}

LLVM IR (-O2):
define double @doy2mjd(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fadd double %3, 1.010000e-02
%5 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %4, double 0.000000e+00)
%6 = sitofp i32 %5 to double
%7 = fadd double %6, %1
%8 = fadd double %7, -1.000000e+00
%9 = fadd double %8, 0xC1424F8040000000
ret double %9
}
/* Variables and functions */
int parse_runlevel(char const);
int parse_runlevels(const char *runlevels) {
  int res = 0;
  for (; *runlevels; runlevels++)
    res |= parse_runlevel(*runlevels);
  return res;
}


x86 assembly (clang, -O0):
<parse_runlevels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <parse_runlevels+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <parse_runlevel@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <parse_runlevels+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_runlevels>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1147 <parse_runlevels+0x37>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <parse_runlevel@plt>
or     %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <parse_runlevels+0x20>
jmp    1149 <parse_runlevels+0x39>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_runlevels(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call i32 @parse_runlevel(i8 signext %5)
%9 = or i32 %8, %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %14
}
void set_tcp_header_rst_attack() {}


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

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

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

LLVM IR (-O2):
define void @set_tcp_header_rst_attack() {
ret void
}
strlen(str) char *str;
{
  register char *s;
  s = str;
  while (*s++)
    ;
  return (s - str - 1);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen+0x2d>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Type definitions */
struct config_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *CFG_Search(struct config_t *, char *);
int CFG_IsSet(struct config_t *cfg, char *key) {
  return CFG_Search(cfg, key) != NULL;
}


x86 assembly (clang, -O0):
<CFG_IsSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <CFG_Search@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CFG_IsSet>:
push   %rax
call   1030 <CFG_Search@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.config_t = type { i32 }
define i32 @CFG_IsSet(%struct.config_t* %0, i8* %1) {
%3 = alloca %struct.config_t*
%4 = alloca i8*
store %struct.config_t* %0, %struct.config_t** %3
store i8* %1, i8** %4
%5 = load %struct.config_t*, %struct.config_t** %3
%6 = load i8*, i8** %4
%7 = call i32* @CFG_Search(%struct.config_t* %5, i8* %6)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.config_t = type { i32 }
define i32 @CFG_IsSet(%struct.config_t* %0, i8* %1) {
%3 = tail call i32* @CFG_Search(%struct.config_t* %0, i8* %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}