xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_141() {
  Assert_real((isqrt(141) == 11),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              710, ("Integer square root of 141 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_141>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8d,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x2c6,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_141>:
push   %rax
mov    $0x8d,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2c6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 141 should be 11\00"
define void @t_sqrt_141() {
%1 = call i32 @isqrt(i32 141)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 710, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 141 should be 11\00"
define void @t_sqrt_141() {
%1 = tail call i32 @isqrt(i32 141)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 710, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IFF_UP;
int tap_set_flags(char const *, int /*<<< orphan*/);
int tap_bring_up(int fd, const char *dev) { return tap_set_flags(dev, IFF_UP); }


x86 assembly (clang, -O0):
<tap_bring_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <tap_set_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tap_bring_up>:
mov    %rsi,%rdi
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tap_set_flags@plt>

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

LLVM IR (-O2):
@IFF_UP = global i32 0
define i32 @tap_bring_up(i32 %0, i8* %1) {
%3 = load i32, i32* @IFF_UP
%4 = tail call i32 @tap_set_flags(i8* %1, i32 %3)
ret i32 %4
}
void initialize(long N_SQRT, long FFT_BS, double _Complex A[N_SQRT][N_SQRT]) {
  long i;
  for (i = 0; i < N_SQRT; i += FFT_BS) {
    zz_initializeBlock(N_SQRT, FFT_BS, i, &A[i]);
  }
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    117a <initialize+0x6a>
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
imul   -0x20(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rcx
mov    $0x0,%al
call   1030 <zz_initializeBlock@plt>
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1134 <initialize+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rdi,%rdi
jle    115e <initialize+0x4e>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%r13
imul   %rdi,%r13
shl    $0x4,%r13
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1030 <zz_initializeBlock@plt>
add    %r14,%rbx
add    %r13,%r12
cmp    %r15,%rbx
jl     1140 <initialize+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @initialize(i64 %0, i64 %1, { double, double }* %2) {
%4 = icmp sgt i64 %0, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = mul nsw i64 %6, %0
%8 = getelementptr inbounds { double, double }, { double, double }* %2, i64 %7
%9 = tail call i32 (i64, i64, i64, { double, double }*, ...) bitcast (i32 (...)* @zz_initializeBlock to i32 (i64, i64, i64, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %6, { double, double }* %8)
%10 = add nsw i64 %6, %1
%11 = icmp slt i64 %10, %0
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}
int fun(long b[100]) { return sizeof(b); }


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

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

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

LLVM IR (-O2):
define i32 @fun(i64* nocapture readnone %0) {
ret i32 8
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *NativeVoidToString3() {
  char *result = malloc(3 + 1);
  strcpy(result, "abc");
  return result;
}


x86 assembly (clang, -O0):
<NativeVoidToString3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NativeVoidToString3>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i8* @NativeVoidToString3() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void genmov_s() {}


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

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

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

LLVM IR (-O2):
define void @genmov_s() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printo(int);
main() { printo(012345); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14e5,%edi
call   1030 <printo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printo(i32 5349)
ret i32 0
}
int __eqsf2(float a, float b) {
  return (*(unsigned long *)&(a)) != (*(unsigned long *)&(b));
}


x86 assembly (clang, -O0):
<__eqsf2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    -0x4(%rbp),%rax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__eqsf2>:
movss  %xmm0,-0x8(%rsp)
movss  %xmm1,-0x10(%rsp)
mov    -0x8(%rsp),%rcx
xor    %eax,%eax
cmp    -0x10(%rsp),%rcx
setne  %al
ret

LLVM IR (-O0):
define i32 @__eqsf2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = bitcast float* %3 to i64*
%6 = load i64, i64* %5
%7 = bitcast float* %4 to i64*
%8 = load i64, i64* %7
%9 = icmp ne i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__eqsf2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = bitcast float* %3 to i64*
%6 = load i64, i64* %5
%7 = bitcast float* %4 to i64*
%8 = load i64, i64* %7
%9 = icmp ne i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
double expo(double x) {
  double r;
  const double one = 1.0;
  asm volatile("fldl %1;\n\t"
               "fldl %2;\n\t"
               "fdivp;\n\t"
               "f2xm1;\n\t"
               "fstpl %0;\n\t"
               : "=m"(r)
               : "m"(x), "m"(one)
               :);
  return r;
}


x86 assembly (clang, -O0):
<expo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x8(%rbp)
fldl   -0x18(%rbp)
fdivp  %st,%st(1)
f2xm1
fstpl  -0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<expo>:
movsd  %xmm0,-0x8(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x18(%rsp)
fldl   -0x8(%rsp)
fldl   -0x18(%rsp)
fdivp  %st,%st(1)
f2xm1
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @expo(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %4
%5 = load double, double* %3
ret double %5
}

LLVM IR (-O2):
define double @expo(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
store double 1.000000e+00, double* %4
%7 = load double, double* %3
ret double %7
}
int nminusnumofbits(int v) {
  long w = (long)v;
  w -= (0xaaaaaaaa & w) >> 1;
  w = (w & 0x33333333) + ((w >> 2) & 0x33333333);
  w = w + (w >> 4) & 0x0f0f0f0f;
  w += w >> 8;
  w += w >> 16;
  return v - (int)(w & 0xff);
}


x86 assembly (clang, -O0):
<nminusnumofbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movabs $0xaaaaaaaa,%rcx
and    -0x10(%rbp),%rcx
sar    $0x1,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x33333333,%rax
mov    -0x10(%rbp),%rcx
sar    $0x2,%rcx
and    $0x33333333,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sar    $0x4,%rcx
add    %rcx,%rax
and    $0xf0f0f0f,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x8,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x10,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
and    $0xff,%rcx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nminusnumofbits>:
mov    %edi,%eax
mov    %edi,%ecx
mov    %rcx,%rdx
shr    %rdx
and    $0x55555555,%edx
sub    %rdx,%rcx
mov    %ecx,%edx
and    $0x33333333,%edx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shr    $0x4,%edx
add    %ecx,%edx
and    $0xf0f0f0f,%edx
mov    %rdx,%rcx
shr    $0x8,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shr    $0x10,%edx
add    %ecx,%edx
movzbl %dl,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @nminusnumofbits(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = and i64 2863311530, %6
%8 = ashr i64 %7, 1
%9 = load i64, i64* %3
%10 = sub nsw i64 %9, %8
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = and i64 %11, 858993459
%13 = load i64, i64* %3
%14 = ashr i64 %13, 2
%15 = and i64 %14, 858993459
%16 = add nsw i64 %12, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = load i64, i64* %3
%19 = ashr i64 %18, 4
%20 = add nsw i64 %17, %19
%21 = and i64 %20, 252645135
store i64 %21, i64* %3
%22 = load i64, i64* %3
%23 = ashr i64 %22, 8
%24 = load i64, i64* %3
%25 = add nsw i64 %24, %23
store i64 %25, i64* %3
%26 = load i64, i64* %3
%27 = ashr i64 %26, 16
%28 = load i64, i64* %3
%29 = add nsw i64 %28, %27
store i64 %29, i64* %3
%30 = load i32, i32* %2
%31 = load i64, i64* %3
%32 = and i64 %31, 255
%33 = trunc i64 %32 to i32
%34 = sub nsw i32 %30, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @nminusnumofbits(i32 %0) {
%2 = zext i32 %0 to i64
%3 = lshr i64 %2, 1
%4 = and i64 %3, 1431655765
%5 = sub nsw i64 %2, %4
%6 = and i64 %5, 858993459
%7 = lshr i64 %5, 2
%8 = and i64 %7, 858993459
%9 = add nuw nsw i64 %8, %6
%10 = lshr i64 %9, 4
%11 = add nuw nsw i64 %10, %9
%12 = and i64 %11, 252645135
%13 = lshr i64 %12, 8
%14 = add nuw nsw i64 %13, %12
%15 = lshr i64 %14, 16
%16 = add nuw nsw i64 %15, %14
%17 = trunc i64 %16 to i32
%18 = and i32 %17, 63
%19 = sub nsw i32 %0, %18
ret i32 %19
}
void RTFileOpenBitBucket(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileOpenBitBucket() {
ret void
}
int test_imm_1Cint32_mem(int *val) {
  return ((*val) & (0x1C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Cint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 28
%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_1Cint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 28
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void free_param() { return; }


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

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

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

LLVM IR (-O2):
define void @free_param() {
ret void
}
void fn0996() { return; }


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

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

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

LLVM IR (-O2):
define void @fn0996() {
ret void
}
unsigned umax1(unsigned a, unsigned b) { return a ^ ((a ^ b) & -(a < b)); }


x86 assembly (clang, -O0):
<umax1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
cmp    -0x8(%rbp),%edx
setb   %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
and    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umax1>:
mov    %edi,%eax
cmp    %esi,%edi
cmovb  %esi,%eax
ret

LLVM IR (-O0):
define i32 @umax1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp ult i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = and i32 %8, %13
%15 = xor i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @umax1(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dlg_exiterr(char *);
char *malloc(long);
char *xalloc(long size) {
  char *result = malloc(size);
  if ((result) == 0)
    dlg_exiterr("cannot allocate memory in "
                "xalloc");
  return result;
}


x86 assembly (clang, -O0):
<xalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <dlg_exiterr@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <dlg_exiterr@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"cannot allocate memory in xalloc\00"
define i8* @xalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @dlg_exiterr(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [33 x i8] c"cannot allocate memory in xalloc\00"
define noalias i8* @xalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @dlg_exiterr(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_int;
typedef int /*<<< orphan*/ cl_device_id;
typedef int /*<<< orphan*/ cl_context;
typedef int /*<<< orphan*/ cl_command_queue;

/* Variables and functions */
int /*<<< orphan*/ clCreateCommandQueue(int /*<<< orphan*/, int /*<<< orphan*/,
                                        int /*<<< orphan*/,
                                        int /*<<< orphan*/ *);
int /*<<< orphan*/ oclCheckStatus(int /*<<< orphan*/, char *);
cl_command_queue oclCreateCommandQueue(cl_context context,
                                       cl_device_id device) {
  cl_int status;
  cl_command_queue commandQueue =
      clCreateCommandQueue(context, device, 0, &status);
  oclCheckStatus(status, "clCreateCommandQueue failed.");
  return commandQueue;
}


x86 assembly (clang, -O0):
<oclCreateCommandQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
lea    -0xc(%rbp),%rcx
call   1030 <clCreateCommandQueue@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
lea    0xeb4(%rip),%rsi
call   1040 <oclCheckStatus@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oclCreateCommandQueue>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rcx
xor    %edx,%edx
call   1030 <clCreateCommandQueue@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
lea    0xec2(%rip),%rsi
call   1040 <oclCheckStatus@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"clCreateCommandQueue failed.\00"
define i32 @oclCreateCommandQueue(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @clCreateCommandQueue(i32 %7, i32 %8, i32 0, i32* %5)
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = call i32 @oclCheckStatus(i32 %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
@.str = [29 x i8] c"clCreateCommandQueue failed.\00"
define i32 @oclCreateCommandQueue(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @clCreateCommandQueue(i32 %0, i32 %1, i32 0, i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @oclCheckStatus(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 %5
}
change(char **name) {
  char *nm = "newname";
  name = nm;
}


x86 assembly (clang, -O0):
<change>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"newname\00"
define i32 @change(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i8**
store i8** %6, i8*** %3
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @change(i8** nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
struct shmm_blk {
  int dummy;
};

/* Variables and functions */
void *_conv_blk(struct shmm_blk *);
struct shmm_blk *shmm_open_raw(int, void *);
struct shmm_blk *shmm_open(int key, void *at_addr) {
  at_addr = _conv_blk((struct shmm_blk *)at_addr);
  return shmm_open_raw(key, at_addr);
error_ret:
  return 0;
}


x86 assembly (clang, -O0):
<shmm_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <_conv_blk@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <shmm_open_raw@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmm_open>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <_conv_blk@plt>
mov    %ebx,%edi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <shmm_open_raw@plt>

LLVM IR (-O0):
%struct.shmm_blk = type { i32 }
define %struct.shmm_blk* @shmm_open(i32 %0, i8* %1) {
%3 = alloca %struct.shmm_blk*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = bitcast i8* %6 to %struct.shmm_blk*
%8 = call i8* @_conv_blk(%struct.shmm_blk* %7)
store i8* %8, i8** %5
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = call %struct.shmm_blk* @shmm_open_raw(i32 %9, i8* %10)
store %struct.shmm_blk* %11, %struct.shmm_blk** %3
br label %13
12: ; No predecessors!
store %struct.shmm_blk* null, %struct.shmm_blk** %3
br label %13
13: ; preds = %12, %2
%14 = load %struct.shmm_blk*, %struct.shmm_blk** %3
ret %struct.shmm_blk* %14
}

LLVM IR (-O2):
%struct.shmm_blk = type { i32 }
define %struct.shmm_blk* @shmm_open(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.shmm_blk*
%4 = tail call i8* @_conv_blk(%struct.shmm_blk* %3)
%5 = tail call %struct.shmm_blk* @shmm_open_raw(i32 %0, i8* %4)
ret %struct.shmm_blk* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a, b;
  a = 2;
  b = 4;
  if ((a = 2) & (b = 4))
    printf(" TAK\n");
  else
    printf(" NIE\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    114a <main+0x3a>
jmp    115b <main+0x4b>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1167 <main+0x57>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%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 = [6 x i8] c" TAK\0A\00"
@.str.1 = [6 x i8] c" NIE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 4, i32* %3
store i32 2, i32* %2
store i32 4, i32* %3
br i1 false, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@str = [5 x i8] c" NIE\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: mktccboot <firmware file> <boot file> <output file>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%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>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: mktccboot <firmware file> <boot file> <output file>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [59 x i8] c"Usage: mktccboot <firmware file> <boot file> <output file>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void dns_cache_clear(struct dns_cache *cache __attribute__((unused))) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.dns_cache = type opaque
define void @dns_cache_clear(%struct.dns_cache* nocapture %0) {
ret void
}
/* Variables and functions */
int random_range(int, int);
int random_percent(void) { return random_range(1, 100); }


x86 assembly (clang, -O0):
<random_percent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x64,%esi
call   1030 <random_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_percent>:
mov    $0x1,%edi
mov    $0x64,%esi
jmp    1030 <random_range@plt>

LLVM IR (-O0):
define i32 @random_percent() {
%1 = call i32 @random_range(i32 1, i32 100)
ret i32 %1
}

LLVM IR (-O2):
define i32 @random_percent() {
%1 = tail call i32 @random_range(i32 1, i32 100)
ret i32 %1
}
void inc_zcache_mean_compress_poor(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_mean_compress_poor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fftss_init_threads();
void dfftss_init_threads_(void) { fftss_init_threads(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_inc_direct(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "INC   "
          "0x%02X"
          "                      ",
          direct);
}


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

x86 assembly (clang, -O2):
<fprint_inc_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"INC 0x%02X \00"
define void @fprint_inc_direct(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"INC 0x%02X \00"
define void @fprint_inc_direct(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int max_sum(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[9] = {-2, 1, -3, 4, -1, 2, 1, -5, 5};
  printf("%d\n", max_sum(array, 9));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1030 <max_sum@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <max_sum@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
store i32 0, i32* %1
%3 = bitcast [9 x i32]* %2 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%5 = call i32 @max_sum(i32* %4, i32 9)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @max_sum(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t GetBitUInt8(const uint8_t *x, const uint8_t bitNum) {
  return (!!((*x) & (1 << bitNum)));
}


x86 assembly (clang, -O0):
<GetBitUInt8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBitUInt8>:
mov    %esi,%ecx
mov    (%rdi),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @GetBitUInt8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @GetBitUInt8(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
int main() {
  long int n = 2183293, obr = 0;
  long int n1 = n;
  while (n != 0) {
    obr = obr * 10;
    obr = obr + n % 10;
    n = n / 10;
  }
  printf("%ld => %ld\n", n1, obr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x21507d,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1183 <main+0x73>
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0x28(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x27>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x21507d,%esi
mov    $0x3bdf64,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%ld => %ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 2183293, i64 3923812)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int open_or_die_m(char const *, int, int /*<<< orphan*/);
void create_or_die(const char *file, mode_t mode) {
  int fd = open_or_die_m(file, O_WRONLY | O_CREAT, mode);
  close(fd);
}


x86 assembly (clang, -O0):
<create_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    0x2eb5(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <open_or_die_m@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_or_die>:
push   %rax
mov    %esi,%edx
mov    0x2ea6(%rip),%rax
mov    0x2ec7(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1030 <open_or_die_m@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <close@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
define void @create_or_die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* @O_WRONLY
%8 = load i32, i32* @O_CREAT
%9 = or i32 %7, %8
%10 = load i32, i32* %4
%11 = call i32 @open_or_die_m(i8* %6, i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @close(i32 %12)
ret void
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
define void @create_or_die(i8* %0, i32 %1) {
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = tail call i32 @open_or_die_m(i8* %0, i32 %5, i32 %1)
%7 = tail call i32 @close(i32 %6)
ret void
}
/* Type definitions */
struct of_device_id {
  int dummy;
};
struct device_node {
  int dummy;
};

/* Variables and functions */
struct device_node *of_find_matching_node_and_match(struct device_node *,
                                                    struct of_device_id const *,
                                                    void *);
struct device_node *of_find_matching_node(struct device_node *from,
                                          const struct of_device_id *matches) {
  return of_find_matching_node_and_match(from, matches, ((void *)0));
}


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

x86 assembly (clang, -O2):
<of_find_matching_node>:
xor    %edx,%edx
jmp    1030 <of_find_matching_node_and_match@plt>

LLVM IR (-O0):
%struct.device_node = type { i32 }
%struct.of_device_id = type { i32 }
define %struct.device_node* @of_find_matching_node(%struct.device_node* %0, %struct.of_device_id* %1) {
%3 = alloca %struct.device_node*
%4 = alloca %struct.of_device_id*
store %struct.device_node* %0, %struct.device_node** %3
store %struct.of_device_id* %1, %struct.of_device_id** %4
%5 = load %struct.device_node*, %struct.device_node** %3
%6 = load %struct.of_device_id*, %struct.of_device_id** %4
%7 = call %struct.device_node* @of_find_matching_node_and_match(%struct.device_node* %5, %struct.of_device_id* %6, i8* null)
ret %struct.device_node* %7
}

LLVM IR (-O2):
%struct.device_node = type { i32 }
%struct.of_device_id = type { i32 }
define %struct.device_node* @of_find_matching_node(%struct.device_node* %0, %struct.of_device_id* %1) {
%3 = tail call %struct.device_node* @of_find_matching_node_and_match(%struct.device_node* %0, %struct.of_device_id* %1, i8* null)
ret %struct.device_node* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("scotest - SCO testing\n"
         "Usage:\n");
  printf("\tscotest <mode> [options] [bd_addr]\n");
  printf("Modes:\n"
         "\t-d dump (server)\n"
         "\t-c reconnect (client)\n"
         "\t-m multiple connects (client)\n"
         "\t-r receive (server)\n"
         "\t-s connect and send (client)\n"
         "\t-n connect and be silent (client)\n"
         "Options:\n"
         "\t[-b bytes]\n"
         "\t[-W seconds] enable deferred setup\n"
         "\t[-V voice] select SCO voice setting (0x0060 cvsd, 0x0003 "
         "transparent)\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"scotest - SCO testing\0AUsage:\0A\00"
@.str.1 = [37 x i8] c"\09scotest <mode> [options] [bd_addr]\0A\00"
@.str.2 = [294 x i8] c"Modes:\0A\09-d dump (server)\0A\09-c reconnect (client)\0A\09-m multiple connects (client)\0A\09-r receive (server)\0A\09-s connect and send (client)\0A\09-n connect and be silent (client)\0AOptions:\0A\09[-b bytes]\0A\09[-W seconds] enable deferred setup\0A\09[-V voice] select SCO voice setting (0x0060 cvsd, 0x0003 transparent)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([294 x i8], [294 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"scotest - SCO testing\0AUsage:\00"
@str.3 = [36 x i8] c"\09scotest <mode> [options] [bd_addr]\00"
@str.4 = [293 x i8] c"Modes:\0A\09-d dump (server)\0A\09-c reconnect (client)\0A\09-m multiple connects (client)\0A\09-r receive (server)\0A\09-s connect and send (client)\0A\09-n connect and be silent (client)\0AOptions:\0A\09[-b bytes]\0A\09[-W seconds] enable deferred setup\0A\09[-V voice] select SCO voice setting (0x0060 cvsd, 0x0003 transparent)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([293 x i8], [293 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sol_http_client_shutdown();
int /*<<< orphan*/ sol_http_server_shutdown();
int /*<<< orphan*/ sol_netctl_shutdown();
int /*<<< orphan*/ sol_network_shutdown();
void sol_comms_shutdown(void) {
  sol_http_client_shutdown();
  sol_http_server_shutdown();
  sol_network_shutdown();
  sol_netctl_shutdown();
}


x86 assembly (clang, -O0):
<sol_comms_shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <sol_http_client_shutdown@plt>
mov    $0x0,%al
call   1030 <sol_http_server_shutdown@plt>
mov    $0x0,%al
call   1040 <sol_network_shutdown@plt>
mov    $0x0,%al
call   1050 <sol_netctl_shutdown@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sol_comms_shutdown>:
push   %rax
xor    %eax,%eax
call   1060 <sol_http_client_shutdown@plt>
xor    %eax,%eax
call   1030 <sol_http_server_shutdown@plt>
xor    %eax,%eax
call   1040 <sol_network_shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <sol_netctl_shutdown@plt>

LLVM IR (-O0):
define void @sol_comms_shutdown() {
%1 = call i32 (...) @sol_http_client_shutdown()
%2 = call i32 (...) @sol_http_server_shutdown()
%3 = call i32 (...) @sol_network_shutdown()
%4 = call i32 (...) @sol_netctl_shutdown()
ret void
}

LLVM IR (-O2):
define void @sol_comms_shutdown() {
%1 = tail call i32 (...) @sol_http_client_shutdown()
%2 = tail call i32 (...) @sol_http_server_shutdown()
%3 = tail call i32 (...) @sol_network_shutdown()
%4 = tail call i32 (...) @sol_netctl_shutdown()
ret void
}
/* Variables and functions */
scalar_t__ pow(double, int);
double sqrt(scalar_t__);
double magnitude(double u[]) {
  return sqrt(pow(u[0], 2) + pow(u[1], 2) + pow(u[2], 2));
}


x86 assembly (clang, -O0):
<magnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magnitude>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsd  (%rdi),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,%rbx
movsd  0x8(%r14),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    %rax,%rbx
movsd  0x10(%r14),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @magnitude(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call i64 @pow(double %5, i32 2)
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 1
%9 = load double, double* %8
%10 = call i64 @pow(double %9, i32 2)
%11 = add nsw i64 %6, %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = call i64 @pow(double %14, i32 2)
%16 = add nsw i64 %11, %15
%17 = call double @sqrt(i64 %16)
ret double %17
}

LLVM IR (-O2):
define double @magnitude(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i64 @pow(double %2, i32 2)
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call i64 @pow(double %5, i32 2)
%7 = add nsw i64 %6, %3
%8 = getelementptr inbounds double, double* %0, i64 2
%9 = load double, double* %8
%10 = tail call i64 @pow(double %9, i32 2)
%11 = add nsw i64 %7, %10
%12 = tail call double @sqrt(i64 %11)
ret double %12
}
int gcd(int a, int b) {
  int t;
  if (a < b) {
    t = a;
    a = b;
    b = t;
  }
  while (0 != a % b) {
    t = a % b;
    a = b;
    b = t;
  }
  return t;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <gcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
je     1159 <gcd+0x59>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%edx
cmp    %esi,%edi
mov    %edi,%eax
cmovl  %esi,%eax
cmovl  %edi,%esi
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %esi
mov    %esi,%eax
mov    %edx,%esi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
store i32 %11, i32* %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %13
13: ; preds = %9, %2
br label %14
14: ; preds = %19, %13
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = icmp ne i32 0, %17
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = srem i32 %20, %21
store i32 %22, i32* %5
%23 = load i32, i32* %4
store i32 %23, i32* %3
%24 = load i32, i32* %5
store i32 %24, i32* %4
br label %14
25: ; preds = %14
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %8, %6 ]
%8 = phi i32 [ %5, %2 ], [ %10, %6 ]
%9 = phi i32 [ %0, %2 ], [ %10, %6 ]
%10 = srem i32 %7, %8
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6
ret i32 %9
}