xunge/DecIR huggingface dataset:
/* Variables and functions */
int omp_get_num_threads();
int /*<<< orphan*/ work(int);
void test1() {
  int i, np;
  np = omp_get_num_threads();
#pragma omp parallel for schedule(static)
  for (i = 0; i < np; i++) {
    work(i);
  }
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115b <test1+0x3b>
mov    -0x4(%rbp),%edi
call   1030 <work@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <test1+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <omp_get_num_threads@plt>
test   %eax,%eax
jle    114e <test1+0x2e>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <work@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1140 <test1+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @test1() {
%1 = tail call i32 (...) @omp_get_num_threads()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 0, %0 ]
%5 = tail call i32 @work(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %1
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Type definitions */
struct sigaction {
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_mask;
  int /*<<< orphan*/ sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ affichage_recursif();
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int main() {
  struct sigaction sa;
  sa.sa_handler = SIG_IGN;
  sigfillset(&sa.sa_mask);
  sa.sa_flags = 0;
  sigaction(SIGINT, &sa, NULL);
  affichage_recursif();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1050 <sigfillset@plt>
movq   $0x0,-0x10(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    $0x0,%al
call   1040 <affichage_recursif@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
lea    0x10(%rsp),%rdi
call   1050 <sigfillset@plt>
movq   $0x0,0x8(%rsp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
xor    %eax,%eax
call   1040 <affichage_recursif@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
@SIGINT = global i32 0
define i32 @main() {
%1 = alloca %struct.sigaction
%2 = load i32, i32* @SIG_IGN
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 2
store i32 %2, i32* %3
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 1
%5 = call i32 @sigfillset(i32* %4)
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i64 0, i64* %6
%7 = load i32, i32* @SIGINT
%8 = call i32 @sigaction(i32 %7, %struct.sigaction* %1, i32* null)
%9 = call i32 (...) @affichage_recursif()
ret i32 0
}

LLVM IR (-O2):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
@SIGINT = global i32 0
define i32 @main() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = load i32, i32* @SIG_IGN
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 2
store i32 %3, i32* %4
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 1
%6 = call i32 @sigfillset(i32* %5)
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i64 0, i64* %7
%8 = load i32, i32* @SIGINT
%9 = call i32 @sigaction(i32 %8, %struct.sigaction* %1, i32* null)
%10 = call i32 (...) @affichage_recursif()
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *BaseName(const char *p) {
  char *c;
  if (!(c = strrchr(p, '/')))
    c = strrchr(p, '\\');
  return ((c != NULL) ? c + 1 : p);
}


x86 assembly (clang, -O0):
<BaseName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114a <BaseName+0x3a>
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <BaseName+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116e <BaseName+0x5e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaseName>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
jne    1130 <BaseName+0x20>
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @BaseName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i8* @strrchr(i8* %8, i8 signext 92)
store i8* %9, i8** %3
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
br label %18
16: ; preds = %10
%17 = load i8*, i8** %2
br label %18
18: ; preds = %16, %13
%19 = phi i8* [ %15, %13 ], [ %17, %16 ]
ret i8* %19
}

LLVM IR (-O2):
define i8* @BaseName(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %2, %1 ], [ %5, %4 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %0, i8* %9
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
void set_nick(int sock, char nick[]) {
  char nick_packet[512];
  sprintf(nick_packet, "NICK %s\r\n", nick);
  send(sock, nick_packet, strlen(nick_packet), 0);
}


x86 assembly (clang, -O0):
<set_nick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x21c(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
lea    -0x210(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x21c(%rbp),%edi
mov    -0x218(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nick>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%rdx
mov    %edi,%ebp
lea    0xebb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"NICK %s\0D\0A\00"
define void @set_nick(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [512 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @send(i32 %9, i8* %10, i32 %12, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"NICK %s\0D\0A\00"
define void @set_nick(i32 %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @send(i32 %0, i8* %4, i32 %6, i32 0)
ret void
}
double dist_sq(double x1, double y1, double z1, double x2, double y2,
               double z2) {
  double dx, dy, dz;
  dx = x2 - x1;
  dy = y2 - y1;
  dz = z2 - z1;
  return dx * dx + dy * dy + dz * dz;
}


x86 assembly (clang, -O0):
<dist_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_sq>:
subsd  %xmm0,%xmm3
subsd  %xmm1,%xmm4
subsd  %xmm2,%xmm5
mulsd  %xmm4,%xmm4
mulsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm5,%xmm5
addsd  %xmm3,%xmm5
movapd %xmm5,%xmm0
ret

LLVM IR (-O0):
define double @dist_sq(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%16 = load double, double* %10
%17 = load double, double* %7
%18 = fsub double %16, %17
store double %18, double* %13
%19 = load double, double* %11
%20 = load double, double* %8
%21 = fsub double %19, %20
store double %21, double* %14
%22 = load double, double* %12
%23 = load double, double* %9
%24 = fsub double %22, %23
store double %24, double* %15
%25 = load double, double* %13
%26 = load double, double* %13
%27 = load double, double* %14
%28 = load double, double* %14
%29 = fmul double %27, %28
%30 = call double @llvm.fmuladd.f64(double %25, double %26, double %29)
%31 = load double, double* %15
%32 = load double, double* %15
%33 = call double @llvm.fmuladd.f64(double %31, double %32, double %30)
ret double %33
}

LLVM IR (-O2):
define double @dist_sq(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %3, %0
%8 = fsub double %4, %1
%9 = fsub double %5, %2
%10 = fmul double %8, %8
%11 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %10)
%12 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %11)
ret double %12
}
void I_NoAppServicesClientGetServerFromLobby(void) {}


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

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

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

LLVM IR (-O2):
define void @I_NoAppServicesClientGetServerFromLobby() {
ret void
}
int sleep_time() { return 1; }


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

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

LLVM IR (-O0):
define i32 @sleep_time() {
ret i32 1
}

LLVM IR (-O2):
define i32 @sleep_time() {
ret i32 1
}
int hide_int(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @hide_int(i32 returned %0) {
ret i32 %0
}
void kegi_cgi_init() {}


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

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

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

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

/* Variables and functions */
int unlock_regspace2_uniform(struct flashctx *, int);
int unlock_regspace2_uniform_64k(struct flashctx *flash) {
  return unlock_regspace2_uniform(flash, 64 * 1024);
}


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

x86 assembly (clang, -O2):
<unlock_regspace2_uniform_64k>:
mov    $0x10000,%esi
jmp    1030 <unlock_regspace2_uniform@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @unlock_regspace2_uniform_64k(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %2
%3 = load %struct.flashctx*, %struct.flashctx** %2
%4 = call i32 @unlock_regspace2_uniform(%struct.flashctx* %3, i32 65536)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @unlock_regspace2_uniform_64k(%struct.flashctx* %0) {
%2 = tail call i32 @unlock_regspace2_uniform(%struct.flashctx* %0, i32 65536)
ret i32 %2
}
/* Variables and functions */
double cos(double);
double dcircle(double x, double r) {
  return (r * 3.1415926535 * cos(3.1415926535 * x));
}


x86 assembly (clang, -O0):
<dcircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec4(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcircle>:
push   %rax
movsd  0xee7(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  %xmm1,(%rsp)
mulsd  %xmm2,%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dcircle(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
%6 = fmul double %5, 0x400921FB54411744
%7 = load double, double* %3
%8 = fmul double 0x400921FB54411744, %7
%9 = call double @cos(double %8)
%10 = fmul double %6, %9
ret double %10
}

LLVM IR (-O2):
define double @dcircle(double %0, double %1) {
%3 = fmul double %1, 0x400921FB54411744
%4 = fmul double %0, 0x400921FB54411744
%5 = tail call double @cos(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Type definitions */
struct stat {
  size_t st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
scalar_t__ fstat(int /*<<< orphan*/, struct stat *);
size_t getKernelSize(FILE *kernel) {
  struct stat buf;
  if (fstat(fileno(kernel), &buf)) {
    return 0;
  }
  return buf.st_size;
}


x86 assembly (clang, -O0):
<getKernelSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
lea    -0x18(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
je     1157 <getKernelSize+0x37>
movq   $0x0,-0x8(%rbp)
jmp    115f <getKernelSize+0x3f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKernelSize>:
push   %rax
call   1030 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
test   %rax,%rax
jne    113b <getKernelSize+0x1b>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @getKernelSize(i32* %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca %struct.stat
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @fileno(i32* %5)
%7 = call i64 @fstat(i32 %6, %struct.stat* %4)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i64 0, i64* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i64, i64* %11
store i64 %12, i64* %2
br label %13
13: ; preds = %10, %9
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @getKernelSize(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = call i64 @fstat(i32 %4, %struct.stat* %2)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i64, i64* %7
%9 = select i1 %6, i64 %8, i64 0
ret i64 %9
}
void rlCloseAgentConnection() {}


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

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

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

LLVM IR (-O2):
define void @rlCloseAgentConnection() {
ret void
}
/* Variables and functions */
unsigned long GetStringHeight116(char const *);
unsigned long getstringheight(const char *s) { return GetStringHeight116(s); }


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

x86 assembly (clang, -O2):
<getstringheight>:
jmp    1030 <GetStringHeight116@plt>

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

LLVM IR (-O2):
define i64 @getstringheight(i8* %0) {
%2 = tail call i64 @GetStringHeight116(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ another_function();
int gatsa();
int one_more(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int gatsa_return;
  gatsa_return = gatsa();
  printf("%d\n", gatsa_return);
  another_function();
  printf("%d\n", one_more(1, 2, 3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <gatsa@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <another_function@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <one_more@plt>
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <gatsa@plt>
lea    0xeb1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <another_function@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <one_more@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @gatsa()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @another_function()
%4 = tail call i32 @one_more(i32 1, i32 2, i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
unsigned rotate_right(unsigned x, int n) {
  int w = sizeof(int) << 3;
  return ((x << (w - n - 1)) << 1) + (x >> n);
}


x86 assembly (clang, -O0):
<rotate_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_right>:
mov    $0x1f,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @rotate_right(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 32, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = sub nsw i32 %9, 1
%11 = shl i32 %6, %10
%12 = shl i32 %11, 1
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = lshr i32 %13, %14
%16 = add i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @rotate_right(i32 %0, i32 %1) {
%3 = sub i32 31, %1
%4 = shl i32 %0, %3
%5 = shl i32 %4, 1
%6 = lshr i32 %0, %1
%7 = add i32 %5, %6
ret i32 %7
}
int get_token(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @get_token() {
ret i32 5
}

LLVM IR (-O2):
define i32 @get_token() {
ret i32 5
}
int GetILevel(int sharpness, int level) {
  if (sharpness > 0) {
    if (sharpness > 4) {
      level >>= 2;
    } else {
      level >>= 1;
    }
    if (level > 9 - sharpness) {
      level = 9 - sharpness;
    }
  }
  if (level < 1)
    level = 1;
  return level;
}


x86 assembly (clang, -O0):
<GetILevel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1158 <GetILevel+0x58>
cmpl   $0x4,-0x4(%rbp)
jle    112c <GetILevel+0x2c>
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <GetILevel+0x35>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x9,%ecx
sub    -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    1153 <GetILevel+0x53>
mov    $0x9,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <GetILevel+0x58>
cmpl   $0x1,-0x8(%rbp)
jge    1169 <GetILevel+0x69>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetILevel>:
test   %edi,%edi
jle    111a <GetILevel+0x1a>
cmp    $0x5,%edi
mov    $0x1,%cl
sbb    $0xff,%cl
sar    %cl,%esi
mov    $0x9,%eax
sub    %edi,%eax
cmp    %eax,%esi
cmovg  %eax,%esi
test   %esi,%esi
mov    $0x1,%eax
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @GetILevel(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 4
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %4
%12 = ashr i32 %11, 2
store i32 %12, i32* %4
br label %16
13: ; preds = %7
%14 = load i32, i32* %4
%15 = ashr i32 %14, 1
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = sub nsw i32 9, %18
%20 = icmp sgt i32 %17, %19
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load i32, i32* %3
%23 = sub nsw i32 9, %22
store i32 %23, i32* %4
br label %24
24: ; preds = %21, %16
br label %25
25: ; preds = %24, %2
%26 = load i32, i32* %4
%27 = icmp slt i32 %26, 1
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 1, i32* %4
br label %29
29: ; preds = %28, %25
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @GetILevel(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = icmp ugt i32 %0, 4
%6 = select i1 %5, i32 2, i32 1
%7 = ashr i32 %1, %6
%8 = sub nsw i32 9, %0
%9 = icmp sgt i32 %7, %8
%10 = select i1 %9, i32 %8, i32 %7
br label %11
11: ; preds = %4, %2
%12 = phi i32 [ %1, %2 ], [ %10, %4 ]
%13 = icmp sgt i32 %12, 1
%14 = select i1 %13, i32 %12, i32 1
ret i32 %14
}
/* Type definitions */
struct ssh_mac_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ssh_mac_t *);
void free_evp_mac(struct ssh_mac_t *m) { free(m); }


x86 assembly (clang, -O0):
<free_evp_mac>:
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):
<free_evp_mac>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ssh_mac_t = type { i32 }
define void @free_evp_mac(%struct.ssh_mac_t* %0) {
%2 = alloca %struct.ssh_mac_t*
store %struct.ssh_mac_t* %0, %struct.ssh_mac_t** %2
%3 = load %struct.ssh_mac_t*, %struct.ssh_mac_t** %2
%4 = call i32 @free(%struct.ssh_mac_t* %3)
ret void
}

LLVM IR (-O2):
%struct.ssh_mac_t = type { i32 }
define void @free_evp_mac(%struct.ssh_mac_t* nocapture %0) {
%2 = tail call i32 @free(%struct.ssh_mac_t* %0)
ret void
}
void yydestruct(const char *yymsg, int yytype, char const **yyvaluep) {
  ((void)(yyvaluep));
  if (!yymsg)
    yymsg = "Deleting";
  ;
  switch (yytype) {
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<yydestruct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1125 <yydestruct+0x25>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <yydestruct+0x2a>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Deleting\00"
define void @yydestruct(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %3
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %4
br label %11
11: ; preds = %10, %3
%12 = load i32, i32* %5
switch i32 %12, label %13 [
]
13: ; preds = %11
br label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @yydestruct(i8* nocapture %0, i32 %1, i8** nocapture %2) {
ret void
}
/* Variables and functions */
int ucon64_bswap16_n(void *, int);
int ucon64_fbswap16_func(void *buffer, int n, void *object) {
  (void)object;
  return ucon64_bswap16_n(buffer, n);
}


x86 assembly (clang, -O0):
<ucon64_fbswap16_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ucon64_bswap16_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucon64_fbswap16_func>:
jmp    1030 <ucon64_bswap16_n@plt>

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

LLVM IR (-O2):
define i32 @ucon64_fbswap16_func(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @ucon64_bswap16_n(i8* %0, i32 %1)
ret i32 %4
}
const char *xlat_get_name(void) { return "Graybox"; }


x86 assembly (clang, -O0):
<xlat_get_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlat_get_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Graybox\00"
define i8* @xlat_get_name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"Graybox\00"
define i8* @xlat_get_name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
int xh_int_hash(const void *key, void *data) {
  (void)data;
  return *(int *)key;
}


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

x86 assembly (clang, -O2):
<xh_int_hash>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @xh_int_hash(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @xh_int_hash(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *foo(void *arg) {
  int i = 0;
  while (1) {
    if (arg) {
      if (i >= 3)
        break;
    } else {
      if (i >= 9)
        break;
    }
    printf("%i\n", i);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1142 <foo+0x32>
cmpl   $0x3,-0xc(%rbp)
jl     113d <foo+0x2d>
jmp    1173 <foo+0x63>
jmp    1156 <foo+0x46>
cmpl   $0x9,-0xc(%rbp)
jl     1151 <foo+0x41>
jmp    1173 <foo+0x63>
jmp    1156 <foo+0x46>
mov    -0xc(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <foo+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %ebp,%ebp
lea    0xee0(%rip),%r14
jmp    1142 <foo+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x8,%ebp
ja     114c <foo+0x3c>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
test   %rbx,%rbx
je     1130 <foo+0x20>
cmp    $0x2,%ebp
jbe    1135 <foo+0x25>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define noalias i8* @foo(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br label %3
3: ; preds = %9, %1
%4 = phi i32 [ 0, %1 ], [ %11, %9 ]
br i1 %2, label %7, label %5
5: ; preds = %3
%6 = icmp ugt i32 %4, 2
br i1 %6, label %12, label %9
7: ; preds = %3
%8 = icmp ugt i32 %4, 8
br i1 %8, label %12, label %9
9: ; preds = %7, %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%11 = add nuw nsw i32 %4, 1
br label %3
12: ; preds = %7, %5
ret i8* null
}
/* Variables and functions */
bool nrf52_errata_55(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_55() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int print_status_254(int *A, int *len_a, int *B, int *len_b, int *C,
                     int *len_c) {
  printf("%d %d %d\n", *len_a, *len_b, *len_c);
  return (0);
}


x86 assembly (clang, -O0):
<print_status_254>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_status_254>:
push   %rax
mov    (%rsi),%esi
mov    (%rcx),%edx
mov    (%r9),%ecx
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @print_status_254(i32* nocapture readnone %0, i32* nocapture %1, i32* nocapture readnone %2, i32* nocapture %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* %1
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void ouchbehavior(int sig) {
  printf("   OUCH! - I got signal %d , and this was my reaction.\n", sig);
  printf("   Give me another Ctrl+c to deal with it using default behavior\n");
  (void)signal(SIGINT, SIG_DFL);
}


x86 assembly (clang, -O0):
<ouchbehavior>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ouchbehavior>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
pop    %rax
jmp    1050 <signal@plt>

LLVM IR (-O0):
@.str = [56 x i8] c" OUCH! - I got signal %d , and this was my reaction.\0A\00"
@.str.1 = [66 x i8] c" Give me another Ctrl+c to deal with it using default behavior\0A\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @ouchbehavior(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @SIGINT
%7 = load i32, i32* @SIG_DFL
%8 = call i32 @signal(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c" OUCH! - I got signal %d , and this was my reaction.\0A\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
@str = [65 x i8] c" Give me another Ctrl+c to deal with it using default behavior\00"
define void @ouchbehavior(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_DFL
%6 = tail call i32 @signal(i32 %4, i32 %5)
ret void
}
int execute_getuid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_getuid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
char *strv_env_get_with_length(char **, char const *, int /*<<< orphan*/);
char *strv_env_get(char **l, const char *name) {
  return strv_env_get_with_length(l, name, strlen(name));
}


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

x86 assembly (clang, -O2):
<strv_env_get>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strv_env_get_with_length@plt>

LLVM IR (-O0):
define i8* @strv_env_get(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @strv_env_get_with_length(i8** %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @strv_env_get(i8** %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @strv_env_get_with_length(i8** %0, i8* %1, i32 %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t inv2(uint8_t element) { return element; }


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

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

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

LLVM IR (-O2):
define i32 @inv2(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
unsigned char *chacha12_encrypt(unsigned char *, size_t *,
                                unsigned char const *, size_t,
                                unsigned char const *, unsigned char const *);
unsigned char *crypt_encrypt_chacha12(unsigned char *out, size_t *out_len,
                                      const unsigned char *in, size_t in_len,
                                      const unsigned char *nonce,
                                      const unsigned char *key) {
  return chacha12_encrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_encrypt_chacha12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <chacha12_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_encrypt_chacha12>:
jmp    1030 <chacha12_encrypt@plt>

LLVM IR (-O0):
define i8* @crypt_encrypt_chacha12(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @chacha12_encrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_encrypt_chacha12(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @chacha12_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
void curl_easy_setopt() {}


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

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

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

LLVM IR (-O2):
define void @curl_easy_setopt() {
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
double efunc3(double x) { return cos(100.0 * sin(x)); }


x86 assembly (clang, -O0):
<efunc3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efunc3>:
push   %rax
call   1030 <sin@plt>
mulsd  0xed2(%rip),%xmm0
pop    %rax
jmp    1040 <cos@plt>

LLVM IR (-O0):
define double @efunc3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = fmul double 1.000000e+02, %4
%6 = call double @cos(double %5)
ret double %6
}

LLVM IR (-O2):
define double @efunc3(double %0) {
%2 = tail call double @sin(double %0)
%3 = fmul double %2, 1.000000e+02
%4 = tail call double @cos(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getenv(char *);
int /*<<< orphan*/ stderr;
const char *pango_get_lib_subdirectory(void) {
  char *d;
  d = getenv("PANGO_LIB_DIR");
  if (!d)
    d = "/usr/lib32/pango";
  fprintf(stderr, "Pangohack: using lib dir %s\n", d);
  return d;
}


x86 assembly (clang, -O0):
<pango_get_lib_subdirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114e <pango_get_lib_subdirectory+0x2e>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pango_get_lib_subdirectory>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
lea    0xed4(%rip),%rax
cmove  %rax,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"PANGO_LIB_DIR\00"
@.str.1 = [17 x i8] c"/usr/lib32/pango\00"
@stderr = global i32 0
@.str.2 = [29 x i8] c"Pangohack: using lib dir %s\0A\00"
define i8* @pango_get_lib_subdirectory() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %0
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"PANGO_LIB_DIR\00"
@.str.1 = [17 x i8] c"/usr/lib32/pango\00"
@stderr = global i32 0
@.str.2 = [29 x i8] c"Pangohack: using lib dir %s\0A\00"
define i8* @pango_get_lib_subdirectory() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i8* %3
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *sret = s;
  while (*s) {
    s++;
  }
  return s - sret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(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 = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int isprimer(int ta) {
  int i = 2;
  for (; i < ta; i++) {
    if (ta % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprimer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isprimer+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isprimer+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isprimer+0x50>
jmp    113b <isprimer+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprimer+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprimer>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <isprimer+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isprimer+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isprimer+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

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