xunge/DecIR huggingface dataset:
int invers(int n) {
  int invN = 0;
  while (n > 0) {
    invN = invN * 10 + n % 10;
    n /= 10;
  }
  return invN;
}


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

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

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

LLVM IR (-O2):
define i32 @invers(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
void release() {}


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

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

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

LLVM IR (-O2):
define void @release() {
ret void
}
double sum_sq(double x, double y, double z) { return x * x + y * y + z * z; }


x86 assembly (clang, -O0):
<sum_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_sq>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @sum_sq(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %6
%14 = load double, double* %6
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double %12)
ret double %15
}

LLVM IR (-O2):
define double @sum_sq(double %0, double %1, double %2) {
%4 = fmul double %1, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ fb_hTermOut(int, int /*<<< orphan*/, int);
void fb_ConsoleScroll(int nrows) { fb_hTermOut(11, 0, nrows); }


x86 assembly (clang, -O0):
<fb_ConsoleScroll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xb,%edi
xor    %esi,%esi
call   1030 <fb_hTermOut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_ConsoleScroll>:
mov    %edi,%edx
mov    $0xb,%edi
xor    %esi,%esi
jmp    1030 <fb_hTermOut@plt>

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

LLVM IR (-O2):
define void @fb_ConsoleScroll(i32 %0) {
%2 = tail call i32 @fb_hTermOut(i32 11, i32 0, i32 %0)
ret void
}
int test_imm_47int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x47 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_47int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 304942678016
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
double eval_default(double x, double y) {
  fprintf(stderr, "ERROR: Unrecognized operator :(\n");
  exit(1);
}


x86 assembly (clang, -O0):
<eval_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<eval_default>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"ERROR: Unrecognized operator :(\0A\00"
define double @eval_default(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"ERROR: Unrecognized operator :(\0A\00"
define double @eval_default(double %0, double %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char add(unsigned char a, unsigned char b) { return a ^ b; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @add(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = xor i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @add(i8 zeroext %0, i8 zeroext %1) {
%3 = xor i8 %1, %0
ret i8 %3
}
void good(int *p) {
  __builtin_prefetch(p, 0, 0);
  __builtin_prefetch(p, 0, 1);
  __builtin_prefetch(p, 0, 2);
  __builtin_prefetch(p, 0, 3);
  __builtin_prefetch(p, 1, 0);
  __builtin_prefetch(p, 1, 1);
  __builtin_prefetch(p, 1, 2);
  __builtin_prefetch(p, 1, 3);
}


x86 assembly (clang, -O0):
<good>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
prefetchnta (%rax)
mov    -0x8(%rbp),%rax
prefetcht2 (%rax)
mov    -0x8(%rbp),%rax
prefetcht1 (%rax)
mov    -0x8(%rbp),%rax
prefetcht0 (%rax)
mov    -0x8(%rbp),%rax
prefetchnta (%rax)
mov    -0x8(%rbp),%rax
prefetcht2 (%rax)
mov    -0x8(%rbp),%rax
prefetcht1 (%rax)
mov    -0x8(%rbp),%rax
prefetcht0 (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<good>:
prefetchnta (%rdi)
prefetcht2 (%rdi)
prefetcht1 (%rdi)
prefetcht0 (%rdi)
prefetchnta (%rdi)
prefetcht2 (%rdi)
prefetcht1 (%rdi)
prefetcht0 (%rdi)
ret

LLVM IR (-O0):
define void @good(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = load i32*, i32** %2
%6 = bitcast i32* %5 to i8*
%7 = load i32*, i32** %2
%8 = bitcast i32* %7 to i8*
%9 = load i32*, i32** %2
%10 = bitcast i32* %9 to i8*
%11 = load i32*, i32** %2
%12 = bitcast i32* %11 to i8*
%13 = load i32*, i32** %2
%14 = bitcast i32* %13 to i8*
%15 = load i32*, i32** %2
%16 = bitcast i32* %15 to i8*
%17 = load i32*, i32** %2
%18 = bitcast i32* %17 to i8*
ret void
}

LLVM IR (-O2):
define void @good(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
tail call void @llvm.prefetch.p0i8(i8* %2, i32 0, i32 0, i32 1)
tail call void @llvm.prefetch.p0i8(i8* %2, i32 0, i32 1, i32 1)
tail call void @llvm.prefetch.p0i8(i8* %2, i32 0, i32 2, i32 1)
tail call void @llvm.prefetch.p0i8(i8* %2, i32 0, i32 3, i32 1)
tail call void @llvm.prefetch.p0i8(i8* %2, i32 1, i32 0, i32 1)
tail call void @llvm.prefetch.p0i8(i8* %2, i32 1, i32 1, i32 1)
tail call void @llvm.prefetch.p0i8(i8* %2, i32 1, i32 2, i32 1)
tail call void @llvm.prefetch.p0i8(i8* %2, i32 1, i32 3, i32 1)
ret void
}
int test_imm_24uint8_mem(unsigned char *val) {
  return ((*val) & (0x24 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_24uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 36
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
  return 0;
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamMatchmaking_GetFavoriteGameCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamMatchmaking_GetFavoriteGameCount>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
call   1030 <xlogf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount = [48 x i8] c"SteamAPI_ISteamMatchmaking_GetFavoriteGameCount\00"
define i32 @SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @__func__.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount = [48 x i8] c"SteamAPI_ISteamMatchmaking_GetFavoriteGameCount\00"
define i32 @SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @__func__.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
char tolower(unsigned char);
char *strlwr_8bit(char *str) {
  char *p;
  for (p = str; *p; ++p) {
    *p = tolower((unsigned char)*p);
  }
  return str;
}


x86 assembly (clang, -O0):
<strlwr_8bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strlwr_8bit+0x46>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlwr_8bit+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr_8bit>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlwr_8bit+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr_8bit+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlwr_8bit(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
double floor(double);
char quantize4bit(double D, double x) {
  double qxd;
  qxd = floor(x / D);
  if (qxd <= -8)
    qxd = -8;
  else if (qxd > 7)
    qxd = 7;
  return ((char)qxd);
}


x86 assembly (clang, -O0):
<quantize4bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xec2(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     115b <quantize4bit+0x4b>
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1184 <quantize4bit+0x74>
movsd  -0x18(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117f <quantize4bit+0x6f>
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1184 <quantize4bit+0x74>
movsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantize4bit>:
push   %rax
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <floor@plt>
movsd  0xeda(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1142 <quantize4bit+0x32>
ucomisd 0xed4(%rip),%xmm0
movapd %xmm0,%xmm1
jbe    1142 <quantize4bit+0x32>
movsd  0xec6(%rip),%xmm1
cvttsd2si %xmm1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @quantize4bit(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = call double @llvm.floor.f64(double %8)
store double %9, double* %5
%10 = load double, double* %5
%11 = fcmp ole double %10, -8.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %2
store double -8.000000e+00, double* %5
br label %18
13: ; preds = %2
%14 = load double, double* %5
%15 = fcmp ogt double %14, 7.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %13
store double 7.000000e+00, double* %5
br label %17
17: ; preds = %16, %13
br label %18
18: ; preds = %17, %12
%19 = load double, double* %5
%20 = fptosi double %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @quantize4bit(double %0, double %1) {
%3 = fdiv double %1, %0
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fcmp ugt double %4, -8.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = fcmp ogt double %4, 7.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %6
br label %9
9: ; preds = %2, %6, %8
%10 = phi double [ 7.000000e+00, %8 ], [ %4, %6 ], [ -8.000000e+00, %2 ]
%11 = fptosi double %10 to i8
ret i8 %11
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int j;
  int i;
  int fac;
  j = __VERIFIER_nondet_int();
  i = 1;
  fac = 1;
  while (fac != j) {
    fac = fac * i;
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     115b <main+0x4b>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int floor(int);
int /*<<< orphan*/ maxHeapify(int *, int, int);
void buildMaxHeap(int *A, int len) {
  int m = floor(len / 2) - 1;
  for (int i = m; i >= 0; i--) {
    maxHeapify(A, len, i);
  }
}


x86 assembly (clang, -O0):
<buildMaxHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <floor@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1174 <buildMaxHeap+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <maxHeapify@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <buildMaxHeap+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildMaxHeap>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
shr    $0x1f,%edi
add    %esi,%edi
sar    %edi
call   1040 <floor@plt>
test   %eax,%eax
jle    1155 <buildMaxHeap+0x35>
mov    %eax,%ebx
add    $0x1,%ebx
lea    -0x2(%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <maxHeapify@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1140 <buildMaxHeap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @buildMaxHeap(i32* %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = tail call i32 @floor(i32 %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %7, %2
ret void
7: ; preds = %2, %7
%8 = phi i32 [ %9, %7 ], [ %4, %2 ]
%9 = add nsw i32 %8, -1
%10 = tail call i32 @maxHeapify(i32* %0, i32 %1, i32 %9)
%11 = icmp ugt i32 %8, 1
br i1 %11, label %7, label %6
}
/* Variables and functions */
int coginit(unsigned int);
int cognew(void *code_p, void *par_p) {
  unsigned int value = 8;
  int cog = 0;
  unsigned code = (unsigned)(code_p);
  unsigned par = (unsigned)(par_p);
  par &= ~3;
  code &= ~3;
  value |= (code << 2);
  value |= (par << 16);
  cog = coginit(value);
  return cog;
}


x86 assembly (clang, -O0):
<cognew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
and    $0xfffffffc,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
and    $0xfffffffc,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x2,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <coginit@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cognew>:
shl    $0x2,%edi
and    $0xfffffff0,%edi
and    $0xfffffffc,%esi
shl    $0x10,%esi
or     %esi,%edi
or     $0x8,%edi
jmp    1030 <coginit@plt>

LLVM IR (-O0):
define i32 @cognew(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 8, i32* %5
store i32 0, i32* %6
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %9 to i32
store i32 %10, i32* %7
%11 = load i8*, i8** %4
%12 = ptrtoint i8* %11 to i32
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = and i32 %13, -4
store i32 %14, i32* %8
%15 = load i32, i32* %7
%16 = and i32 %15, -4
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = shl i32 %17, 2
%19 = load i32, i32* %5
%20 = or i32 %19, %18
store i32 %20, i32* %5
%21 = load i32, i32* %8
%22 = shl i32 %21, 16
%23 = load i32, i32* %5
%24 = or i32 %23, %22
store i32 %24, i32* %5
%25 = load i32, i32* %5
%26 = call i32 @coginit(i32 %25)
store i32 %26, i32* %6
%27 = load i32, i32* %6
ret i32 %27
}

LLVM IR (-O2):
define i32 @cognew(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = shl i32 %4, 2
%8 = and i32 %7, -16
%9 = shl i32 %6, 16
%10 = and i32 %9, -262144
%11 = or i32 %8, %10
%12 = or i32 %11, 8
%13 = tail call i32 @coginit(i32 %12)
ret i32 %13
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_open_solution_input_file(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(130, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_open_solution_input_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x82,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_open_solution_input_file>:
mov    $0x82,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_open_solution_input_file() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 130, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_open_solution_input_file() {
%1 = tail call i32 @_ada_use_c2phc(i32 130, i32* undef, i32* undef, double* undef)
ret i32 %1
}
XDestroySubwindows() {}


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

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

LLVM IR (-O0):
define i32 @XDestroySubwindows() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XDestroySubwindows() {
ret i32 undef
}
/* Variables and functions */
char const *secure_getenv(int /*<<< orphan*/);
int /*<<< orphan*/ strndupa(char const *, size_t);
__attribute__((no)) const char *secure_getenv_len(const char *key, size_t len) {
  return secure_getenv(strndupa(key, len));
}


x86 assembly (clang, -O0):
<secure_getenv_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strndupa@plt>
mov    %eax,%edi
call   1030 <secure_getenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @secure_getenv_len(i8* %0, i64 %1) {
%3 = tail call i32 @strndupa(i8* %0, i64 %1)
%4 = tail call i8* @secure_getenv(i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage() {
  printf("\nUsage:\n   %s\n\n", "deskew"
                                " <input file> <input metadata file> <output "
                                "file> <output metadata file>\n"
                                "             [-license] [-version] [-help]");
}


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

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [122 x i8] c"deskew <input file> <input metadata file> <output file> <output metadata file>\0A [-license] [-version] [-help]\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [122 x i8] c"deskew <input file> <input metadata file> <output file> <output metadata file>\0A [-license] [-version] [-help]\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_34uint16_reg(unsigned short val) {
  return ((val) & (-0x34 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_34uint16_reg(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, -52
%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_34uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -52
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int tdefault_insert_vfork_catchpoint(struct target_ops *self, int arg1) {
  return 1;
}


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

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

LLVM IR (-O0):
%struct.target_ops = type opaque
define i32 @tdefault_insert_vfork_catchpoint(%struct.target_ops* %0, i32 %1) {
%3 = alloca %struct.target_ops*
%4 = alloca i32
store %struct.target_ops* %0, %struct.target_ops** %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
%struct.target_ops = type opaque
define i32 @tdefault_insert_vfork_catchpoint(%struct.target_ops* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
scalar_t__ calloc(int, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void bad_calloc(char *name) {
  char *new_names = (char *)calloc(2, strlen(name + 1));
}


x86 assembly (clang, -O0):
<bad_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
mov    $0x2,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_calloc>:
push   %rax
add    $0x1,%rdi
call   1030 <strlen@plt>
mov    $0x2,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <calloc@plt>

LLVM IR (-O0):
define void @bad_calloc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = call i32 @strlen(i8* %5)
%7 = call i64 @calloc(i32 2, i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
ret void
}

LLVM IR (-O2):
define void @bad_calloc(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @strlen(i8* %2)
%4 = tail call i64 @calloc(i32 2, i32 %3)
ret void
}
void RTTestSetDefault(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestSetDefault() {
ret void
}
int is_white_space(int c) {
  switch (c) {
  case ' ':
  case '\t':
  case '\n':
  case '\r':
  case '\v':
  case '\f':
  case 0:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_white_space>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     113f <is_white_space+0x3f>
jmp    111a <is_white_space+0x1a>
mov    -0xc(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     113f <is_white_space+0x3f>
jmp    112e <is_white_space+0x2e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    114b <is_white_space+0x4b>
jmp    113f <is_white_space+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1152 <is_white_space+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_white_space>:
cmp    $0x20,%edi
ja     111d <is_white_space+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003e01,%rdx
bt     %rcx,%rdx
jae    111d <is_white_space+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_white_space(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 32, label %5
i32 9, label %5
i32 10, label %5
i32 13, label %5
i32 11, label %5
i32 12, label %5
i32 0, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_white_space(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 9, label %3
i32 10, label %3
i32 13, label %3
i32 11, label %3
i32 12, label %3
i32 0, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ callsort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main(void) {
  fprintf(stdout, "\nSorting Algorithms Analysis \n\n");
  callsort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <callsort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <callsort@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [32 x i8] c"\0ASorting Algorithms Analysis \0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @callsort()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [32 x i8] c"\0ASorting Algorithms Analysis \0A\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @callsort()
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_standard_set_continuation_parameter(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(875, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_standard_set_continuation_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x36b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_standard_set_continuation_parameter>:
mov    $0x36b,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_standard_set_continuation_parameter() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 875, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_standard_set_continuation_parameter() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 875, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fabs_(void) {
  put8(0xD9);
  put8(0xE1);
}


x86 assembly (clang, -O0):
<fabs_>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0xe1,%edi
call   1030 <put8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs_>:
push   %rax
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0xe1,%edi
pop    %rax
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fabs_() {
%1 = call i32 @put8(i32 217)
%2 = call i32 @put8(i32 225)
ret void
}

LLVM IR (-O2):
define void @fabs_() {
%1 = tail call i32 @put8(i32 217)
%2 = tail call i32 @put8(i32 225)
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCGETS;
int ioctl(int, int /*<<< orphan*/, struct termios *);
int tcgetattr(int fd, struct termios *tios) { return ioctl(fd, TCGETS, tios); }


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

x86 assembly (clang, -O2):
<tcgetattr>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @TCGETS
%7 = load %struct.termios*, %struct.termios** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.termios* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = load i32, i32* @TCGETS
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.termios* %1)
ret i32 %4
}
int os_font_data(int font, int *height, int *width) {
  if (font == 1) {
    *height = 1;
    *width = 1;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<os_font_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1139 <os_font_data+0x39>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1140 <os_font_data+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_font_data>:
xor    %eax,%eax
cmp    $0x1,%edi
jne    1118 <os_font_data+0x18>
movl   $0x1,(%rsi)
movl   $0x1,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @os_font_data(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = icmp eq i32 %0, 1
br i1 %4, label %5, label %6
5: ; preds = %3
store i32 1, i32* %1
store i32 1, i32* %2
br label %6
6: ; preds = %3, %5
%7 = phi i32 [ 1, %5 ], [ 0, %3 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ region_write(int, int, int, int);
void i2c_trx_toggle(int x) { region_write(((0xE1800000) + 4), 0x1, 4, x); }


x86 assembly (clang, -O0):
<i2c_trx_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xe1800004,%edi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <region_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_trx_toggle>:
mov    %edi,%ecx
mov    $0xe1800004,%edi
mov    $0x1,%esi
mov    $0x4,%edx
jmp    1030 <region_write@plt>

LLVM IR (-O0):
define void @i2c_trx_toggle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @region_write(i32 -511705084, i32 1, i32 4, i32 %3)
ret void
}

LLVM IR (-O2):
define void @i2c_trx_toggle(i32 %0) {
%2 = tail call i32 @region_write(i32 -511705084, i32 1, i32 4, i32 %0)
ret void
}
char uc(char c) { return c >= 'a' && c <= 'z' ? (c - 'a') + 'A' : c; }


x86 assembly (clang, -O0):
<uc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <uc+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <uc+0x36>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <uc+0x3d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @uc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 97
%14 = add nsw i32 %13, 65
br label %18
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @uc(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
long isqrt(long);
long npix2nside(long npix) {
  long res = isqrt(npix / 12);
  return (res * res * 12 == npix) ? res : -1;
}


x86 assembly (clang, -O0):
<npix2nside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xc,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <isqrt@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
imul   $0xc,%rax,%rax
cmp    -0x8(%rbp),%rax
jne    115a <npix2nside+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    116a <npix2nside+0x5a>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    116a <npix2nside+0x5a>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npix2nside>:
push   %rbx
mov    %rdi,%rbx
movabs $0x2aaaaaaaaaaaaaab,%rcx
aa aa 2a
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    %rdx
add    %rdx,%rdi
call   1030 <isqrt@plt>
mov    %rax,%rcx
imul   %rax,%rcx
shl    $0x2,%rcx
lea    (%rcx,%rcx,2),%rcx
cmp    %rbx,%rcx
mov    $0xffffffffffffffff,%rcx
cmovne %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @npix2nside(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 12
%6 = call i64 @isqrt(i64 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %3
%9 = mul nsw i64 %7, %8
%10 = mul nsw i64 %9, 12
%11 = load i64, i64* %2
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i64, i64* %3
br label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %13
%17 = phi i64 [ %14, %13 ], [ -1, %15 ]
ret i64 %17
}

LLVM IR (-O2):
define i64 @npix2nside(i64 %0) {
%2 = sdiv i64 %0, 12
%3 = tail call i64 @isqrt(i64 %2)
%4 = mul i64 %3, 12
%5 = mul i64 %4, %3
%6 = icmp eq i64 %5, %0
%7 = select i1 %6, i64 %3, i64 -1
ret i64 %7
}
int costo_b(int edad) {
  int costo;
  if (!(edad >= 0))
    return -1;
  costo = 0;
  if (((edad) >= (0) && (edad) <= (5)))
    costo = 10;
  else if (((edad) > (5) && (edad) < (10)))
    costo = 20;
  else
    costo = 25;
  return costo;
}


x86 assembly (clang, -O0):
<costo_b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <costo_b+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <costo_b+0x76>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1144 <costo_b+0x44>
cmpl   $0x5,-0x8(%rbp)
jg     1144 <costo_b+0x44>
movl   $0xa,-0xc(%rbp)
jmp    1170 <costo_b+0x70>
cmpl   $0x5,-0x8(%rbp)
jle    1164 <costo_b+0x64>
cmpl   $0xa,-0x8(%rbp)
jge    1164 <costo_b+0x64>
movl   $0x14,-0xc(%rbp)
jmp    116b <costo_b+0x6b>
movl   $0x19,-0xc(%rbp)
jmp    1170 <costo_b+0x70>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<costo_b>:
xor    %eax,%eax
cmp    $0xa,%edi
setge  %al
cmp    $0x6,%edi
lea    0x14(%rax,%rax,4),%eax
mov    $0xa,%ecx
cmovge %eax,%ecx
test   %edi,%edi
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @costo_b(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = icmp slt i32 %0, 6
%4 = icmp slt i32 %0, 10
%5 = select i1 %4, i32 20, i32 25
%6 = select i1 %3, i32 10, i32 %5
%7 = select i1 %2, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int f2();
int main() { return f2(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f2()
ret i32 %1
}
int destroy_8023_client(void) {}


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

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

LLVM IR (-O0):
define i32 @destroy_8023_client() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @destroy_8023_client() {
ret i32 undef
}
/* Type definitions */
struct Scope {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Scope *);
void deleteScope(struct Scope *scope) {
  if (scope != NULL)
    free(scope);
  return;
}


x86 assembly (clang, -O0):
<deleteScope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <deleteScope+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteScope>:
test   %rdi,%rdi
je     111a <deleteScope+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.Scope = type { i32 }
define void @deleteScope(%struct.Scope* %0) {
%2 = icmp eq %struct.Scope* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.Scope* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_add8() { CALC_appendString("8"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"8\00"
define void @CALC_add8() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int has_ic();
int wrap_has_ic(void) { return has_ic(); }


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

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

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

LLVM IR (-O2):
define i32 @wrap_has_ic() {
%1 = tail call i32 (...) @has_ic()
ret i32 %1
}