xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putstr(char *);
int exit_error(char **tab) {
  ft_putstr(tab[0]);
  ft_putstr(": Argument '");
  ft_putstr(tab[1]);
  ft_putendl("' must be an integer");
  return (1);
}


x86 assembly (clang, -O0):
<exit_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <ft_putstr@plt>
lea    0xec1(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <ft_putstr@plt>
lea    0xeb5(%rip),%rdi
call   1030 <ft_putendl@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_error>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1040 <ft_putstr@plt>
lea    0xecd(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    0x8(%rbx),%rdi
call   1040 <ft_putstr@plt>
lea    0xec5(%rip),%rdi
call   1030 <ft_putendl@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c": Argument '\00"
@.str.1 = [21 x i8] c"' must be an integer\00"
define i32 @exit_error(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @ft_putstr(i8* %5)
%7 = call i32 @ft_putstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = load i8**, i8*** %2
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @ft_putstr(i8* %10)
%12 = call i32 @ft_putendl(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c": Argument '\00"
@.str.1 = [21 x i8] c"' must be an integer\00"
define i32 @exit_error(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @ft_putstr(i8* %2)
%4 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_putstr(i8* %6)
%8 = tail call i32 @ft_putendl(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ __NR_read;
int /*<<< orphan*/ access_ok(char *, size_t);
int syscall(int /*<<< orphan*/, int, char *, size_t);
int op_read(int fd, char *p, size_t size) {
  if (!access_ok(p, size))
    return -1;
  return syscall(__NR_read, fd, p, size);
}


x86 assembly (clang, -O0):
<op_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <access_ok@plt>
cmp    $0x0,%eax
jne    1155 <op_read+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <op_read+0x51>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_read>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <access_ok@plt>
test   %eax,%eax
je     1155 <op_read+0x35>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <syscall@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@__NR_read = global i32 0
define i32 @op_read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @access_ok(i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* @__NR_read
%8 = tail call i32 @syscall(i32 %7, i32 %0, i8* %1, i64 %2)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %8, %6 ], [ -1, %3 ]
ret i32 %10
}
int ld_gt_rr1(long double a1, long double a2) { return (((a1) > (a2))); }


x86 assembly (clang, -O0):
<ld_gt_rr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_gt_rr1>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_gt_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp ogt x86_fp80 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ld_gt_rr1(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ogt x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int HelpItem57(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem57() {
ret i32 0
}
double dor(double x, double y) { return ((double)(x || y)); }


x86 assembly (clang, -O0):
<dor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1142 <dor+0x42>
jp     1142 <dor+0x42>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dor>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @dor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp une double %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp une double %8, 0.000000e+00
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @dor(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = or i1 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
int test_ezFiveEighths(int x) { return (x * 5) / 8; }


x86 assembly (clang, -O0):
<test_ezFiveEighths>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ezFiveEighths>:
lea    (%rdi,%rdi,4),%ecx
lea    (%rdi,%rdi,4),%eax
add    $0x7,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @test_ezFiveEighths(i32 %0) {
%2 = mul nsw i32 %0, 5
%3 = sdiv i32 %2, 8
ret i32 %3
}
void PutInt32PreservedEndian(int val, void *ptr) {
  unsigned char *uptr = (unsigned char *)ptr;
  uptr[0] = (val >> 0) & 0xff;
  uptr[1] = (val >> 8) & 0xff;
  uptr[2] = (val >> 16) & 0xff;
  uptr[3] = (val >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<PutInt32PreservedEndian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutInt32PreservedEndian>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @PutInt32PreservedEndian(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i32, i32* %3
%8 = ashr i32 %7, 0
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %3
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
%19 = load i32, i32* %3
%20 = ashr i32 %19, 16
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8 %22, i8* %24
%25 = load i32, i32* %3
%26 = ashr i32 %25, 24
%27 = and i32 %26, 255
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 3
store i8 %28, i8* %30
ret void
}

LLVM IR (-O2):
define void @PutInt32PreservedEndian(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_libname(void) { printf("mips32\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"mips32\00"
define void @get_libname() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char SL11Read(int);
int /*<<< orphan*/ SL11Write(int, unsigned char);
int /*<<< orphan*/ cfe_sleep(int);
int /*<<< orphan*/ speed_detect();
void USBReset(void) {
  unsigned char tmp;
  tmp = SL11Read(0x05);
  SL11Write(0x05, tmp | 0x08);
  cfe_sleep(10 / 4);
  SL11Write(0x05, tmp | 0x18);
  cfe_sleep(10 / 6);
  SL11Write(0x05, tmp | 0x08);
  cfe_sleep(10 / 10);
  speed_detect();
}


x86 assembly (clang, -O0):
<USBReset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <SL11Read@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
or     $0x8,%eax
mov    $0x5,%edi
movzbl %al,%esi
call   1030 <SL11Write@plt>
mov    $0x2,%edi
call   1060 <cfe_sleep@plt>
movzbl -0x1(%rbp),%eax
or     $0x18,%eax
mov    $0x5,%edi
movzbl %al,%esi
call   1030 <SL11Write@plt>
mov    $0x1,%edi
call   1060 <cfe_sleep@plt>
movzbl -0x1(%rbp),%eax
or     $0x8,%eax
mov    $0x5,%edi
movzbl %al,%esi
call   1030 <SL11Write@plt>
mov    $0x1,%edi
call   1060 <cfe_sleep@plt>
mov    $0x0,%al
call   1050 <speed_detect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBReset>:
push   %rbp
push   %rbx
push   %rax
mov    $0x5,%edi
call   1040 <SL11Read@plt>
mov    %eax,%ebx
or     $0x8,%al
movzbl %al,%ebp
mov    $0x5,%edi
mov    %ebp,%esi
call   1030 <SL11Write@plt>
mov    $0x2,%edi
call   1060 <cfe_sleep@plt>
or     $0x18,%bl
movzbl %bl,%esi
mov    $0x5,%edi
call   1030 <SL11Write@plt>
mov    $0x1,%edi
call   1060 <cfe_sleep@plt>
mov    $0x5,%edi
mov    %ebp,%esi
call   1030 <SL11Write@plt>
mov    $0x1,%edi
call   1060 <cfe_sleep@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <speed_detect@plt>

LLVM IR (-O0):
define void @USBReset() {
%1 = alloca i8
%2 = call zeroext i8 @SL11Read(i32 5)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = or i32 %4, 8
%6 = trunc i32 %5 to i8
%7 = call i32 @SL11Write(i32 5, i8 zeroext %6)
%8 = call i32 @cfe_sleep(i32 2)
%9 = load i8, i8* %1
%10 = zext i8 %9 to i32
%11 = or i32 %10, 24
%12 = trunc i32 %11 to i8
%13 = call i32 @SL11Write(i32 5, i8 zeroext %12)
%14 = call i32 @cfe_sleep(i32 1)
%15 = load i8, i8* %1
%16 = zext i8 %15 to i32
%17 = or i32 %16, 8
%18 = trunc i32 %17 to i8
%19 = call i32 @SL11Write(i32 5, i8 zeroext %18)
%20 = call i32 @cfe_sleep(i32 1)
%21 = call i32 (...) @speed_detect()
ret void
}

LLVM IR (-O2):
define void @USBReset() {
%1 = tail call zeroext i8 @SL11Read(i32 5)
%2 = or i8 %1, 8
%3 = tail call i32 @SL11Write(i32 5, i8 zeroext %2)
%4 = tail call i32 @cfe_sleep(i32 2)
%5 = or i8 %1, 24
%6 = tail call i32 @SL11Write(i32 5, i8 zeroext %5)
%7 = tail call i32 @cfe_sleep(i32 1)
%8 = tail call i32 @SL11Write(i32 5, i8 zeroext %2)
%9 = tail call i32 @cfe_sleep(i32 1)
%10 = tail call i32 (...) @speed_detect()
ret void
}
void updateHardwareRevision(void) {}


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

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

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

LLVM IR (-O2):
define void @updateHardwareRevision() {
ret void
}
int test_imm_0Fint8_reg(signed char val) {
  return ((val) & (-0x0F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Fint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xfffffff1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_0Fint8_reg(i8 signext %0) {
%2 = and i8 %0, -15
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ axes(int /*<<< orphan*/, int, int);
char **graph_sin(int /*<<< orphan*/, int, int, double, int, int);
int /*<<< orphan*/ zero_graph(int, int);
char **graph(int w, int h, int power) {
  return graph_sin(axes(zero_graph(w, h), w, h), w, h, .2, 2, power);
}


x86 assembly (clang, -O0):
<graph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <zero_graph@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <axes@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
movsd  0xe93(%rip),%xmm0
mov    $0x2,%ecx
call   1050 <graph_sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <zero_graph@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <axes@plt>
movsd  0xead(%rip),%xmm0
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x2,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <graph_sin@plt>

LLVM IR (-O0):
define i8** @graph(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 = call i32 @zero_graph(i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @axes(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i8** @graph_sin(i32 %12, i32 %13, i32 %14, double 2.000000e-01, i32 2, i32 %15)
ret i8** %16
}

LLVM IR (-O2):
define i8** @graph(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @zero_graph(i32 %0, i32 %1)
%5 = tail call i32 @axes(i32 %4, i32 %0, i32 %1)
%6 = tail call i8** @graph_sin(i32 %5, i32 %0, i32 %1, double 2.000000e-01, i32 2, i32 %2)
ret i8** %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
void function() {
  int var = 5;
  static int static_var = 5;
  printf("\t[in function] var  @ %p = %d\n", &var, var);
  printf("\t[in function] static_var @ %p = %d\n", &static_var, static_var);
  var++;
  static_var++;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xed7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <printf@plt>
mov    0x2ef0(%rip),%edx
lea    0xee0(%rip),%rdi
lea    0x2ee2(%rip),%rsi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    0x2ece(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ec5(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x5,%edx
call   1030 <printf@plt>
mov    0x2ef3(%rip),%edx
lea    0x2eec(%rip),%rsi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
addl   $0x1,0x2ed9(%rip)
pop    %rax
ret

LLVM IR (-O0):
@function.static_var = internal global i32 5
@.str = [31 x i8] c"\09[in function] var @ %p = %d\0A\00"
@.str.1 = [37 x i8] c"\09[in function] static_var @ %p = %d\0A\00"
define void @function() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32* %1, i32 %2)
%4 = load i32, i32* @function.static_var
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32* @function.static_var, i32 %4)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* @function.static_var
%9 = add nsw i32 %8, 1
store i32 %9, i32* @function.static_var
ret void
}

LLVM IR (-O2):
@function.static_var = internal global i32 5
@.str = [31 x i8] c"\09[in function] var @ %p = %d\0A\00"
@.str.1 = [37 x i8] c"\09[in function] static_var @ %p = %d\0A\00"
define void @function() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32* %1, i32 5)
%4 = load i32, i32* @function.static_var
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32* @function.static_var, i32 %4)
%6 = load i32, i32* @function.static_var
%7 = add nsw i32 %6, 1
store i32 %7, i32* @function.static_var
ret void
}
int GetSectorSize(int N) { return (1 << (N & 0x07)) << 7; }


x86 assembly (clang, -O0):
<GetSectorSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSectorSize>:
mov    %edi,%ecx
and    $0x7,%cl
mov    $0x80,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @GetSectorSize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 7
%5 = shl i32 1, %4
%6 = shl i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @GetSectorSize(i32 %0) {
%2 = and i32 %0, 7
%3 = shl nuw nsw i32 128, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ findBlocks();
int /*<<< orphan*/ findLeaders();
int /*<<< orphan*/ fromFile();
int main() {
  fromFile();
  findLeaders();
  findBlocks();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fromFile()
%2 = tail call i32 (...) @findLeaders()
%3 = tail call i32 (...) @findBlocks()
ret i32 0
}
/* Variables and functions */
int console_print(char *);
int console_writechar(char c) {
  char biddy[2] = {0};
  biddy[0] = c;
  return console_print(biddy);
}


x86 assembly (clang, -O0):
<console_writechar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x3(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <memset@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
lea    -0x3(%rbp),%rdi
call   1030 <console_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_writechar>:
push   %rax
movw   $0x0,0x6(%rsp)
mov    %dil,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <console_print@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @console_writechar(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = bitcast [2 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %5, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @console_print(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @console_writechar(i8 signext %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 0, i16* %2
store i8 %0, i8* %3
%4 = call i32 @console_print(i8* %3)
ret i32 %4
}
int hex(char ch) {
  if (ch >= 'A' && ch <= 'Z')
    return (ch - 'A') + 10;
  if (ch >= '0' && ch <= '9')
    return ch - '0';
  return 0;
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <hex+0x36>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <hex+0x36>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <hex+0x66>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     115f <hex+0x5f>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     115f <hex+0x5f>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <hex+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
mov    %edi,%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     110e <hex+0xe>
add    $0xffffffc9,%eax
ret
lea    -0x30(%rax),%ecx
add    $0xffffffd0,%eax
xor    %edx,%edx
cmp    $0xa,%cl
cmovb  %eax,%edx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 10
store i32 %15, i32* %2
br label %29
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 48
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 57
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 48
store i32 %27, i32* %2
br label %29
28: ; preds = %20, %16
store i32 0, i32* %2
br label %29
29: ; preds = %28, %24, %11
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @hex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -55
br label %12
7: ; preds = %1
%8 = add i8 %0, -48
%9 = icmp ult i8 %8, 10
%10 = add nsw i32 %2, -48
%11 = select i1 %9, i32 %10, i32 0
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hola mundo!\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)
lea    0xed3(%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 = [13 x i8] c"Hola mundo!\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 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hola mundo!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *response_msg(int, char *);
char *version_info() {
  return response_msg(220, "YAFTPd - Yet Another FTP daemon v0.1");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"YAFTPd - Yet Another FTP daemon v0.1\00"
define i8* @version_info() {
%1 = call i8* @response_msg(i32 220, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [37 x i8] c"YAFTPd - Yet Another FTP daemon v0.1\00"
define i8* @version_info() {
%1 = tail call i8* @response_msg(i32 220, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
short zig_zag_unfixs(unsigned short inp) {
  return ((short)(((inp)&1) ? (~((inp) >> 1)) : ((inp) >> 1)));
}


x86 assembly (clang, -O0):
<zig_zag_unfixs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112d <zig_zag_unfixs+0x2d>
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <zig_zag_unfixs+0x37>
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<zig_zag_unfixs>:
mov    %edi,%eax
shr    %eax
and    $0x1,%edi
neg    %edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @zig_zag_unfixs(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 1
%11 = xor i32 %10, -1
br label %16
12: ; preds = %1
%13 = load i16, i16* %2
%14 = zext i16 %13 to i32
%15 = ashr i32 %14, 1
br label %16
16: ; preds = %12, %7
%17 = phi i32 [ %11, %7 ], [ %15, %12 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @zig_zag_unfixs(i16 zeroext %0) {
%2 = lshr i16 %0, 1
%3 = and i16 %0, 1
%4 = sub nsw i16 0, %3
%5 = xor i16 %2, %4
ret i16 %5
}
void ff_hevc_put_hevc_uni_w_pel_pixels8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels8_8_sse4() {
ret void
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stub_print_queue_stats(struct activity *, int, int,
                                          unsigned long long,
                                          int /*<<< orphan*/);
void print_queue_stats(struct activity *a, int prev, int curr,
                       unsigned long long itv) {
  stub_print_queue_stats(a, prev, curr, itv, 0);
}


x86 assembly (clang, -O0):
<print_queue_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <stub_print_queue_stats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_queue_stats>:
xor    %r8d,%r8d
jmp    1030 <stub_print_queue_stats@plt>

LLVM IR (-O0):
%struct.activity = type { i32 }
define void @print_queue_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca %struct.activity*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store %struct.activity* %0, %struct.activity** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load %struct.activity*, %struct.activity** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i64, i64* %8
%13 = call i32 @stub_print_queue_stats(%struct.activity* %9, i32 %10, i32 %11, i64 %12, i32 0)
ret void
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define void @print_queue_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i32 @stub_print_queue_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ceil(int);
int log(int);
unsigned int pow(int, int /*<<< orphan*/);
unsigned int next_pow2(int n) { return pow(2, ceil(log(n) / log(2))); }


x86 assembly (clang, -O0):
<next_pow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <log@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %eax,%esi
mov    $0x2,%edi
call   1050 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_pow2>:
push   %rbx
call   1040 <log@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
mov    $0x2,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <pow@plt>

LLVM IR (-O0):
define i32 @next_pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @log(i32 %3)
%5 = call i32 @log(i32 2)
%6 = sdiv i32 %4, %5
%7 = call i32 @ceil(i32 %6)
%8 = call i32 @pow(i32 2, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @next_pow2(i32 %0) {
%2 = tail call i32 @log(i32 %0)
%3 = tail call i32 @log(i32 2)
%4 = sdiv i32 %2, %3
%5 = tail call i32 @ceil(i32 %4)
%6 = tail call i32 @pow(i32 2, i32 %5)
ret i32 %6
}
char *getcwd(char *buf, int size) {
  buf[0] = '\0';
  return buf;
}


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

x86 assembly (clang, -O2):
<getcwd>:
mov    %rdi,%rax
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @getcwd(i8* returned writeonly %0, i32 %1) {
store i8 0, i8* %0
ret i8* %0
}
void bch_data_verify(struct search *s) {}


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

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

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

LLVM IR (-O2):
%struct.search = type opaque
define void @bch_data_verify(%struct.search* nocapture %0) {
ret void
}
int select_number_bit(int num, int bit) {
  while (--bit) {
    num /= 10;
  }
  return num % 10;
}


x86 assembly (clang, -O0):
<select_number_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     112f <select_number_bit+0x2f>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110a <select_number_bit+0xa>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_number_bit>:
mov    %esi,%eax
add    $0xffffffff,%eax
je     116c <select_number_bit+0x6c>
add    $0xfffffffe,%esi
mov    %eax,%r8d
and    $0x3,%r8d
je     1141 <select_number_bit+0x41>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
movslq %edi,%rdi
imul   $0x66666667,%rdi,%rdi
mov    %rdi,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdi
add    %ecx,%edi
add    $0x1,%edx
cmp    %edx,%r8d
jne    1120 <select_number_bit+0x20>
sub    %edx,%eax
cmp    $0x3,%esi
jb     116c <select_number_bit+0x6c>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x68db8bad,%rcx,%rdi
mov    %rdi,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rdi
add    %ecx,%edi
add    $0xfffffffc,%eax
jne    1150 <select_number_bit+0x50>
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @select_number_bit(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %28, label %5
5: ; preds = %2
%6 = add i32 %1, -2
%7 = and i32 %3, 3
%8 = icmp eq i32 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %5, %9
%10 = phi i32 [ %14, %9 ], [ %3, %5 ]
%11 = phi i32 [ %13, %9 ], [ %0, %5 ]
%12 = phi i32 [ %15, %9 ], [ 0, %5 ]
%13 = sdiv i32 %11, 10
%14 = add nsw i32 %10, -1
%15 = add i32 %12, 1
%16 = icmp eq i32 %15, %7
br i1 %16, label %17, label %9
17: ; preds = %9, %5
%18 = phi i32 [ undef, %5 ], [ %13, %9 ]
%19 = phi i32 [ %3, %5 ], [ %14, %9 ]
%20 = phi i32 [ %0, %5 ], [ %13, %9 ]
%21 = icmp ult i32 %6, 3
br i1 %21, label %28, label %22
22: ; preds = %17, %22
%23 = phi i32 [ %26, %22 ], [ %19, %17 ]
%24 = phi i32 [ %25, %22 ], [ %20, %17 ]
%25 = sdiv i32 %24, 10000
%26 = add nsw i32 %23, -4
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %22
28: ; preds = %17, %22, %2
%29 = phi i32 [ %0, %2 ], [ %18, %17 ], [ %25, %22 ]
%30 = srem i32 %29, 10
ret i32 %30
}
/* Variables and functions */
int /*<<< orphan*/ MCP4461_SetValue(int, int, char);
void setSolderStepper1Current(char current) {
  MCP4461_SetValue(0x58, 0x00, current);
}


x86 assembly (clang, -O0):
<setSolderStepper1Current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x58,%edi
xor    %esi,%esi
movsbl -0x1(%rbp),%edx
call   1030 <MCP4461_SetValue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSolderStepper1Current>:
mov    %edi,%edx
mov    $0x58,%edi
xor    %esi,%esi
jmp    1030 <MCP4461_SetValue@plt>

LLVM IR (-O0):
define void @setSolderStepper1Current(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @MCP4461_SetValue(i32 88, i32 0, i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @setSolderStepper1Current(i8 signext %0) {
%2 = tail call i32 @MCP4461_SetValue(i32 88, i32 0, i8 signext %0)
ret void
}
int f(int i) {
  _Bool t = !i;
  int g = !t && i;
  int h = g == 3;
  return h;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
mov    %al,-0x5(%rbp)
xor    %eax,%eax
testb  $0x1,-0x5(%rbp)
mov    %al,-0x11(%rbp)
jne    112e <f+0x2e>
cmpl   $0x0,-0x4(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 0
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(scalar_t__);
scalar_t__ time(int /*<<< orphan*/);
int random_integer() {
  static int j = 0;
  srand(time(0) + j);
  j++;
  return rand();
}


x86 assembly (clang, -O0):
<random_integer>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rdi
movslq 0x2ef7(%rip),%rax
add    %rax,%rdi
call   1030 <srand@plt>
mov    0x2ee9(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee0(%rip)
mov    $0x0,%al
call   1050 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_integer>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
movslq 0x2efd(%rip),%rdi
add    %rax,%rdi
call   1030 <srand@plt>
addl   $0x1,0x2eee(%rip)
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
@random_integer.j = internal global i32 0
define i32 @random_integer() {
%1 = call i64 @time(i32 0)
%2 = load i32, i32* @random_integer.j
%3 = sext i32 %2 to i64
%4 = add nsw i64 %1, %3
%5 = call i32 @srand(i64 %4)
%6 = load i32, i32* @random_integer.j
%7 = add nsw i32 %6, 1
store i32 %7, i32* @random_integer.j
%8 = call i32 (...) @rand()
ret i32 %8
}

LLVM IR (-O2):
@random_integer.j = internal unnamed_addr global i32 0
define i32 @random_integer() {
%1 = tail call i64 @time(i32 0)
%2 = load i32, i32* @random_integer.j
%3 = sext i32 %2 to i64
%4 = add nsw i64 %1, %3
%5 = tail call i32 @srand(i64 %4)
%6 = load i32, i32* @random_integer.j
%7 = add nsw i32 %6, 1
store i32 %7, i32* @random_integer.j
%8 = tail call i32 (...) @rand()
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_pike_comments() {
  test_parser_verify_parse(test_parser_sourcefile("pike", " //comment"), "pike",
                           "", "//comment", 0);
}


x86 assembly (clang, -O0):
<test_pike_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebd(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pike_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec6(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"pike\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_pike_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"pike\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_pike_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR83_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR83_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR83_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void write_phys(unsigned long addr, unsigned long value) {
  asm volatile("movnti %1, (%0)" : : "r"(addr), "r"(value) :);
}


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

x86 assembly (clang, -O2):
<write_phys>:
movnti %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @write_phys(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @write_phys(i64 %0, i64 %1) {
tail call void asm sideeffect "movnti $1, ($0)", "r,r,~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret void
}
void cbor_null_float4_callback(void *_ctx, float _val) {}


x86 assembly (clang, -O0):
<cbor_null_float4_callback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cbor_null_float4_callback(i8* nocapture %0, float %1) {
ret void
}
unsigned xrop3_58_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_58_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_58_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xff,%edx
or     %ecx,%edx
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_58_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_58_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = or i32 %6, %7
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
OP(dd, a9) { op_a9(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_a9@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_a9()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void printf1(void) { printf("hello printf1 world PI=%lf\n", 3.1415926); }


x86 assembly (clang, -O0):
<printf1>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
movsd  0xedd(%rip),%xmm0
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf1>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"hello printf1 world PI=%lf\0A\00"
define void @printf1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double 0x400921FB4D12D84A)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"hello printf1 world PI=%lf\0A\00"
define void @printf1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double 0x400921FB4D12D84A)
ret void
}
void foo_2_2_2_2_2_1_1_1_2() {}


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

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

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

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