xunge/DecIR huggingface dataset:
unsigned addRange(unsigned lo, unsigned hi) {
  unsigned retVal = 0;
  for (lo; lo < hi; ++lo)
    retVal = retVal + lo;
  return retVal;
}


x86 assembly (clang, -O0):
<addRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1134 <addRange+0x34>
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <addRange+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addRange>:
xor    %eax,%eax
cmp    %esi,%edi
jae    1122 <addRange+0x22>
mov    %edi,%ecx
not    %ecx
add    %esi,%ecx
lea    0x1(%rdi),%eax
imul   %ecx,%eax
sub    %edi,%esi
add    $0xfffffffe,%esi
imul   %rcx,%rsi
shr    %rsi
add    %edi,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @addRange(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = xor i32 %0, -1
%6 = add i32 %5, %1
%7 = add nuw i32 %0, 1
%8 = mul i32 %6, %7
%9 = zext i32 %6 to i33
%10 = add i32 %1, -2
%11 = sub i32 %10, %0
%12 = zext i32 %11 to i33
%13 = mul i33 %9, %12
%14 = lshr i33 %13, 1
%15 = trunc i33 %14 to i32
%16 = add i32 %8, %0
%17 = add i32 %16, %15
br label %18
18: ; preds = %4, %2
%19 = phi i32 [ 0, %2 ], [ %17, %4 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sp_sync_process();
int main() {
  sleep(5);
  sp_sync_process();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 5)
%2 = tail call i32 (...) @sp_sync_process()
ret i32 0
}
float ft_map(float val, float range, float min2, float max2) {
  if (!range)
    return (0);
  return (min2 + ((max2 - min2) * (val / range)));
}


x86 assembly (clang, -O0):
<ft_map>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    113c <ft_map+0x3c>
jp     113c <ft_map+0x3c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1162 <ft_map+0x62>
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
divss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_map>:
xorps  %xmm4,%xmm4
ucomiss %xmm4,%xmm1
jne    110a <ft_map+0xa>
jnp    111b <ft_map+0x1b>
subss  %xmm2,%xmm3
divss  %xmm1,%xmm0
mulss  %xmm3,%xmm0
addss  %xmm2,%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @ft_map(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
%10 = load float, float* %7
%11 = fcmp une float %10, 0.000000e+00
br i1 %11, label %13, label %12
12: ; preds = %4
store float 0.000000e+00, float* %5
br label %22
13: ; preds = %4
%14 = load float, float* %8
%15 = load float, float* %9
%16 = load float, float* %8
%17 = fsub float %15, %16
%18 = load float, float* %6
%19 = load float, float* %7
%20 = fdiv float %18, %19
%21 = call float @llvm.fmuladd.f32(float %17, float %20, float %14)
store float %21, float* %5
br label %22
22: ; preds = %13, %12
%23 = load float, float* %5
ret float %23
}

LLVM IR (-O2):
define float @ft_map(float %0, float %1, float %2, float %3) {
%5 = fcmp une float %1, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = fsub float %3, %2
%8 = fdiv float %0, %1
%9 = tail call float @llvm.fmuladd.f32(float %7, float %8, float %2)
br label %10
10: ; preds = %4, %6
%11 = phi float [ %9, %6 ], [ 0.000000e+00, %4 ]
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
b() { printf("b\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"b\00"
define i32 @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned int BWTOccValueMajorSizeInWord(const unsigned int numChar) {
  unsigned int numOfOccValue;
  unsigned int numOfOccIntervalPerMajor;
  numOfOccValue = (numChar + 256 - 1) / 256 + 1;
  numOfOccIntervalPerMajor = 65536 / 256;
  return (numOfOccValue + numOfOccIntervalPerMajor - 1) /
         numOfOccIntervalPerMajor * 4;
}


x86 assembly (clang, -O0):
<BWTOccValueMajorSizeInWord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%eax
sub    $0x1,%eax
shr    $0x8,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x100,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BWTOccValueMajorSizeInWord>:
lea    0xff(%rdi),%eax
shr    $0x8,%eax
add    $0x100,%eax
shr    $0x6,%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @BWTOccValueMajorSizeInWord(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add i32 %5, 256
%7 = sub i32 %6, 1
%8 = udiv i32 %7, 256
%9 = add i32 %8, 1
store i32 %9, i32* %3
store i32 256, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add i32 %10, %11
%13 = sub i32 %12, 1
%14 = load i32, i32* %4
%15 = udiv i32 %13, %14
%16 = mul i32 %15, 4
ret i32 %16
}

LLVM IR (-O2):
define i32 @BWTOccValueMajorSizeInWord(i32 %0) {
%2 = add i32 %0, 255
%3 = lshr i32 %2, 8
%4 = add nuw nsw i32 %3, 256
%5 = lshr i32 %4, 6
%6 = and i32 %5, 524284
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void myFree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<myFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @myFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
long *f() {}


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

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

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

LLVM IR (-O2):
define noalias i64* @f() {
ret i64* undef
}
double return_double(double a, double b) { return b; }


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

x86 assembly (clang, -O2):
<return_double>:
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @return_double(double %0, double returned %1) {
ret double %1
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
int main(int argc, char *argv[]) {
  int i, j = 0;
  double pi;
  pid_t pid;
  pid = getpid();
  printf("spin: Pid %ld\n", (long)pid);
  i = 0;
  while (0 == j) {
    i++;
    pi = i / 3.14159256;
    if (i > 100)
      i = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%eax
jne    119f <main+0x7f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x64,-0x14(%rbp)
jle    119a <main+0x7a>
movl   $0x0,-0x14(%rbp)
jmp    115f <main+0x3f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"spin: Pid %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%10 = call i64 (...) @getpid()
store i64 %10, i64* %9
%11 = load i64, i64* %9
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %11)
store i32 0, i32* %6
br label %13
13: ; preds = %25, %2
%14 = load i32, i32* %7
%15 = icmp eq i32 0, %14
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = sitofp i32 %19 to double
%21 = fdiv double %20, 0x400921FB47B47491
store double %21, double* %8
%22 = load i32, i32* %6
%23 = icmp sgt i32 %22, 100
br i1 %23, label %24, label %25
24: ; preds = %16
store i32 0, i32* %6
br label %25
25: ; preds = %24, %16
br label %13
26: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"spin: Pid %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %3)
unreachable
}
/* Variables and functions */
int SIGSEGV;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void handler(int signo) {
  assert(signo == SIGSEGV);
  fprintf(stderr, "three\n");
  exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    0x2eb0(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGSEGV = global i32 0
@stderr = global i32 0
@.str = [7 x i8] c"three\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGSEGV
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
@stderr = global i32 0
@.str = [7 x i8] c"three\0A\00"
define void @handler(i32 %0) {
%2 = load i32, i32* @SIGSEGV
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void f();
void test3() { 1 ? f() : (void)0; }


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

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

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

LLVM IR (-O2):
define void @test3() {
tail call void (...) @f()
ret void
}
void abcd8efghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcd8efghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
int real_chroot(char const *);
int evil_chroot(const char *path) {
  int ret = 0;
  ret = real_chroot(path);
  return ret;
}


x86 assembly (clang, -O0):
<evil_chroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <real_chroot@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evil_chroot>:
jmp    1030 <real_chroot@plt>

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

LLVM IR (-O2):
define i32 @evil_chroot(i8* %0) {
%2 = tail call i32 @real_chroot(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void reap_exited_processes(int sig_number) {
  pid_t process_id;
  while (1) {
    process_id = waitpid(-1, NULL, WNOHANG);
    if ((0 == process_id) || (-1 == process_id)) {
      break;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<reap_exited_processes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
je     114e <reap_exited_processes+0x3e>
mov    $0xffffffff,%eax
cmp    -0x8(%rbp),%eax
jne    1153 <reap_exited_processes+0x43>
jmp    1158 <reap_exited_processes+0x48>
jmp    111b <reap_exited_processes+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reap_exited_processes>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
add    $0x1,%eax
cmp    $0x1,%eax
ja     1120 <reap_exited_processes+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @reap_exited_processes(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i32 @waitpid(i32 -1, i32* null, i32 %3)
%5 = add i32 %4, 1
%6 = icmp ult i32 %5, 2
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
void ff_hevc_put_hevc_uni_qpel_h32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h32_12_sse4() {
ret void
}
main() {
  extern int (*f)(int, int);
  extern int q(int, int);
  int (*p)(int, int);
  f(1, 2);
  (*f)(1, 2);
  (*****f)(1, 2);
  q(1, 2);
  p = q;
  p(1, 2);
  p = f;
  p(1, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    0x2ebf(%rip),%rax
call   *(%rax)
mov    $0x1,%edi
mov    $0x2,%esi
mov    0x2eac(%rip),%rax
call   *(%rax)
mov    $0x1,%edi
mov    $0x2,%esi
mov    0x2e99(%rip),%rax
call   *(%rax)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <q@plt>
mov    0x2e91(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   *-0x8(%rbp)
mov    0x2e69(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   *-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    $0x1,%edi
mov    $0x2,%esi
call   *(%rbx)
mov    $0x1,%edi
mov    $0x2,%esi
call   *(%rbx)
mov    $0x1,%edi
mov    $0x2,%esi
call   *(%rbx)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <q@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <q@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   *(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@f = external global i32 (i32, i32)*
define i32 @main() {
%1 = alloca i32 (i32, i32)*
%2 = load i32 (i32, i32)*, i32 (i32, i32)** @f
%3 = call i32 %2(i32 1, i32 2)
%4 = load i32 (i32, i32)*, i32 (i32, i32)** @f
%5 = call i32 %4(i32 1, i32 2)
%6 = load i32 (i32, i32)*, i32 (i32, i32)** @f
%7 = call i32 %6(i32 1, i32 2)
%8 = call i32 @q(i32 1, i32 2)
store i32 (i32, i32)* @q, i32 (i32, i32)** %1
%9 = load i32 (i32, i32)*, i32 (i32, i32)** %1
%10 = call i32 %9(i32 1, i32 2)
%11 = load i32 (i32, i32)*, i32 (i32, i32)** @f
store i32 (i32, i32)* %11, i32 (i32, i32)** %1
%12 = load i32 (i32, i32)*, i32 (i32, i32)** %1
%13 = call i32 %12(i32 1, i32 2)
ret i32 0
}

LLVM IR (-O2):
@f = external global i32 (i32, i32)*
define i32 @main() {
%1 = load i32 (i32, i32)*, i32 (i32, i32)** @f
%2 = tail call i32 %1(i32 1, i32 2)
%3 = load i32 (i32, i32)*, i32 (i32, i32)** @f
%4 = tail call i32 %3(i32 1, i32 2)
%5 = load i32 (i32, i32)*, i32 (i32, i32)** @f
%6 = tail call i32 %5(i32 1, i32 2)
%7 = tail call i32 @q(i32 1, i32 2)
%8 = tail call i32 @q(i32 1, i32 2)
%9 = load i32 (i32, i32)*, i32 (i32, i32)** @f
%10 = tail call i32 %9(i32 1, i32 2)
ret i32 0
}
/* Type definitions */
struct custat {
  int dummy;
};

/* Variables and functions */
int __custom_stat(int, char const *, struct custat *, int);
int custom_stat_untaint(int procfd, const char *name, struct custat *s) {
  return __custom_stat(procfd, name, s, 1);
}


x86 assembly (clang, -O0):
<custom_stat_untaint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <__custom_stat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_stat_untaint>:
mov    $0x1,%ecx
jmp    1030 <__custom_stat@plt>

LLVM IR (-O0):
%struct.custat = type { i32 }
define i32 @custom_stat_untaint(i32 %0, i8* %1, %struct.custat* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.custat*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.custat* %2, %struct.custat** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load %struct.custat*, %struct.custat** %6
%10 = call i32 @__custom_stat(i32 %7, i8* %8, %struct.custat* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.custat = type { i32 }
define i32 @custom_stat_untaint(i32 %0, i8* %1, %struct.custat* %2) {
%4 = tail call i32 @__custom_stat(i32 %0, i8* %1, %struct.custat* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(const char *s) {
  fprintf(stderr, "%s\n", s);
  exit(EXIT_FAILURE);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void myprint(unsigned int *buf, unsigned int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%08x\n", buf[i]);
  }
}


x86 assembly (clang, -O0):
<myprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1157 <myprint+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <myprint+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1145 <myprint+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <myprint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%08x\0A\00"
define void @myprint(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *str, int code) {
  fprintf(stderr, "Error: %s\n", str);
  exit(code);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void check_sorted(int32_t *a, int32_t n) {
  int32_t i;
  n--;
  for (i = 0; i < n; i++) {
    assert(a[i] <= a[i + 1]);
  }
}


x86 assembly (clang, -O0):
<check_sorted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1179 <check_sorted+0x69>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
cmp    0x8(%rcx,%rdx,8),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <check_sorted+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_sorted>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%rsi
je     114d <check_sorted+0x3d>
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    -0x8(%r15,%rbx,8),%rax
xor    %edi,%edi
cmp    (%r15,%rbx,8),%rax
setbe  %dil
call   1030 <assert@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <check_sorted+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @check_sorted(i64* nocapture %0, i64 %1) {
%3 = add i64 %1, -1
%4 = icmp eq i64 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i64, i64* %0, i64 %9
%11 = load i64, i64* %10
%12 = icmp ule i64 %8, %11
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = icmp eq i64 %9, %3
br i1 %15, label %16, label %5
16: ; preds = %5, %2
ret void
}
void logger_platform_init(const char *file) {}


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

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

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

LLVM IR (-O2):
define void @logger_platform_init(i8* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned char inb(unsigned int);
unsigned char nsp32_read1(unsigned int base, unsigned int index) {
  return inb(base + index);
}


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

x86 assembly (clang, -O2):
<nsp32_read1>:
add    %esi,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @nsp32_read1(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 = add i32 %5, %6
%8 = call zeroext i8 @inb(i32 %7)
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @nsp32_read1(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = tail call zeroext i8 @inb(i32 %3)
ret i8 %4
}
double f4_cb_send_pre_int_int(double (*cb)(int, int)) {
  int r = 44;
  return cb(8, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2c,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%esi
mov    $0x8,%edi
call   *%rax
movsd  0xed7(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int>:
push   %rax
mov    %rdi,%rax
mov    $0x8,%edi
mov    $0x2c,%esi
call   *%rax
addsd  0xee8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int(double (i32, i32)* %0) {
%2 = alloca double (i32, i32)*
%3 = alloca i32
store double (i32, i32)* %0, double (i32, i32)** %2
store i32 44, i32* %3
%4 = load double (i32, i32)*, double (i32, i32)** %2
%5 = load i32, i32* %3
%6 = call double %4(i32 8, i32 %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int(double (i32, i32)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 44)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Type definitions */
typedef scalar_t__ intmax_t;

/* Variables and functions */
scalar_t__ getq(char const *);
int intcmp(const char *s1, const char *s2) {
  intmax_t q1, q2;
  q1 = getq(s1);
  q2 = getq(s2);
  if (q1 > q2)
    return 1;
  if (q1 < q2)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getq@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <getq@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1154 <intcmp+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1175 <intcmp+0x65>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    116e <intcmp+0x5e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <intcmp+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <getq@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <getq@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setl   %cl
neg    %ecx
cmp    %rax,%rbx
mov    $0x1,%eax
cmovle %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @intcmp(i8* %0, i8* %1) {
%3 = tail call i64 @getq(i8* %0)
%4 = tail call i64 @getq(i8* %1)
%5 = icmp sgt i64 %3, %4
%6 = icmp slt i64 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int Maior(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int A, B, C, MaiorAB;
  scanf("%d%d%d", &A, &B, &C);
  MaiorAB = Maior(A, B);
  MaiorAB = Maior(MaiorAB, C);
  printf("%d eh o maior\n", MaiorAB);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <Maior@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <Maior@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
call   1040 <Maior@plt>
mov    0xc(%rsp),%esi
mov    %eax,%edi
call   1040 <Maior@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [15 x i8] c"%d eh o maior\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @Maior(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = call i32 @Maior(i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [15 x i8] c"%d eh o maior\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @Maior(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @Maior(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}
void UAPP_TaskADC(void) {}


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

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

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

LLVM IR (-O2):
define void @UAPP_TaskADC() {
ret void
}
void iic_init(void) {
  (*(volatile unsigned *)0xE02000C0) |= 0x22;
  (*(volatile unsigned *)0xE02000C8) |= 0x5;
  (*(volatile unsigned *)0xE1800000) = (1 << 7) | (0 << 6) | (1 << 5) | (0xf);
  (*(volatile unsigned *)0xE1800004) = 0x10;
}


x86 assembly (clang, -O0):
<iic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe02000c0,%eax
mov    (%rax),%ecx
or     $0x22,%ecx
mov    $0xe02000c0,%eax
mov    %ecx,(%rax)
mov    $0xe02000c8,%eax
mov    (%rax),%ecx
or     $0x5,%ecx
mov    $0xe02000c8,%eax
mov    %ecx,(%rax)
mov    $0xe1800000,%eax
movl   $0xaf,(%rax)
mov    $0xe1800004,%eax
movl   $0x10,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<iic_init>:
mov    $0xe02000c0,%eax
orl    $0x22,(%rax)
orl    $0x5,0x8(%rax)
movl   $0xaf,0x15fff40(%rax)
movl   $0x10,0x15fff44(%rax)
ret

LLVM IR (-O0):
define void @iic_init() {
%1 = load volatile i32, i32* inttoptr (i64 3760193728 to i32*)
%2 = or i32 %1, 34
store volatile i32 %2, i32* inttoptr (i64 3760193728 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 3760193736 to i32*)
%4 = or i32 %3, 5
store volatile i32 %4, i32* inttoptr (i64 3760193736 to i32*)
store volatile i32 175, i32* inttoptr (i64 3783262208 to i32*)
store volatile i32 16, i32* inttoptr (i64 3783262212 to i32*)
ret void
}

LLVM IR (-O2):
define void @iic_init() {
%1 = load volatile i32, i32* inttoptr (i64 3760193728 to i32*)
%2 = or i32 %1, 34
store volatile i32 %2, i32* inttoptr (i64 3760193728 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 3760193736 to i32*)
%4 = or i32 %3, 5
store volatile i32 %4, i32* inttoptr (i64 3760193736 to i32*)
store volatile i32 175, i32* inttoptr (i64 3783262208 to i32*)
store volatile i32 16, i32* inttoptr (i64 3783262212 to i32*)
ret void
}
/* Variables and functions */
char tolower(char);
char *downcase(char *str) {
  for (; *str; ++str)
    *str = tolower(*str);
  return str;
}


x86 assembly (clang, -O0):
<downcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <downcase+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <downcase+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downcase>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <downcase+0x26>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <downcase+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @downcase(i8* %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 signext %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
%12 = phi i8* [ %0, %1 ], [ %8, %4 ]
ret i8* %12
}
float findhigh(float x, float y, float z) {
  if (y > x)
    x = y;
  if (z > x)
    x = z;
  return x;
}


x86 assembly (clang, -O0):
<findhigh>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112c <findhigh+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1145 <findhigh+0x45>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<findhigh>:
maxss  %xmm0,%xmm1
maxss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @findhigh(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %4
%9 = fcmp ogt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
store float %11, float* %4
br label %12
12: ; preds = %10, %3
%13 = load float, float* %6
%14 = load float, float* %4
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
store float %17, float* %4
br label %18
18: ; preds = %16, %12
%19 = load float, float* %4
ret float %19
}

LLVM IR (-O2):
define float @findhigh(float %0, float %1, float %2) {
%4 = fcmp ogt float %1, %0
%5 = select i1 %4, float %1, float %0
%6 = fcmp olt float %5, %2
%7 = select i1 %6, float %2, float %5
ret float %7
}
double cube(int x) { return x * x * x; }


x86 assembly (clang, -O0):
<cube>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube>:
mov    %edi,%eax
imul   %edi,%eax
imul   %edi,%eax
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @cube(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @cube(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ print_permutations(char **, int, int);
int main(int argc, char *argv[]) {
  print_permutations(argv + 1, argc - 2, argc - 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x8(%rsi),%rax
lea    -0x2(%rdi),%esi
lea    -0x1(%rdi),%edx
mov    %rax,%rdi
call   1030 <print_permutations@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 2
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = call i32 @print_permutations(i8** %7, i32 %9, i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = add nsw i32 %0, -2
%5 = add nsw i32 %0, -1
%6 = tail call i32 @print_permutations(i8** %3, i32 %4, i32 %5)
ret i32 0
}
extern __attribute__((gnu_)) void exit(int err) {
  extern void _exit(int s);
  _exit(err);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
tail call void @_exit(i32 %0)
unreachable
}
/* Variables and functions */
double sigmoid(double);
void actFun(double *v, int length) {
  int ctr;
  for (ctr = 0; ctr < length; ctr++) {
    v[ctr] = sigmoid(v[ctr]);
  }
}


x86 assembly (clang, -O0):
<actFun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <actFun+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <sigmoid@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <actFun+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<actFun>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <actFun+0x3a>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
call   1030 <sigmoid@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <actFun+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @actFun(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call double @sigmoid(double %9)
store double %10, double* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Space(int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<Space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <Space+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <Space+0x12>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Space>:
push   %rbx
test   %edi,%edi
jle    112f <Space+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <Space+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Space(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 10)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 0
}