xunge/DecIR huggingface dataset:
/* Variables and functions */
int analogRead(int);
void readKnobs(int k[], int theSize) {
  for (int i = 0; i < theSize; i++) {
    analogRead(i);
    k[i] = analogRead(i);
  }
}


x86 assembly (clang, -O0):
<readKnobs>:
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    115d <readKnobs+0x4d>
mov    -0x10(%rbp),%edi
call   1030 <analogRead@plt>
mov    -0x10(%rbp),%edi
call   1030 <analogRead@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <readKnobs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readKnobs>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114b <readKnobs+0x3b>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <analogRead@plt>
mov    %ebx,%edi
call   1030 <analogRead@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <readKnobs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @readKnobs(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 = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %5
%12 = call i32 @analogRead(i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @analogRead(i32 %13)
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 %14, i32* %18
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @readKnobs(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = trunc i64 %8 to i32
%10 = tail call i32 @analogRead(i32 %9)
%11 = tail call i32 @analogRead(i32 %9)
%12 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
void pathcon_nm10_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm10_decref() {
ret void
}
/* Variables and functions */
long double sinh(long double);
long double sinhl(long double a1) { return sinh(a1); }


x86 assembly (clang, -O0):
<sinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinhl>:
jmp    1030 <sinh@plt>

LLVM IR (-O0):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @sinh(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinh(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ Com_sprintf(char *, int, char *);
int /*<<< orphan*/ trap_SendServerCommand(int, char *);
void G_CloseMenus(int clientNum) {
  char buffer[32];
  Com_sprintf(buffer, 32, "serverclosemenus");
  trap_SendServerCommand(clientNum, buffer);
}


x86 assembly (clang, -O0):
<G_CloseMenus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x20,%esi
lea    0xec5(%rip),%rdx
call   1040 <Com_sprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
call   1030 <trap_SendServerCommand@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_CloseMenus>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
lea    0xed0(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
call   1040 <Com_sprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <trap_SendServerCommand@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"serverclosemenus\00"
define void @G_CloseMenus(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @Com_sprintf(i8* %4, i32 32, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%8 = call i32 @trap_SendServerCommand(i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"serverclosemenus\00"
define void @G_CloseMenus(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 @Com_sprintf(i8* %3, i32 32, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @trap_SendServerCommand(i32 %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int strequal(const char *s1, const char *s2) { return !strcmp(s1, s2); }


x86 assembly (clang, -O0):
<strequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strequal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @strequal(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 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @strequal(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GLUT_ELAPSED_TIME;
int glutGet(int /*<<< orphan*/);
int animGetTime() { return glutGet(GLUT_ELAPSED_TIME); }


x86 assembly (clang, -O0):
<animGetTime>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<animGetTime>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <glutGet@plt>

LLVM IR (-O0):
@GLUT_ELAPSED_TIME = global i32 0
define i32 @animGetTime() {
%1 = load i32, i32* @GLUT_ELAPSED_TIME
%2 = call i32 @glutGet(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@GLUT_ELAPSED_TIME = global i32 0
define i32 @animGetTime() {
%1 = load i32, i32* @GLUT_ELAPSED_TIME
%2 = tail call i32 @glutGet(i32 %1)
ret i32 %2
}
int ld_bgt_rm2(long double a1, long double *a2) {
  return !(__builtin_isgreater(a1, *a2));
}


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

x86 assembly (clang, -O2):
<ld_bgt_rm2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @ld_bgt_rm2(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp uge x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "ramfs: -d -u user -w nthreads -b blocksize "
                  "-o mount-options mount-point\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [73 x i8] c"ramfs: -d -u user -w nthreads -b blocksize -o mount-options mount-point\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [73 x i8] c"ramfs: -d -u user -w nthreads -b blocksize -o mount-options mount-point\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int lista[] = {24, 30, 15, 45, 34};
  int ind;
  int *plista = &lista[0];
  for (ind = 0; ind < 5; ind++)
    printf("%d  ", *(plista + ind));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    117c <main+0x6c>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114d <main+0x3d>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2d,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x22,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.lista = [5 x i32] [i32 24, i32 30, i32 15, i32 45, i32 34]
@.str = [5 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %4
store i32 0, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %3
%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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 24)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 30)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 15)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 45)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 34)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpu_reset(int /*<<< orphan*/);
extern void arch_reset(char mode) {
  if (mode == 's') {
    cpu_reset(0);
  }
}


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x73,%eax
jne    1132 <arch_reset+0x22>
xor    %edi,%edi
call   1030 <cpu_reset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_reset>:
cmp    $0x73,%dil
jne    111d <arch_reset+0xd>
xor    %edi,%edi
jmp    1030 <cpu_reset@plt>
ret

LLVM IR (-O0):
define void @arch_reset(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 115
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @cpu_reset(i32 0)
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @arch_reset(i8 signext %0) {
%2 = icmp eq i8 %0, 115
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @cpu_reset(i32 0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned char sd_raw_available() {
  unsigned int i;
  (*(volatile unsigned long *)(0xE0028000 + 0x08)) &= ~(1 << 7);
  for (i = 0; i < 100000; i++)
    ;
  i = (!(((*(volatile unsigned long *)(0xE0028000 + 0x00)) & (1 << 7)) >> 7));
  (*(volatile unsigned long *)(0xE0028000 + 0x08)) |= (1 << 7);
  return i == 0x00;
}


x86 assembly (clang, -O0):
<sd_raw_available>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0028008,%eax
mov    (%rax),%rcx
and    $0xffffffffffffff7f,%rcx
mov    $0xe0028008,%eax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jae    1142 <sd_raw_available+0x42>
jmp    1134 <sd_raw_available+0x34>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <sd_raw_available+0x22>
mov    $0xe0028000,%eax
mov    (%rax),%rax
and    $0x80,%rax
shr    $0x7,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    $0xe0028008,%eax
mov    (%rax),%rcx
or     $0x80,%rcx
mov    $0xe0028008,%eax
mov    %rcx,(%rax)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_raw_available>:
mov    $0xe0028008,%ecx
andq   $0xffffffffffffff7f,(%rcx)
mov    -0x8(%rcx),%rax
orq    $0x80,(%rcx)
shr    $0x7,%al
ret

LLVM IR (-O0):
define zeroext i8 @sd_raw_available() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%3 = and i64 %2, -129
store volatile i64 %3, i64* inttoptr (i64 3758260232 to i64*)
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, 100000
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %1
%10 = add i32 %9, 1
store i32 %10, i32* %1
br label %4
11: ; preds = %4
%12 = load volatile i64, i64* inttoptr (i64 3758260224 to i64*)
%13 = and i64 %12, 128
%14 = lshr i64 %13, 7
%15 = icmp ne i64 %14, 0
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
store i32 %17, i32* %1
%18 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%19 = or i64 %18, 128
store volatile i64 %19, i64* inttoptr (i64 3758260232 to i64*)
%20 = load i32, i32* %1
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = trunc i32 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @sd_raw_available() {
%1 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%2 = and i64 %1, -129
store volatile i64 %2, i64* inttoptr (i64 3758260232 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 3758260224 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%5 = or i64 %4, 128
store volatile i64 %5, i64* inttoptr (i64 3758260232 to i64*)
%6 = trunc i64 %3 to i8
%7 = lshr i8 %6, 7
ret i8 %7
}
void rop3_228_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ S;
  stk2 = *D & stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_228_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_228_0_0>:
xor    %esi,%edx
and    (%rdi),%dl
xor    %sil,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_228_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_usage(const char *msg) {
  printf("Usage: arpscan -d <device> -n <network>\n");
  if (msg)
    printf("  %s\n", msg);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1147 <show_usage+0x37>
mov    -0x8(%rbp),%rsi
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
test   %rbx,%rbx
je     1147 <show_usage+0x27>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Usage: arpscan -d <device> -n <network>\0A\00"
@.str.1 = [6 x i8] c" %s\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c" %s\0A\00"
@str = [40 x i8] c"Usage: arpscan -d <device> -n <network>\00"
define void @show_usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ beolv(char *, int *);
int /*<<< orphan*/ getFug();
int /*<<< orphan*/ kiir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ setFug(int);
int fugmenu() {
  int l;
  kiir("Szeretned lassitani a fuggoleges mozgast?(1 - igen, 0 - nem)(Jelenleg "
       "%d): ",
       getFug());
  beolv("%d", &l);
  if (l >= 0 && l <= 1) {
    setFug(l);
  }
  return 1;
}


x86 assembly (clang, -O0):
<fugmenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getFug@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <kiir@plt>
lea    0xee8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <beolv@plt>
cmpl   $0x0,-0x4(%rbp)
jl     1189 <fugmenu+0x49>
cmpl   $0x1,-0x4(%rbp)
jg     1189 <fugmenu+0x49>
mov    -0x4(%rbp),%edi
call   1050 <setFug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fugmenu>:
push   %rax
xor    %eax,%eax
call   1040 <getFug@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <kiir@plt>
lea    0xeef(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <beolv@plt>
mov    0x4(%rsp),%edi
cmp    $0x1,%edi
ja     1175 <fugmenu+0x35>
call   1050 <setFug@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"Szeretned lassitani a fuggoleges mozgast?(1 - igen, 0 - nem)(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @fugmenu() {
%1 = alloca i32
%2 = call i32 (...) @getFug()
%3 = call i32 @kiir(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %1
%12 = call i32 @setFug(i32 %11)
br label %13
13: ; preds = %10, %7, %0
ret i32 1
}

LLVM IR (-O2):
@.str = [76 x i8] c"Szeretned lassitani a fuggoleges mozgast?(1 - igen, 0 - nem)(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @fugmenu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @getFug()
%4 = tail call i32 @kiir(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp ult i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @setFug(i32 %6)
br label %10
10: ; preds = %8, %0
ret i32 1
}
/* Variables and functions */
bool const_true(char const *_) { return true; }


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

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

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

LLVM IR (-O2):
define i32 @const_true(i8* nocapture readnone %0) {
ret i32 1
}
unsigned q_count(unsigned head, unsigned tail, unsigned size) {
  return ((head - tail) & (size - 1));
}


x86 assembly (clang, -O0):
<q_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_count>:
sub    %esi,%edi
lea    -0x1(%rdx),%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @q_count(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sub i32 %7, %8
%10 = load i32, i32* %6
%11 = sub i32 %10, 1
%12 = and i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @q_count(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 %0, %1
%5 = add i32 %2, -1
%6 = and i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void post_assignment() { write("ganttproject.gan", " />\n", NULL); }


x86 assembly (clang, -O0):
<post_assignment>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<post_assignment>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [5 x i8] c" />\0A\00"
define void @post_assignment() {
%1 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [5 x i8] c" />\0A\00"
define void @post_assignment() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
int main(void) {
  char str[12] = "i am string";
  char c = str[9];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xef3(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0xd(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.str = [12 x i8] c"i am string\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca i8
%3 = bitcast [12 x i8]* %1 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 9
%5 = load i8, i8* %4
store i8 %5, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void NEOMOTE_1_isr_packet_delay_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @NEOMOTE_1_isr_packet_delay_Interrupt() {
ret void
}
/* Variables and functions */
int bitfinder(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  int b;
  int x;
  scanf("%d", &a);
  scanf("%d", &b);
  x = bitfinder(a, b);
  printf("%d", x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <bitfinder@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @bitfinder(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void createCompilationEngineOutputFileName(char *string) {
  int length;
  length = strlen(string);
  string[length - 4] = 'x';
  string[length - 3] = 'm';
  string[length - 2] = 'l';
  string[length - 1] = '\0';
}


x86 assembly (clang, -O0):
<createCompilationEngineOutputFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
movb   $0x78,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movb   $0x6d,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x6c,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createCompilationEngineOutputFileName>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movl   $0x6c6d78,-0x4(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @createCompilationEngineOutputFileName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8 120, i8* %10
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 109, i8* %15
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
store i8 108, i8* %20
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
store i8 0, i8* %25
ret void
}

LLVM IR (-O2):
define void @createCompilationEngineOutputFileName(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 120, i8* %5
%6 = add nsw i32 %2, -3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 109, i8* %8
%9 = add nsw i32 %2, -2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 108, i8* %11
%12 = add nsw i32 %2, -1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
ret void
}
double charge_fraction(double charge) {
  const double charge_ratio = 1.2766;
  if (charge < 0.)
    return 1. / (1. + charge_ratio);
  else if (charge > 0.)
    return charge_ratio / (1. + charge_ratio);
  else
    return 1.;
}


x86 assembly (clang, -O0):
<charge_fraction>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1136 <charge_fraction+0x36>
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1167 <charge_fraction+0x67>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115a <charge_fraction+0x5a>
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1167 <charge_fraction+0x67>
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<charge_fraction>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xeec(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xee2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @charge_fraction(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double 1.276600e+00, double* %4
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0x3FDC1CB2635C0159, double* %2
br label %13
8: ; preds = %1
%9 = load double, double* %3
%10 = fcmp ogt double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store double 0x3FE1F1A6CE51FF53, double* %2
br label %13
12: ; preds = %8
store double 1.000000e+00, double* %2
br label %13
13: ; preds = %12, %11, %7
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @charge_fraction(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 0x3FE1F1A6CE51FF53, double 1.000000e+00
%5 = select i1 %2, double 0x3FDC1CB2635C0159, double %4
ret double %5
}
int mini(int i, int j) { return i > j ? j : i; }


x86 assembly (clang, -O0):
<mini>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <mini+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <mini+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mini(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @mini(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_pthread();
int main(int argc, char **argv) {
  test_pthread();
  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    $0x0,%al
call   1030 <test_pthread@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_pthread@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 = call i32 (...) @test_pthread()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_pthread()
ret i32 0
}
unsigned char BCDToDecimal(unsigned char bcdByte) {
  unsigned char decimal = 0;
  while (bcdByte > 0x09) {
    bcdByte -= 0x10;
    decimal += 10;
  }
  decimal += bcdByte;
  return decimal;
}


x86 assembly (clang, -O0):
<BCDToDecimal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jle    1134 <BCDToDecimal+0x34>
movzbl -0x1(%rbp),%eax
sub    $0x10,%eax
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xa,%eax
mov    %al,-0x2(%rbp)
jmp    110e <BCDToDecimal+0xe>
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BCDToDecimal>:
mov    %edi,%eax
xor    %ecx,%ecx
cmp    $0xa,%al
jb     1120 <BCDToDecimal+0x20>
nopl   0x0(%rax,%rax,1)
add    $0xf0,%al
mov    %ecx,%edx
add    $0xa,%edx
movzbl %dl,%ecx
cmp    $0x9,%al
ja     1110 <BCDToDecimal+0x10>
mov    %edx,%ecx
add    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @BCDToDecimal(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
br label %4
4: ; preds = %8, %1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = icmp sgt i32 %6, 9
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = sub nsw i32 %10, 16
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = add nsw i32 %14, 10
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
br label %4
17: ; preds = %4
%18 = load i8, i8* %2
%19 = zext i8 %18 to i32
%20 = load i8, i8* %3
%21 = zext i8 %20 to i32
%22 = add nsw i32 %21, %19
%23 = trunc i32 %22 to i8
store i8 %23, i8* %3
%24 = load i8, i8* %3
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @BCDToDecimal(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 9
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i8 [ %6, %3 ], [ %0, %1 ]
%6 = add i8 %5, -16
%7 = add nuw nsw i32 %4, 10
%8 = and i32 %7, 255
%9 = icmp ugt i8 %6, 9
br i1 %9, label %3, label %10
10: ; preds = %3
%11 = trunc i32 %7 to i8
br label %12
12: ; preds = %10, %1
%13 = phi i8 [ %0, %1 ], [ %6, %10 ]
%14 = phi i8 [ 0, %1 ], [ %11, %10 ]
%15 = add i8 %13, %14
ret i8 %15
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ FAIL(char *, int /*<<< orphan*/);
int /*<<< orphan*/ PASS(char *);
int /*<<< orphan*/ dlerror();
scalar_t__ foo();
int main() {
  if (foo())
    PASS("rpath-loader_path-dlopen");
  else
    FAIL("rpath-loader_path-dlopen: %s", dlerror());
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1171 <main+0x31>
lea    0xe99(%rip),%rdi
call   1050 <PASS@plt>
jmp    1186 <main+0x46>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1060 <FAIL@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
test   %rax,%rax
je     115b <main+0x1b>
lea    0xeac(%rip),%rdi
call   1050 <PASS@plt>
jmp    1170 <main+0x30>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1060 <FAIL@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"rpath-loader_path-dlopen\00"
@.str.1 = [29 x i8] c"rpath-loader_path-dlopen: %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @PASS(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %9
6: ; preds = %0
%7 = call i32 (...) @dlerror()
%8 = call i32 @FAIL(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %4
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [25 x i8] c"rpath-loader_path-dlopen\00"
@.str.1 = [29 x i8] c"rpath-loader_path-dlopen: %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @PASS(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i32 (...) @dlerror()
%7 = tail call i32 @FAIL(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %3
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
/* Variables and functions */
char toupper(char);
char *strupper(char *src) {
  char *c;
  for (c = src; *c; c++) {
    *c = toupper(*c);
  }
  return src;
}


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

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

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

LLVM IR (-O2):
define i8* @strupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(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
ret i8* %0
}
void slow() {
  int i;
  long a;
  for (i = 1; i < 100000; i++)
    a = 200 * 4000 / 23;
}


x86 assembly (clang, -O0):
<slow>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jge    112e <slow+0x2e>
movq   $0x87de,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <slow+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @slow() {
%1 = alloca i32
%2 = alloca i64
store i32 1, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100000
br i1 %5, label %6, label %10
6: ; preds = %3
store i64 34782, i64* %2
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @slow() {
ret void
}
void path_020_expected_6(int a, int b) {
  if (a > 10) {
    while (a) {
      if (b == 1) {
        continue;
      }
      if (b == 2) {
        break;
      }
      return;
    }
  }
}


x86 assembly (clang, -O0):
<path_020_expected_6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    114b <path_020_expected_6+0x4b>
jmp    1119 <path_020_expected_6+0x19>
cmpl   $0x0,-0x4(%rbp)
je     1146 <path_020_expected_6+0x46>
cmpl   $0x1,-0x8(%rbp)
jne    1132 <path_020_expected_6+0x32>
jmp    1119 <path_020_expected_6+0x19>
cmpl   $0x2,-0x8(%rbp)
jne    1141 <path_020_expected_6+0x41>
jmp    1146 <path_020_expected_6+0x46>
jmp    114b <path_020_expected_6+0x4b>
jmp    114b <path_020_expected_6+0x4b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_020_expected_6>:
cmp    $0xb,%edi
jl     1112 <path_020_expected_6+0x12>
cmp    $0x1,%esi
jne    1112 <path_020_expected_6+0x12>
nopw   0x0(%rax,%rax,1)
jmp    1110 <path_020_expected_6+0x10>
ret

LLVM IR (-O0):
define void @path_020_expected_6(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, 10
br i1 %6, label %7, label %21
7: ; preds = %2
br label %8
8: ; preds = %14, %7
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %11
br label %8
15: ; preds = %11
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %19
18: ; preds = %15
br label %20
19: ; preds = %15
br label %21
20: ; preds = %18, %8
br label %21
21: ; preds = %19, %20, %2
ret void
}

LLVM IR (-O2):
define void @path_020_expected_6(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 10
%4 = icmp eq i32 %1, 1
%5 = and i1 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2, %6
br label %6
7: ; preds = %2
ret void
}
/* Variables and functions */
int copy_file_range(int /*<<< orphan*/, int /*<<< orphan*/ *,
                    int /*<<< orphan*/, int /*<<< orphan*/ *, int,
                    int /*<<< orphan*/);
int main(void) { return copy_file_range(0, NULL, 0, NULL, 1024, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x400,%r8d
mov    %r9d,%edi
mov    %rcx,%rsi
mov    %r9d,%edx
call   1030 <copy_file_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x400,%r8d
xor    %r9d,%r9d
jmp    1030 <copy_file_range@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @copy_file_range(i32 0, i32* null, i32 0, i32* null, i32 1024, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_error_algorithm_type() {
  printf("O nome do algoritmo pare estar errado.\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"O nome do algoritmo pare estar errado.\0A\00"
define void @show_error_algorithm_type() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"O nome do algoritmo pare estar errado.\00"
define void @show_error_algorithm_type() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double fmod(double, double);
double normrad(double r) {
  r = fmod(r, 6.28318530717958647693);
  if (r < 0)
    r += 6.28318530717958647693;
  return r;
}


x86 assembly (clang, -O0):
<normrad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1154 <normrad+0x44>
movsd  0xeb6(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normrad>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xeda(%rip),%xmm3
addsd  %xmm0,%xmm3
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm3
andnpd %xmm0,%xmm1
orpd   %xmm3,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @normrad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @fmod(double %3, double 0x401921FB54442D18)
store double %4, double* %2
%5 = load double, double* %2
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fadd double %8, 0x401921FB54442D18
store double %9, double* %2
br label %10
10: ; preds = %7, %1
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @normrad(double %0) {
%2 = tail call double @fmod(double %0, double 0x401921FB54442D18)
%3 = fcmp olt double %2, 0.000000e+00
%4 = fadd double %2, 0x401921FB54442D18
%5 = select i1 %3, double %4, double %2
ret double %5
}