xunge/DecIR huggingface dataset:
float clamp_float(float a) {
  if (a > 1.)
    return 1.;
  else if (a >= 0)
    return a;
  else
    return 0;
}


x86 assembly (clang, -O0):
<clamp_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1136 <clamp_float+0x36>
movss  0xedc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115e <clamp_float+0x5e>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1156 <clamp_float+0x56>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115e <clamp_float+0x5e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_float>:
xorps  %xmm2,%xmm2
cmpless %xmm0,%xmm2
andps  %xmm0,%xmm2
movss  0xeed(%rip),%xmm3
movaps %xmm3,%xmm1
cmpltss %xmm0,%xmm1
movaps %xmm1,%xmm0
andnps %xmm2,%xmm0
andps  %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @clamp_float(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 1.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 1.000000e+00, float* %2
br label %14
8: ; preds = %1
%9 = load float, float* %3
%10 = fcmp oge float %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load float, float* %3
store float %12, float* %2
br label %14
13: ; preds = %8
store float 0.000000e+00, float* %2
br label %14
14: ; preds = %13, %11, %7
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @clamp_float(float %0) {
%2 = fcmp ogt float %0, 1.000000e+00
%3 = fcmp oge float %0, 0.000000e+00
%4 = select i1 %3, float %0, float 0.000000e+00
%5 = select i1 %2, float 1.000000e+00, float %4
ret float %5
}
/* Variables and functions */
long random();
int ranmod(int n) {
  long r, big;
  big = (2 << 29) - 1;
  r = random();
  r %= big;
  return (r % n);
}


x86 assembly (clang, -O0):
<ranmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x3fffffff,-0x18(%rbp)
3f
mov    $0x0,%al
call   1030 <random@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
cqto
idiv   %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cqto
idiv   %rcx
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranmod>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
mov    %rax,%rcx
movabs $0x8000000200000009,%rdx
imul   %rdx
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x1d,%rdx
add    %edx,%eax
mov    %eax,%edx
shl    $0x1e,%edx
sub    %edx,%eax
add    %eax,%ecx
mov    %ecx,%eax
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ranmod(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
store i64 1073741823, i64* %4
%5 = call i64 (...) @random()
store i64 %5, i64* %3
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = srem i64 %7, %6
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = srem i64 %9, %11
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @ranmod(i32 %0) {
%2 = tail call i64 (...) @random()
%3 = srem i64 %2, 1073741823
%4 = trunc i64 %3 to i32
%5 = srem i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ redecl1();
void use105() { redecl1(); }


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

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

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

LLVM IR (-O2):
define void @use105() {
%1 = tail call i32 (...) @redecl1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *nop(void *data) { pthread_exit(NULL); }


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

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

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

LLVM IR (-O2):
define noalias i8* @nop(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
int test_002(int a, int b, int c) { return ((a & b) != 0) - c; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %eax,%eax
test   %edi,%esi
setne  %al
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_002(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* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_002(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = sub nsw i32 %6, %2
ret i32 %7
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t readrflags(void) {
  uint64_t rflags;
  __asm volatile("pushfq; popq %0" : "=r"(rflags));
  return rflags;
}


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

x86 assembly (clang, -O2):
<readrflags>:
pushf
pop    %rax
ret

LLVM IR (-O0):
define i8* @readrflags() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "pushfq; popq $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @readrflags() {
%1 = tail call i8* asm sideeffect "pushfq; popq $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
void ib62x0_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ib62x0_init() {
ret void
}
int isspace(int c) {
  return (c == 0x09 || c == 0x0A || c == 0x0B || c == 0x0C || c == 0x0D ||
          c == 0x20)
             ? 1
             : 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 9
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 10
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 11
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 12
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 13
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 32
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
ret i32 %23
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void test_libsym3_2(void) {}


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

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

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

LLVM IR (-O2):
define void @test_libsym3_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: test_rpmsg [-c cpu] [-t test_type] "
                  "[-n num_runs] \n[-s sbuf_size] [-r rbuf_siz]"
                  " [-e ept_addr] [-w wait]\n");
  fprintf(stderr, "test types: (1) ping fix size\n"
                  "(2) ping var size\n(3) user space ipc test\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf36(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf40(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [111 x i8] c"Usage: test_rpmsg [-c cpu] [-t test_type] [-n num_runs] \0A[-s sbuf_size] [-r rbuf_siz] [-e ept_addr] [-w wait]\0A\00"
@.str.1 = [73 x i8] c"test types: (1) ping fix size\0A(2) ping var size\0A(3) user space ipc test\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [111 x i8] c"Usage: test_rpmsg [-c cpu] [-t test_type] [-n num_runs] \0A[-s sbuf_size] [-r rbuf_siz] [-e ept_addr] [-w wait]\0A\00"
@.str.1 = [73 x i8] c"test types: (1) ping fix size\0A(2) ping var size\0A(3) user space ipc test\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int ac, char *av[]) {
  if (ac > 1000) {
    return *av[0];
  }
  printf("This is T4. This one should work.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jle    1145 <main+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <main+0x48>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3e9,%edi
jl     1121 <main+0x11>
mov    (%rsi),%rax
movsbl (%rax),%eax
pop    %rcx
ret
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"This is T4. This one should work.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1000
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
store i32 %13, i32* %3
br label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %16
16: ; preds = %14, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [34 x i8] c"This is T4. This one should work.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1000
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
br label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
%11 = phi i32 [ %7, %4 ], [ 0, %8 ]
ret i32 %11
}
void loop(void) {}


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

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

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

LLVM IR (-O2):
define void @loop() {
ret void
}
__attribute__((always_)) void check_pgt_cache(void) {}


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

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

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

LLVM IR (-O2):
define void @check_pgt_cache() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const);
int /*<<< orphan*/ stdout;
void pnc(const char c, uint16_t cnt) {
  for (uint16_t i = 0; i < cnt; i++) {
    printf("%c", c);
  }
  fflush(stdout);
}


x86 assembly (clang, -O0):
<pnc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1169 <pnc+0x49>
lea    0xeb1(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113a <pnc+0x1a>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnc>:
push   %rbp
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1150 <pnc+0x30>
mov    %rsi,%rbx
movsbl %dil,%ebp
lea    0xec9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1140 <pnc+0x20>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define void @pnc(i8 signext %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %7, %2
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
ret void
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ 0, %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%10 = add nuw nsw i64 %8, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %7
}
/* Variables and functions */
int /*<<< orphan*/ test_brainfuck_comment();
int /*<<< orphan*/ test_brainfuck_comment_entities();
void all_brainfuck_tests() {
  test_brainfuck_comment();
  test_brainfuck_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_brainfuck_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_brainfuck_comment@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_brainfuck_comment_entities@plt>

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

LLVM IR (-O2):
define void @all_brainfuck_tests() {
%1 = tail call i32 (...) @test_brainfuck_comment()
%2 = tail call i32 (...) @test_brainfuck_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_string(int, char const *);
void console_init(void) {
  static const char console_test[] = "\r\n\r\nLinuxBIOS-"
                                     "1.1.0"
                                     ".0Fallback"
                                     " "
                                     "Mon Jun 9 18:15:20 MDT 2003"
                                     " starting...\r\n";
  __console_tx_string(6, console_test);
}


x86 assembly (clang, -O0):
<console_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
lea    0xee0(%rip),%rsi
call   1030 <__console_tx_string@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_init>:
lea    0xee9(%rip),%rsi
mov    $0x6,%edi
jmp    1030 <__console_tx_string@plt>

LLVM IR (-O0):
@console_init.console_test = internal constant [72 x i8] c"\0D\0A\0D\0ALinuxBIOS-1.1.0.0Fallback Mon Jun 9 18:15:20 MDT 2003 starting...\0D\0A\00"
define void @console_init() {
%1 = call i32 @__console_tx_string(i32 6, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @console_init.console_test, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@console_init.console_test = internal constant [72 x i8] c"\0D\0A\0D\0ALinuxBIOS-1.1.0.0Fallback Mon Jun 9 18:15:20 MDT 2003 starting...\0D\0A\00"
define void @console_init() {
%1 = tail call i32 @__console_tx_string(i32 6, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @console_init.console_test, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void test_vmvn_s16x4(int16_t *__restrict__ dest, int16_t *a) {
  int i;
  for (i = 0; i < 4; i++) {
    dest[i] = ~a[i];
  }
}


x86 assembly (clang, -O0):
<test_vmvn_s16x4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1144 <test_vmvn_s16x4+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vmvn_s16x4+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vmvn_s16x4>:
movdqu (%rsi),%xmm0
pcmpeqd %xmm1,%xmm1
pxor   %xmm0,%xmm1
movdqu %xmm1,(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vmvn_s16x4(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = xor <4 x i32> %4, <i32 -1, i32 -1, i32 -1, i32 -1>
%6 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usage(char *);
int checkArguments(int argc, char **argv) {
  if (argc != 3) {
    printf("ERROR: Program expects 2 arguments\n");
    usage(argv[0]);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     115d <checkArguments+0x3d>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1164 <checkArguments+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkArguments>:
xor    %eax,%eax
cmp    $0x3,%edi
je     1145 <checkArguments+0x25>
push   %rbx
mov    %rsi,%rbx
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdi
call   1040 <usage@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [35 x i8] c"ERROR: Program expects 2 arguments\00"
define i32 @checkArguments(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = tail call i32 @usage(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %9
}
void gtk_tool_item_get_type() {}


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

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

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

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

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int ihex_skip_line(FILE *fp) {
  int c;
  while (1) {
    c = fgetc(fp);
    if (c == EOF) {
      return (1);
    }
    if ((c == 0x0a) || (c == 0x0d)) {
      return (0);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<ihex_skip_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
jne    1146 <ihex_skip_line+0x36>
movl   $0x1,-0x4(%rbp)
jmp    116b <ihex_skip_line+0x5b>
cmpl   $0xa,-0x14(%rbp)
je     115a <ihex_skip_line+0x4a>
cmpl   $0xd,-0x14(%rbp)
jne    1166 <ihex_skip_line+0x56>
movl   $0x0,-0x4(%rbp)
jmp    116b <ihex_skip_line+0x5b>
jmp    111c <ihex_skip_line+0xc>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ihex_skip_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    (%r14),%eax
je     113d <ihex_skip_line+0x2d>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
je     1142 <ihex_skip_line+0x32>
cmp    $0xa,%ecx
jne    1120 <ihex_skip_line+0x10>
jmp    1142 <ihex_skip_line+0x32>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @ihex_skip_line(i32* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %2
switch i32 %3, label %2 [
i32 13, label %7
i32 10, label %7
]
7: ; preds = %6, %6, %2
%8 = phi i32 [ 1, %2 ], [ 0, %6 ], [ 0, %6 ]
ret i32 %8
}
/* Variables and functions */
int OK;
int PDC_cursor_on() { return (OK); }


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

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

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

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_cursor_on() {
%1 = load i32, i32* @OK
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ getDegrees();
int /*<<< orphan*/ getFlip();
int /*<<< orphan*/ getSide();
int /*<<< orphan*/ getStance();
void getTrick() {
  getStance();
  getSide();
  getDegrees();
  getFlip();
}


x86 assembly (clang, -O0):
<getTrick>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <getStance@plt>
mov    $0x0,%al
call   1030 <getSide@plt>
mov    $0x0,%al
call   1040 <getDegrees@plt>
mov    $0x0,%al
call   1050 <getFlip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTrick>:
push   %rax
xor    %eax,%eax
call   1060 <getStance@plt>
xor    %eax,%eax
call   1030 <getSide@plt>
xor    %eax,%eax
call   1040 <getDegrees@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <getFlip@plt>

LLVM IR (-O0):
define void @getTrick() {
%1 = call i32 (...) @getStance()
%2 = call i32 (...) @getSide()
%3 = call i32 (...) @getDegrees()
%4 = call i32 (...) @getFlip()
ret void
}

LLVM IR (-O2):
define void @getTrick() {
%1 = tail call i32 (...) @getStance()
%2 = tail call i32 (...) @getSide()
%3 = tail call i32 (...) @getDegrees()
%4 = tail call i32 (...) @getFlip()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_hypersphere(int, char **);
int main(int argc, char *argv[]) {
  test_hypersphere(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_hypersphere(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ERANGE;
double with_errno(double, int /*<<< orphan*/);
__attribute__((__visibility__("hidden"))) double __math_check_uflow(double y) {
  return y == 0.0 ? with_errno(y, ERANGE) : y;
}


x86 assembly (clang, -O0):
<__math_check_uflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1152 <__math_check_uflow+0x42>
jp     1152 <__math_check_uflow+0x42>
movsd  -0x8(%rbp),%xmm0
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1030 <with_errno@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    115c <__math_check_uflow+0x4c>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__math_check_uflow>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112a <__math_check_uflow+0x1a>
jp     112a <__math_check_uflow+0x1a>
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <with_errno@plt>
ret

LLVM IR (-O0):
@ERANGE = global i32 0
define hidden double @__math_check_uflow(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = load i32, i32* @ERANGE
%8 = call double @with_errno(double %6, i32 %7)
br label %11
9: ; preds = %1
%10 = load double, double* %2
br label %11
11: ; preds = %9, %5
%12 = phi double [ %8, %5 ], [ %10, %9 ]
ret double %12
}

LLVM IR (-O2):
@ERANGE = global i32 0
define hidden double @__math_check_uflow(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @ERANGE
%5 = tail call double @with_errno(double %0, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ %0, %1 ]
ret double %7
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t sk_atomic_inc(int32_t *addr) {
  int32_t value = *addr;
  *addr = value + 1;
  return value;
}


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

x86 assembly (clang, -O2):
<sk_atomic_inc>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i64 @sk_atomic_inc(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 1
%8 = load i64*, i64** %2
store i64 %7, i64* %8
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @sk_atomic_inc(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = add nsw i64 %2, 1
store i64 %3, i64* %0
ret i64 %2
}
/* Variables and functions */
int foo(int, int);
int main(void) {
  return foo(24 * 2, 2);
  ;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x30,%edi
mov    $0x2,%esi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 48, i32 2)
ret i32 %1
}
/* Type definitions */
struct timeval {
  long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
long long Nife_time(struct timeval tv) {
  long long v;
  v = (long long)((long)tv.tv_usec) +
      ((long long)(tv.tv_sec - 946771200L) * (long long)1000000);
  return v;
}


x86 assembly (clang, -O0):
<Nife_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x386e9500,%rcx
imul   $0xf4240,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Nife_time>:
imul   $0xf4240,%rdi,%rcx
add    %rsi,%rcx
movabs $0xfffca2eaa6f0c000,%rax
a2 fc ff
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @Nife_time(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = alloca i64
%5 = bitcast %struct.timeval* %3 to { i64, i64 }*
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 0
store i64 %0, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sub nsw i64 %11, 946771200
%13 = mul nsw i64 %12, 1000000
%14 = add nsw i64 %9, %13
store i64 %14, i64* %4
%15 = load i64, i64* %4
ret i64 %15
}

LLVM IR (-O2):
define i64 @Nife_time(i64 %0, i64 %1) {
%3 = mul i64 %0, 1000000
%4 = add i64 %3, -946771200000000
%5 = add nsw i64 %4, %1
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ tlb_validate();
void tlb_init(void) { tlb_validate(); }


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

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

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

LLVM IR (-O2):
define void @tlb_init() {
%1 = tail call i32 (...) @tlb_validate()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_reti(FILE *stream) {
  fprintf(stream, "RETI                            ");
}


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

x86 assembly (clang, -O2):
<fprint_reti>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"RETI \00"
define void @fprint_reti(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"RETI \00"
define void @fprint_reti(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Variables and functions */
char *_strstr_word(char const *, char const *, int /*<<< orphan*/,
                   int /*<<< orphan*/, int);
char *strstr_word_suffix(const char *haystack, const char *needle) {
  return _strstr_word(haystack, needle, 0, 0, 1);
}


x86 assembly (clang, -O0):
<strstr_word_suffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%edx
call   1030 <_strstr_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr_word_suffix>:
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <_strstr_word@plt>

LLVM IR (-O0):
define i8* @strstr_word_suffix(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 i8* @_strstr_word(i8* %5, i8* %6, i32 0, i32 0, i32 1)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strstr_word_suffix(i8* %0, i8* %1) {
%3 = tail call i8* @_strstr_word(i8* %0, i8* %1, i32 0, i32 0, i32 1)
ret i8* %3
}
void RTMpGetCurFrequency(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMpGetCurFrequency() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int vixPlaybackOn(void) {
  printf("[genfb-demo-driver] "
         "playback on\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"[genfb-demo-driver] playback on\0A\00"
define i32 @vixPlaybackOn() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [32 x i8] c"[genfb-demo-driver] playback on\00"
define i32 @vixPlaybackOn() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug_ol(char *);
int /*<<< orphan*/ ol(char *);
dec() {
  debug_ol("; dec");
  ol("subd	#1");
}


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

x86 assembly (clang, -O2):
<dec>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <debug_ol@plt>
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"; dec\00"
@.str.1 = [8 x i8] c"subd\09\00"
define i32 @dec() {
%1 = alloca i32
%2 = call i32 @debug_ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"; dec\00"
@.str.1 = [8 x i8] c"subd\09\00"
define i32 @dec() {
%1 = tail call i32 @debug_ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
extern long long str_cpy(char *dest, const char *src) {
  long long res = 0;
  while ((*dest++ = *src++))
    ++res;
  return res;
}


x86 assembly (clang, -O0):
<str_cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114f <str_cpy+0x4f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <str_cpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cpy>:
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     1125 <str_cpy+0x25>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
movzbl 0x1(%rsi,%rcx,1),%edx
mov    %dl,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
test   %dl,%dl
jne    1110 <str_cpy+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @str_cpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 0, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = add nuw nsw i64 %6, 1
%12 = load i8, i8* %10
store i8 %12, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i64 [ 0, %2 ], [ %11, %5 ]
ret i64 %15
}
void swap(int *a, int *b) {
  *a += *b;
  *b = *a - *b;
  *a = *a - *b;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
add    (%rsi),%eax
mov    %eax,(%rdi)
sub    (%rsi),%eax
mov    %eax,(%rsi)
sub    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = sub nsw i32 %8, %7
store i32 %9, i32* %0
ret void
}
int subs_si_test3(int a, int b, int c) {
  int d = a - (b << 3);
  if (d == 0)
    return a + c;
  else
    return d;
}


x86 assembly (clang, -O0):
<subs_si_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1133 <subs_si_test3+0x33>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <subs_si_test3+0x39>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subs_si_test3>:
shl    $0x3,%esi
lea    (%rdx,%rdi,1),%eax
sub    %esi,%edi
test   %edi,%edi
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @subs_si_test3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = shl i32 %10, 3
%12 = sub nsw i32 %9, %11
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
store i32 %18, i32* %4
br label %21
19: ; preds = %3
%20 = load i32, i32* %8
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %15
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @subs_si_test3(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, -8
%5 = add i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %2, %0
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ function(int);
int g(int /*<<< orphan*/);
int function2(int x) { return g(function(x)); }


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

x86 assembly (clang, -O2):
<function2>:
push   %rax
call   1040 <function@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <g@plt>

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

LLVM IR (-O2):
define i32 @function2(i32 %0) {
%2 = tail call i32 @function(i32 %0)
%3 = tail call i32 @g(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ errno;
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ write_log(char *, char const *, char const *);
void log_error(const char *error_log) {
  const char *error_msg;
  error_msg = strerror(errno);
  write_log("%s :\n%s", error_log, error_msg);
}


x86 assembly (clang, -O0):
<log_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
call   1030 <write_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <write_log@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [8 x i8] c"%s :\0A%s\00"
define void @log_error(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @write_log(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [8 x i8] c"%s :\0A%s\00"
define void @log_error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @write_log(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
size_t fmt_s32_dec(char *, int /*<<< orphan*/);
int /*<<< orphan*/ print(char *, size_t);
void print_s32_dec(int32_t val) {
  char buf[11];
  size_t len = fmt_s32_dec(buf, val);
  print(buf, len);
}


x86 assembly (clang, -O0):
<print_s32_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xf(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <fmt_s32_dec@plt>
mov    %rax,-0x18(%rbp)
lea    -0xf(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_s32_dec>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%esi
lea    0x5(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <fmt_s32_dec@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @print_s32_dec(i32 %0) {
%2 = alloca i32
%3 = alloca [11 x i8]
%4 = alloca i64
store i32 %0, i32* %2
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i64 @fmt_s32_dec(i8* %5, i32 %6)
store i64 %7, i64* %4
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%9 = load i64, i64* %4
%10 = call i32 @print(i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @print_s32_dec(i32 %0) {
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%4 = call i64 @fmt_s32_dec(i8* %3, i32 %0)
%5 = call i32 @print(i8* %3, i64 %4)
ret void
}