xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *msg) {
  fprintf(stderr, "Usage: %s", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"Usage: %s\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"Usage: %s\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int fabs(double);
int /*<<< orphan*/ finite(double);
int equal(double a, double b) {
  if (!finite(a) || !finite(b))
    return 0;
  return fabs(a - b) < 1e-5;
  if (a == 0 && b == 0)
    return 1;
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xee2(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
je     1166 <equal+0x56>
movsd  -0x18(%rbp),%xmm0
movaps 0xec0(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xea4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1172 <equal+0x62>
movl   $0x0,-0x4(%rbp)
jmp    119c <equal+0x8c>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe7b(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
push   %rax
movapd 0xee7(%rip),%xmm2
movapd %xmm0,%xmm3
andpd  %xmm2,%xmm3
xor    %eax,%eax
ucomisd 0xee5(%rip),%xmm3
je     114d <equal+0x3d>
andpd  %xmm1,%xmm2
ucomisd 0xed7(%rip),%xmm2
je     114d <equal+0x3d>
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setle  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equal(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call double @llvm.fabs.f64(double %6)
%8 = fcmp one double %7, 0x7FF0000000000000
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load double, double* %5
%11 = call double @llvm.fabs.f64(double %10)
%12 = fcmp one double %11, 0x7FF0000000000000
br i1 %12, label %14, label %13
13: ; preds = %9, %2
store i32 0, i32* %3
br label %22
14: ; preds = %9
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fsub double %15, %16
%18 = call i32 @fabs(double %17)
%19 = sitofp i32 %18 to double
%20 = fcmp olt double %19, 1.000000e-05
%21 = zext i1 %20 to i32
store i32 %21, i32* %3
br label %22
22: ; preds = %14, %13
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @equal(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fcmp ueq double %3, 0x7FF0000000000000
%5 = tail call double @llvm.fabs.f64(double %1)
%6 = fcmp ueq double %5, 0x7FF0000000000000
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = fsub double %0, %1
%10 = tail call i32 @fabs(double %9)
%11 = icmp slt i32 %10, 1
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %8
%14 = phi i32 [ %12, %8 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ opr_bit(unsigned short *, int, int);
int set_bit(unsigned short *bit, int off) {
  opr_bit(bit, off, 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<set_bit>:
push   %rax
mov    $0x1,%edx
call   1030 <opr_bit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @set_bit(i16* %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 = load i32, i32* %4
%7 = call i32 @opr_bit(i16* %5, i32 %6, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @set_bit(i16* %0, i32 %1) {
%3 = tail call i32 @opr_bit(i16* %0, i32 %1, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ foo(int, int, int, int);
void start(void) {
  foo(1, 2, 3, 4);
  exit(5);
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <foo@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<start>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <foo@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @start() {
%1 = call i32 @foo(i32 1, i32 2, i32 3, i32 4)
%2 = call i32 @exit(i32 5)
unreachable
}

LLVM IR (-O2):
define void @start() {
%1 = tail call i32 @foo(i32 1, i32 2, i32 3, i32 4)
%2 = tail call i32 @exit(i32 5)
unreachable
}
void foo569() {}


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

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

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

LLVM IR (-O2):
define void @foo569() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
two(void) { printf("two\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"two\00"
define i32 @two() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void clear_bit(unsigned long nr, volatile void *addr) {
  volatile unsigned long *a = addr;
  unsigned long mask;
  a += nr >> 5;
  mask = 1UL << (nr & 31);
  *a &= ~mask;
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x5,%rax
shl    $0x3,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x1f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %rdi,%rcx
mov    %rdi,%rax
and    $0x1f,%cl
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
shr    $0x5,%rax
and    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @clear_bit(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64
store i64 %0, i64* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i64, i64* %3
%10 = lshr i64 %9, 5
%11 = load i64*, i64** %5
%12 = getelementptr inbounds i64, i64* %11, i64 %10
store i64* %12, i64** %5
%13 = load i64, i64* %3
%14 = and i64 %13, 31
%15 = shl i64 1, %14
store i64 %15, i64* %6
%16 = load i64, i64* %6
%17 = xor i64 %16, -1
%18 = load i64*, i64** %5
%19 = load volatile i64, i64* %18
%20 = and i64 %19, %17
store volatile i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @clear_bit(i64 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
%4 = lshr i64 %0, 5
%5 = getelementptr inbounds i64, i64* %3, i64 %4
%6 = and i64 %0, 31
%7 = shl nuw nsw i64 1, %6
%8 = xor i64 %7, -1
%9 = load volatile i64, i64* %5
%10 = and i64 %9, %8
store volatile i64 %10, i64* %5
ret void
}
int isker(y)
int y;
{ return (y == 10); }


x86 assembly (clang, -O0):
<isker>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isker>:
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isker(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isker(i32 %0) {
%2 = icmp eq i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int numDecodings(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "Usage: ./test number\n");
    exit(-1);
  }
  printf("%d\n", numDecodings(argv[1]));
  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   $0x2,-0x8(%rbp)
je     117f <main+0x3f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <numDecodings@plt>
mov    %eax,%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1161 <main+0x21>
mov    0x8(%rsi),%rdi
call   1050 <numDecodings@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: ./test number\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @numDecodings(i8* %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int list_strcmp(char *, char *);
int /*<<< orphan*/ trim_index(char *, char *);
int list_string_index_compare(char *s1, char *s2) {
  char s1_buffer[128];
  char s2_buffer[128];
  trim_index(s1_buffer, s1);
  trim_index(s2_buffer, s2);
  return list_strcmp(s1_buffer, s2_buffer);
}


x86 assembly (clang, -O0):
<list_string_index_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <trim_index@plt>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <trim_index@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1040 <list_strcmp@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_string_index_compare>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x80(%rsp),%r14
mov    %r14,%rdi
call   1030 <trim_index@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <trim_index@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <list_strcmp@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @list_string_index_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
%6 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @trim_index(i8* %7, i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @trim_index(i8* %10, i8* %11)
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%15 = call i32 @list_strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @list_string_index_compare(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%7 = call i32 @trim_index(i8* %5, i8* %0)
%8 = call i32 @trim_index(i8* %6, i8* %1)
%9 = call i32 @list_strcmp(i8* %5, i8* %6)
ret i32 %9
}
/* Type definitions */
struct ringbuffer {
  int dummy;
};
typedef int int32_t;

/* Variables and functions */
int calc_used_space(struct ringbuffer *, int /*<<< orphan*/);
int32_t rb_length(struct ringbuffer *rb) {
  if (!rb) {
    return -1;
  }
  return calc_used_space(rb, 0);
}


x86 assembly (clang, -O0):
<rb_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <rb_length+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <rb_length+0x31>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <calc_used_space@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_length>:
test   %rdi,%rdi
je     111c <rb_length+0xc>
xor    %esi,%esi
jmp    1030 <calc_used_space@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.ringbuffer = type { i32 }
define i32 @rb_length(%struct.ringbuffer* %0) {
%2 = icmp eq %struct.ringbuffer* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @calc_used_space(%struct.ringbuffer* %0, i32 0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
int r(int x) {
  int ret = 0;
  while (x > 0) {
    ret += x % 10;
    x /= 10;
  }
  return ret;
}


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113c <r+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <r+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
xor    %eax,%eax
test   %edi,%edi
jle    112d <r+0x2d>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <r+0x10>
ret

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

LLVM IR (-O2):
define i32 @r(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = add nuw nsw i32 %4, %6
%8 = udiv i32 %5, 10
%9 = icmp ult i32 %5, 10
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ fEqual(float, double);
float sin(float);
float sinc(float x) {
  return fEqual(x, 0.0)
             ? 1.0
             : sin(x * 3.14159265358979323846) / (x * 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1030 <fEqual@plt>
cmp    $0x0,%rax
je     1156 <sinc+0x36>
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1196 <sinc+0x76>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe99(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <sin@plt>
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe77(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rax
xorps  %xmm1,%xmm1
movss  %xmm0,(%rsp)
call   1030 <fEqual@plt>
test   %rax,%rax
je     113d <sinc+0x1d>
movss  0xec5(%rip),%xmm0
pop    %rax
ret
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeba(%rip),%xmm0
movsd  %xmm0,(%rsp)
cvtsd2ss %xmm0,%xmm0
call   1040 <sin@plt>
cvtss2sd %xmm0,%xmm0
divsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sinc(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @fEqual(float %3, double 0.000000e+00)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %18
7: ; preds = %1
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %9, 0x400921FB54442D18
%11 = fptrunc double %10 to float
%12 = call float @sin(float %11)
%13 = fpext float %12 to double
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = fmul double %15, 0x400921FB54442D18
%17 = fdiv double %13, %16
br label %18
18: ; preds = %7, %6
%19 = phi double [ 1.000000e+00, %6 ], [ %17, %7 ]
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @sinc(float %0) {
%2 = tail call i64 @fEqual(float %0, double 0.000000e+00)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = fpext float %0 to double
%6 = fmul double %5, 0x400921FB54442D18
%7 = fptrunc double %6 to float
%8 = tail call float @sin(float %7)
%9 = fpext float %8 to double
%10 = fdiv double %9, %6
%11 = fptrunc double %10 to float
br label %12
12: ; preds = %1, %4
%13 = phi float [ %11, %4 ], [ 1.000000e+00, %1 ]
ret float %13
}
void clearvector(float *v) {
  int i = 0;
  for (; i < 1001; i++) {
    v[i] = 0;
  }
}


x86 assembly (clang, -O0):
<clearvector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e9,-0xc(%rbp)
jge    113a <clearvector+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clearvector+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearvector>:
push   %rax
mov    $0xfa4,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @clearvector(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to i8*
ret void
}
/* Variables and functions */
unsigned int _bzhi_u32(unsigned int, int);
unsigned int f8(unsigned int x) { return _bzhi_u32(x, 32); }


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

x86 assembly (clang, -O2):
<f8>:
mov    $0x20,%esi
jmp    1030 <_bzhi_u32@plt>

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

LLVM IR (-O2):
define i32 @f8(i32 %0) {
%2 = tail call i32 @_bzhi_u32(i32 %0, i32 32)
ret i32 %2
}
void fitfun_initialize() {}


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

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

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

LLVM IR (-O2):
define void @fitfun_initialize() {
ret void
}
void *ifunc_one(int (*f1)(void)) { return f1; }


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

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

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

LLVM IR (-O2):
define i8* @ifunc_one(i32 ()* readnone %0) {
%2 = bitcast i32 ()* %0 to i8*
ret i8* %2
}
unsigned int mylinux(int maj, int rev, int min) {
  return min | rev << 10 | maj << 13;
}


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

x86 assembly (clang, -O2):
<mylinux>:
mov    %edi,%eax
shl    $0xa,%esi
shl    $0xd,%eax
or     %edx,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @mylinux(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 10
%5 = shl i32 %0, 13
%6 = or i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
double fsq(double);
double inv(double);
double inv2(double x) {
  double tmp;
  tmp = fsq(x);
  if (tmp != 0.0) {
    tmp = inv(tmp);
    if (x < 0.0) {
      tmp = -tmp;
    }
  }
  return tmp;
}


x86 assembly (clang, -O0):
<inv2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fsq@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1159 <inv2+0x39>
jp     1159 <inv2+0x39>
jmp    119c <inv2+0x7c>
movsd  -0x10(%rbp),%xmm0
call   1040 <inv@plt>
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1197 <inv2+0x77>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    119c <inv2+0x7c>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv2>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <fsq@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1137 <inv2+0x17>
jnp    114f <inv2+0x2f>
call   1040 <inv@plt>
xorpd  %xmm1,%xmm1
ucomisd (%rsp),%xmm1
jbe    114f <inv2+0x2f>
xorpd  0xeb1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @inv2(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @fsq(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp une double %6, 0.000000e+00
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load double, double* %3
%10 = call double @inv(double %9)
store double %10, double* %3
%11 = load double, double* %2
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load double, double* %3
%15 = fneg double %14
store double %15, double* %3
br label %16
16: ; preds = %13, %8
br label %17
17: ; preds = %16, %1
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @inv2(double %0) {
%2 = tail call double @fsq(double %0)
%3 = fcmp une double %2, 0.000000e+00
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call double @inv(double %2)
%6 = fcmp olt double %0, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = fneg double %5
br label %9
9: ; preds = %4, %7, %1
%10 = phi double [ %8, %7 ], [ %5, %4 ], [ %2, %1 ]
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fprintf(int /*<<< orphan*/ *, char *, double, double);
int print_logp(FILE *fp, double phi, double logp) {
  if (2 != fprintf(fp, "LOG_P_PHI %lf %lf\n", phi, logp)) {
    return EOF;
  }
  return 1;
}


x86 assembly (clang, -O0):
<print_logp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     1160 <print_logp+0x50>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <print_logp+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_logp>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
je     1132 <print_logp+0x22>
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"LOG_P_PHI %lf %lf\0A\00"
@EOF = global i32 0
define i32 @print_logp(i32* nocapture %0, double %1, double %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %1, double %2)
%5 = icmp eq i32 %4, 2
%6 = load i32, i32* @EOF
%7 = select i1 %5, i32 1, i32 %6
ret i32 %7
}
unsigned int net_hash_mix(struct net *net) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net = type opaque
define i32 @net_hash_mix(%struct.net* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ safef(char *, int, char *, char *);
void parallelFetchRemovePartial(char *destName) {
  char paraTmpFile[512];
  safef(paraTmpFile, 512, "%s.paraFetch", destName);
  remove(paraTmpFile);
  safef(paraTmpFile, 512, "%s.paraFetchStatus", destName);
  remove(paraTmpFile);
}


x86 assembly (clang, -O0):
<parallelFetchRemovePartial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x200,%esi
lea    0xeba(%rip),%rdx
call   1040 <safef@plt>
lea    -0x210(%rbp),%rdi
call   1030 <remove@plt>
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x200,%esi
lea    0xe9f(%rip),%rdx
call   1040 <safef@plt>
lea    -0x210(%rbp),%rdi
call   1030 <remove@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallelFetchRemovePartial>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
lea    0xecc(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x200,%esi
mov    %rbx,%rcx
call   1040 <safef@plt>
mov    %r14,%rdi
call   1030 <remove@plt>
lea    0xeb7(%rip),%rdx
mov    %r14,%rdi
mov    $0x200,%esi
mov    %rbx,%rcx
call   1040 <safef@plt>
mov    %r14,%rdi
call   1030 <remove@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s.paraFetch\00"
@.str.1 = [19 x i8] c"%s.paraFetchStatus\00"
define void @parallelFetchRemovePartial(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @safef(i8* %4, i32 512, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @remove(i8* %7)
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = call i32 @safef(i8* %9, i32 512, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%13 = call i32 @remove(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s.paraFetch\00"
@.str.1 = [19 x i8] c"%s.paraFetchStatus\00"
define void @parallelFetchRemovePartial(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @safef(i8* %3, i32 512, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @remove(i8* %3)
%6 = call i32 @safef(i8* %3, i32 512, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = call i32 @remove(i8* %3)
ret void
}
int test_imm_17uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x17 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_17uint64_midword_mem>:
testb  $0x17,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_17uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1507328
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int rmdir(char const *);
int delete_directory(const char *path) { return rmdir(path); }


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

x86 assembly (clang, -O2):
<delete_directory>:
jmp    1030 <rmdir@plt>

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

LLVM IR (-O2):
define i32 @delete_directory(i8* nocapture %0) {
%2 = tail call i32 @rmdir(i8* %0)
ret i32 %2
}
void foo665(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo665(i32 %0) {
ret void
}
/* Variables and functions */
float _BigFloat(float);
float BigFloat(float l) { return _BigFloat(l); }


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

x86 assembly (clang, -O2):
<BigFloat>:
jmp    1030 <_BigFloat@plt>

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

LLVM IR (-O2):
define float @BigFloat(float %0) {
%2 = tail call float @_BigFloat(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(char const *, int, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void indent(size_t n) {
  static const char spaces[] =
      "                                                                "
      "                                                                "
      "                                                                "
      "                                                                ";
  fwrite(spaces, 1, n * 4, stdout);
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shl    $0x2,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%ecx
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
lea    0x0(,%rdi,4),%rdx
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@indent.spaces = internal constant [257 x i8] c" \00"
@stdout = global i32 0
define void @indent(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 4
%5 = load i32, i32* @stdout
%6 = call i32 @fwrite(i8* getelementptr inbounds ([257 x i8], [257 x i8]* @indent.spaces, i64 0, i64 0), i32 1, i64 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@indent.spaces = internal constant [257 x i8] c" \00"
@stdout = global i32 0
define void @indent(i64 %0) {
%2 = shl i64 %0, 2
%3 = load i32, i32* @stdout
%4 = tail call i32 @fwrite(i8* getelementptr inbounds ([257 x i8], [257 x i8]* @indent.spaces, i64 0, i64 0), i32 1, i64 %2, i32 %3)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void clearStdIn() {
  int c;
  while ((c = getchar()) != '\n' && c != EOF)
    ;
}


x86 assembly (clang, -O0):
<clearStdIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1144 <clearStdIn+0x34>
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1154 <clearStdIn+0x44>
jmp    1159 <clearStdIn+0x49>
jmp    1118 <clearStdIn+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearStdIn>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <clearStdIn+0x20>
cmp    (%rbx),%eax
jne    1120 <clearStdIn+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @clearStdIn() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @clearStdIn() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int /*<<< orphan*/ FE_INEXACT;
int /*<<< orphan*/ FE_INVALID;
int /*<<< orphan*/ feclearexcept(int /*<<< orphan*/);
int /*<<< orphan*/ feholdexcept(int /*<<< orphan*/ *);
scalar_t__ fetestexcept(int /*<<< orphan*/);
int /*<<< orphan*/ feupdateenv(int /*<<< orphan*/ *);
scalar_t__ rint(double);
long lrint(double x) {
  fenv_t env;
  long d;
  feholdexcept(&env);
  d = (long)rint(x);
  if (fetestexcept(FE_INVALID))
    feclearexcept(FE_INEXACT);
  feupdateenv(&env);
  return (d);
}


x86 assembly (clang, -O0):
<lrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1060 <feholdexcept@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <rint@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1030 <fetestexcept@plt>
cmp    $0x0,%rax
je     119a <lrint+0x4a>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
call   1070 <feclearexcept@plt>
lea    -0xc(%rbp),%rdi
call   1050 <feupdateenv@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrint>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0x4(%rsp),%rdi
call   1060 <feholdexcept@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <rint@plt>
mov    %rax,%rbx
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1030 <fetestexcept@plt>
test   %rax,%rax
je     1194 <lrint+0x44>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1070 <feclearexcept@plt>
lea    0x4(%rsp),%rdi
call   1050 <feupdateenv@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@FE_INVALID = global i32 0
@FE_INEXACT = global i32 0
define i64 @lrint(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i64
store double %0, double* %2
%5 = call i32 @feholdexcept(i32* %3)
%6 = load double, double* %2
%7 = call i64 @rint(double %6)
store i64 %7, i64* %4
%8 = load i32, i32* @FE_INVALID
%9 = call i64 @fetestexcept(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* @FE_INEXACT
%13 = call i32 @feclearexcept(i32 %12)
br label %14
14: ; preds = %11, %1
%15 = call i32 @feupdateenv(i32* %3)
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
@FE_INVALID = global i32 0
@FE_INEXACT = global i32 0
define i64 @lrint(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @feholdexcept(i32* %2)
%5 = call i64 @rint(double %0)
%6 = load i32, i32* @FE_INVALID
%7 = call i64 @fetestexcept(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* @FE_INEXACT
%11 = call i32 @feclearexcept(i32 %10)
br label %12
12: ; preds = %9, %1
%13 = call i32 @feupdateenv(i32* %2)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ io_set_pgc(int);
int /*<<< orphan*/ io_set_pgd(int);
int /*<<< orphan*/ io_set_pgm(int);
int /*<<< orphan*/ io_set_vpp(int);
void pic14n_standby(void) {
  io_set_pgd((0x00));
  io_set_pgc((0x00));
  io_set_vpp((0x00));
  io_set_pgm((0x00));
}


x86 assembly (clang, -O0):
<pic14n_standby>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <io_set_pgd@plt>
xor    %edi,%edi
call   1060 <io_set_pgc@plt>
xor    %edi,%edi
call   1040 <io_set_vpp@plt>
xor    %edi,%edi
call   1030 <io_set_pgm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic14n_standby>:
push   %rax
xor    %edi,%edi
call   1050 <io_set_pgd@plt>
xor    %edi,%edi
call   1060 <io_set_pgc@plt>
xor    %edi,%edi
call   1040 <io_set_vpp@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <io_set_pgm@plt>

LLVM IR (-O0):
define void @pic14n_standby() {
%1 = call i32 @io_set_pgd(i32 0)
%2 = call i32 @io_set_pgc(i32 0)
%3 = call i32 @io_set_vpp(i32 0)
%4 = call i32 @io_set_pgm(i32 0)
ret void
}

LLVM IR (-O2):
define void @pic14n_standby() {
%1 = tail call i32 @io_set_pgd(i32 0)
%2 = tail call i32 @io_set_pgc(i32 0)
%3 = tail call i32 @io_set_vpp(i32 0)
%4 = tail call i32 @io_set_pgm(i32 0)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
size_t strxfrm(char *to, const char *from, size_t maxsize) {
  strncpy(to, from, maxsize);
  return strlen(from);
}


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

x86 assembly (clang, -O2):
<strxfrm>:
push   %rbx
mov    %rsi,%rbx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

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

LLVM IR (-O2):
define i64 @strxfrm(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int usage(void) {
  printf("usage: dechunk [-f framerate] <input movie> <output prefix>\n");
  printf("	Movies containing rgb frames are written as ppm images.\n");
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"usage: dechunk [-f framerate] <input movie> <output prefix>\0A\00"
@.str.1 = [58 x i8] c"\09Movies containing rgb frames are written as ppm images.\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [60 x i8] c"usage: dechunk [-f framerate] <input movie> <output prefix>\00"
@str.2 = [57 x i8] c"\09Movies containing rgb frames are written as ppm images.\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void showLogin() {}


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

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

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

LLVM IR (-O2):
define void @showLogin() {
ret void
}
int gpio_request(unsigned gpio, const char *label) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_request(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("HELLO WORLD!\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 = [14 x i8] c"HELLO WORLD!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"HELLO WORLD!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_retrieve_quaddobl_solution(int n, int k, int *m, double *sol) {
  int fail;
  fail = _ada_use_c2phc(394, &k, m, sol);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_retrieve_quaddobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x18a,%edi
lea    -0x8(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_retrieve_quaddobl_solution>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x18a,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_retrieve_quaddobl_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%10 = load i32*, i32** %7
%11 = load double*, double** %8
%12 = call i32 @_ada_use_c2phc(i32 394, i32* %6, i32* %10, double* %11)
store i32 %12, i32* %9
%13 = load i32, i32* %9
ret i32 %13
}

LLVM IR (-O2):
define i32 @solcon_retrieve_quaddobl_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc(i32 394, i32* %5, i32* %2, double* %3)
ret i32 %6
}