xunge/DecIR huggingface dataset:
/* Variables and functions */
int fatorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Informe o numero a ser calculado: ");
  scanf("%d", &num);
  printf("O fatorial da %d eh %d!\n", num, fatorial(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fatorial@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
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),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <fatorial@plt>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Informe o numero a ser calculado: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"O fatorial da %d eh %d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @fatorial(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Informe o numero a ser calculado: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"O fatorial da %d eh %d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fatorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printHelp() {
  printf("Usage: fm_app [ OPTIONS ]\n");
  printf("  -v, --volume=level            Volume level (0-%d, default is %d)\n",
         100, 50);
}


x86 assembly (clang, -O0):
<printHelp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x64,%esi
mov    $0x32,%edx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHelp>:
push   %rax
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x64,%esi
mov    $0x32,%edx
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: fm_app [ OPTIONS ]\0A\00"
@.str.1 = [68 x i8] c" -v, --volume=level Volume level (0-%d, default is %d)\0A\00"
define void @printHelp() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 50)
ret void
}

LLVM IR (-O2):
@.str.1 = [68 x i8] c" -v, --volume=level Volume level (0-%d, default is %d)\0A\00"
@str = [26 x i8] c"Usage: fm_app [ OPTIONS ]\00"
define void @printHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 50)
ret void
}
int game_getQuorum() { return 2; }


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

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

LLVM IR (-O0):
define i32 @game_getQuorum() {
ret i32 2
}

LLVM IR (-O2):
define i32 @game_getQuorum() {
ret i32 2
}
/* Variables and functions */
double exp(double const);
double limitKe_upper(double const, double const *, int const);
double sqrt(double const);
double limitK_upper(const double x, const double P[], const int Porder) {
  double res = 1.;
  res = limitKe_upper(x, P, Porder);
  res /= exp(x);
  res /= sqrt(x);
  return (res);
}


x86 assembly (clang, -O0):
<limitK_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <limitKe_upper@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limitK_upper>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
call   1050 <limitKe_upper@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xorpd  %xmm0,%xmm0
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     117a <limitK_upper+0x4a>
sqrtsd %xmm0,%xmm0
jmp    117f <limitK_upper+0x4f>
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @limitK_upper(double %0, double* %1, i32 %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca i32
%7 = alloca double
store double %0, double* %4
store double* %1, double** %5
store i32 %2, i32* %6
store double 1.000000e+00, double* %7
%8 = load double, double* %4
%9 = load double*, double** %5
%10 = load i32, i32* %6
%11 = call double @limitKe_upper(double %8, double* %9, i32 %10)
store double %11, double* %7
%12 = load double, double* %4
%13 = call double @exp(double %12)
%14 = load double, double* %7
%15 = fdiv double %14, %13
store double %15, double* %7
%16 = load double, double* %4
%17 = call double @sqrt(double %16)
%18 = load double, double* %7
%19 = fdiv double %18, %17
store double %19, double* %7
%20 = load double, double* %7
ret double %20
}

LLVM IR (-O2):
define double @limitK_upper(double %0, double* %1, i32 %2) {
%4 = tail call double @limitKe_upper(double %0, double* %1, i32 %2)
%5 = tail call double @exp(double %0)
%6 = fdiv double %4, %5
%7 = tail call double @sqrt(double %0)
%8 = fdiv double %6, %7
ret double %8
}
double force2(double x, double y) { return (x == 0) ? 1.0 : 0.0; }


x86 assembly (clang, -O0):
<force2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpeqsd %xmm2,%xmm0
movaps %xmm0,%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<force2>:
xorpd  %xmm1,%xmm1
cmpeqsd %xmm1,%xmm0
movsd  0xeef(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @force2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp oeq double %5, 0.000000e+00
%7 = zext i1 %6 to i64
%8 = select i1 %6, double 1.000000e+00, double 0.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @force2(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double 0.000000e+00
ret double %4
}
/* Variables and functions */
int process_redir(char *);
char *strip_spaces(char *);
char *strsep(char **, char *);
int parse_input(char *input) {
  input = strsep(&input, "\n");
  char *cmd;
  int status;
  do {
    cmd = strsep(&input, ";");
    cmd = strip_spaces(cmd);
    status = process_redir(cmd);
  } while (input);
  return 0;
}


x86 assembly (clang, -O0):
<parse_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <strsep@plt>
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1050 <strsep@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strip_spaces@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <process_redir@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1150 <parse_input+0x20>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_input>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
lea    0xec1(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <strsep@plt>
mov    %rax,(%rsp)
lea    0xead(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strsep@plt>
mov    %rax,%rdi
call   1040 <strip_spaces@plt>
mov    %rax,%rdi
call   1030 <process_redir@plt>
cmpq   $0x0,(%rsp)
jne    1160 <parse_input+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c";\00"
define i32 @parse_input(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
br label %4
4: ; preds = %4, %1
%5 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i8* @strip_spaces(i8* %5)
%7 = call i32 @process_redir(i8* %6)
%8 = load i8*, i8** %2
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 0
}
int numberOfSevens(int num) {
  int total = 0;
  int remainder;
  while (num > 0) {
    remainder = num % 10;
    num /= 10;
    if (remainder == 7)
      total++;
  }
  return total;
}


x86 assembly (clang, -O0):
<numberOfSevens>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114c <numberOfSevens+0x4c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x7,-0xc(%rbp)
jne    1147 <numberOfSevens+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <numberOfSevens+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfSevens>:
xor    %eax,%eax
test   %edi,%edi
jle    1138 <numberOfSevens+0x38>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
imul   $0xcccccccd,%edi,%esi
add    $0x66666665,%esi
ror    %esi
cmp    $0x19999999,%esi
adc    $0x0,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <numberOfSevens+0x10>
ret

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

LLVM IR (-O2):
define i32 @numberOfSevens(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = urem i32 %4, 10
%7 = udiv i32 %4, 10
%8 = icmp eq i32 %6, 7
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %5, %9
%11 = icmp ult i32 %4, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int main(int argc, char **argv) {
  volatile uint8_t *var = (volatile uint8_t *)0x0000c010;
  *var = 0x0a;
  while (1) {
    usleep(1000 * 1000);
    *var = ~(*var);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xc010,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
mov    $0xf4240,%edi
call   1030 <usleep@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
xor    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1139 <main+0x29>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0xc010
nopl   0x0(%rax)
mov    $0xf4240,%edi
call   1030 <usleep@plt>
notl   0xc010
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* inttoptr (i64 49168 to i32*), i32** %6
%7 = load i32*, i32** %6
store volatile i32 10, i32* %7
br label %8
8: ; preds = %2, %8
%9 = call i32 @usleep(i32 1000000)
%10 = load i32*, i32** %6
%11 = load volatile i32, i32* %10
%12 = xor i32 %11, -1
%13 = load i32*, i32** %6
store volatile i32 %12, i32* %13
br label %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
store volatile i32 10, i32* inttoptr (i64 49168 to i32*)
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @usleep(i32 1000000)
%5 = load volatile i32, i32* inttoptr (i64 49168 to i32*)
%6 = xor i32 %5, -1
store volatile i32 %6, i32* inttoptr (i64 49168 to i32*)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
foo(int file) { assert(file == 10); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 10
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ AudioEvent_AddEventToBuffer(int, int, int);
void PSGPlay_Write(int Register, int Data) {
  AudioEvent_AddEventToBuffer(0x0001, Register, Data);
}


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

x86 assembly (clang, -O2):
<PSGPlay_Write>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <AudioEvent_AddEventToBuffer@plt>

LLVM IR (-O0):
define void @PSGPlay_Write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @AudioEvent_AddEventToBuffer(i32 1, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @PSGPlay_Write(i32 %0, i32 %1) {
%3 = tail call i32 @AudioEvent_AddEventToBuffer(i32 1, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test6();
int main(void) {
  test6();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test6()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int min_height;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_min_height(void *_p, int _v) {
  ((XSizeHints *)_p)->min_height = (int)_v;
}


x86 assembly (clang, -O0):
<set_XSizeHints_min_height>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XSizeHints_min_height>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XSizeHints_min_height(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XSizeHints_min_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
int isalnum_(char ch) { return isalnum(ch) || (ch == '_'); }


x86 assembly (clang, -O0):
<isalnum_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <isalnum_+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum_>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalnum_(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isalnum_(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned char inb(int port) {
  unsigned char value;
  asm volatile("inb %w1, %b0" : "=a"(value) : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i32 %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int);
int main() {
  int val;
  scanf("%d", val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
int liquid_autotest_same_data(unsigned char *_x, unsigned char *_y,
                              unsigned int _n) {
  unsigned int i;
  for (i = 0; i < _n; i++) {
    if (_x[i] != _y[i])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<liquid_autotest_same_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    115f <liquid_autotest_same_data+0x5f>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%edx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114c <liquid_autotest_same_data+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1166 <liquid_autotest_same_data+0x66>
jmp    1151 <liquid_autotest_same_data+0x51>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <liquid_autotest_same_data+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<liquid_autotest_same_data>:
mov    $0x1,%eax
test   %edx,%edx
je     1122 <liquid_autotest_same_data+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <liquid_autotest_same_data+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <liquid_autotest_same_data+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @liquid_autotest_same_data(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ _PC_PATH_MAX;
int pathconf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int pathLength() {
  int result;
  if ((result = pathconf("/", _PC_PATH_MAX)) != -1) {
    printf("_PC_PATH_MAX is %d\n", result);
    return result;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <pathconf@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     1163 <pathLength+0x43>
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <pathLength+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathLength>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <pathconf@plt>
cmp    $0xffffffff,%eax
je     114d <pathLength+0x2d>
mov    %eax,%ebx
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    114f <pathLength+0x2f>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@_PC_PATH_MAX = global i32 0
@.str.1 = [20 x i8] c"_PC_PATH_MAX is %d\0A\00"
define i32 @pathLength() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @_PC_PATH_MAX
%4 = call i32 @pathconf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@_PC_PATH_MAX = global i32 0
@.str.1 = [20 x i8] c"_PC_PATH_MAX is %d\0A\00"
define i32 @pathLength() {
%1 = load i32, i32* @_PC_PATH_MAX
%2 = tail call i32 @pathconf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ %2, %4 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ MsgBoxW24(short const *, short const *);
void msgboxw(const short int *s, const short int *title) {
  MsgBoxW24(s, title);
}


x86 assembly (clang, -O0):
<msgboxw>:
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 <MsgBoxW24@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgboxw>:
jmp    1030 <MsgBoxW24@plt>

LLVM IR (-O0):
define void @msgboxw(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = load i16*, i16** %4
%7 = call i32 @MsgBoxW24(i16* %5, i16* %6)
ret void
}

LLVM IR (-O2):
define void @msgboxw(i16* %0, i16* %1) {
%3 = tail call i32 @MsgBoxW24(i16* %0, i16* %1)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
char *strrchr(char const *, char);
int valid(const char *filename) {
  const char *end;
  end = strrchr(filename, '.');
  return end != NULL && strcmp(end + 1, "vvtb") == 0;
}


x86 assembly (clang, -O0):
<valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     116c <valid+0x4c>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
lea    0xea3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1150 <valid+0x30>
add    $0x1,%rax
lea    0xec5(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"vvtb\00"
define i32 @valid(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 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br label %13
13: ; preds = %8, %1
%14 = phi i1 [ false, %1 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"vvtb\00"
define i32 @valid(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
long int nth_fibonacci_number(unsigned int n) {
  if (n == 0) {
    return 0;
  }
  if (n <= 2) {
    return 1;
  }
  return nth_fibonacci_number(n - 1) + nth_fibonacci_number(n - 2);
}


x86 assembly (clang, -O0):
<nth_fibonacci_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1132 <nth_fibonacci_number+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1171 <nth_fibonacci_number+0x61>
cmpl   $0x2,-0xc(%rbp)
ja     1149 <nth_fibonacci_number+0x39>
movq   $0x1,-0x8(%rbp)
jmp    1171 <nth_fibonacci_number+0x61>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <nth_fibonacci_number@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <nth_fibonacci_number@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_fibonacci_number>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1149 <nth_fibonacci_number+0x39>
mov    %edi,%ebx
mov    $0x1,%r14d
cmp    $0x3,%edi
jb     114c <nth_fibonacci_number+0x3c>
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <nth_fibonacci_number@plt>
add    $0xfffffffe,%ebx
add    %rax,%r14
cmp    $0x2,%ebx
ja     1130 <nth_fibonacci_number+0x20>
add    $0x1,%r14
jmp    114c <nth_fibonacci_number+0x3c>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @nth_fibonacci_number(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 3
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = phi i32 [ %10, %5 ], [ %0, %3 ]
%8 = add i32 %7, -1
%9 = tail call i64 @nth_fibonacci_number(i32 %8)
%10 = add i32 %7, -2
%11 = add nsw i64 %9, %6
%12 = icmp ult i32 %10, 3
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = add i64 %11, 1
br label %15
15: ; preds = %3, %13, %1
%16 = phi i64 [ 0, %1 ], [ %14, %13 ], [ 1, %3 ]
ret i64 %16
}
OP(ed, ca) { illegal_2(); }


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

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ flushmmucache_cr3();
void mmu_invalidate(uint32_t addr) { flushmmucache_cr3(); }


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

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

LLVM IR (-O0):
define void @mmu_invalidate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @flushmmucache_cr3()
ret void
}

LLVM IR (-O2):
define void @mmu_invalidate(i32 %0) {
%2 = tail call i32 (...) @flushmmucache_cr3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blink();
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ uart_puts(char *);
void main(void) {
  uart_init();
  uart_puts("\n");
  uart_puts("Eat more fish!\n");
  blink();
  uart_puts(" .. Spinning\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uart_init@plt>
lea    0xecc(%rip),%rdi
call   1050 <uart_puts@plt>
lea    0xeb2(%rip),%rdi
call   1050 <uart_puts@plt>
mov    $0x0,%al
call   1040 <blink@plt>
lea    0xeaf(%rip),%rdi
call   1050 <uart_puts@plt>
jmp    1166 <main+0x36>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <uart_init@plt>
lea    0xecf(%rip),%rdi
call   1050 <uart_puts@plt>
lea    0xeb5(%rip),%rdi
call   1050 <uart_puts@plt>
xor    %eax,%eax
call   1040 <blink@plt>
lea    0xeb2(%rip),%rdi
call   1050 <uart_puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1170 <main+0x40>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [16 x i8] c"Eat more fish!\0A\00"
@.str.2 = [14 x i8] c" .. Spinning\0A\00"
define void @main() {
%1 = call i32 (...) @uart_init()
%2 = call i32 @uart_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @uart_puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @blink()
%5 = call i32 @uart_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %6, %0
br label %6
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [16 x i8] c"Eat more fish!\0A\00"
@.str.2 = [14 x i8] c" .. Spinning\0A\00"
define void @main() {
%1 = tail call i32 (...) @uart_init()
%2 = tail call i32 @uart_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @uart_puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @blink()
%5 = tail call i32 @uart_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %6, %0
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ htmlWarnEndPattern();
int /*<<< orphan*/ htmlWarnStartPattern();
char *qaStringBetween(char *, int /*<<< orphan*/, int /*<<< orphan*/);
char *qaScanForErrorMessage(char *text) {
  return qaStringBetween(text, htmlWarnStartPattern(), htmlWarnEndPattern());
}


x86 assembly (clang, -O0):
<qaScanForErrorMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <htmlWarnStartPattern@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <htmlWarnEndPattern@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1040 <qaStringBetween@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qaScanForErrorMessage>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <htmlWarnStartPattern@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <htmlWarnEndPattern@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <qaStringBetween@plt>

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

LLVM IR (-O2):
define i8* @qaScanForErrorMessage(i8* %0) {
%2 = tail call i32 (...) @htmlWarnStartPattern()
%3 = tail call i32 (...) @htmlWarnEndPattern()
%4 = tail call i8* @qaStringBetween(i8* %0, i32 %2, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ sprintf(char *, char *);
void _my_free(void **data) {
  char fail[256];
  if (((void *)0) == data || ((void *)0) == *data ||
      (unsigned long)-1 == (unsigned long)*data ||
      (unsigned long)-1 == (unsigned long)data) {
    sprintf(fail, "free: attempted to free NULL pointer.\n");
    ;
  }
  free(*data);
  *data = ((void *)0);
}


x86 assembly (clang, -O0):
<_my_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1175 <_my_free+0x55>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%rax
je     1175 <_my_free+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    $0xffffffffffffffff,%rax
cmp    %rcx,%rax
je     1175 <_my_free+0x55>
mov    -0x8(%rbp),%rcx
mov    $0xffffffffffffffff,%rax
cmp    %rcx,%rax
jne    1188 <_my_free+0x68>
lea    -0x110(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_my_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"free: attempted to free NULL pointer.\0A\00"
define void @_my_free(i8** %0) {
%2 = alloca i8**
%3 = alloca [256 x i8]
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = icmp eq i8** null, %4
br i1 %5, label %19, label %6
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = icmp eq i8* null, %8
br i1 %9, label %19, label %10
10: ; preds = %6
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = ptrtoint i8* %12 to i64
%14 = icmp eq i64 -1, %13
br i1 %14, label %19, label %15
15: ; preds = %10
%16 = load i8**, i8*** %2
%17 = ptrtoint i8** %16 to i64
%18 = icmp eq i64 -1, %17
br i1 %18, label %19, label %22
19: ; preds = %15, %10, %6, %1
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%21 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %19, %15
%23 = load i8**, i8*** %2
%24 = load i8*, i8** %23
%25 = call i32 @free(i8* %24)
%26 = load i8**, i8*** %2
store i8* null, i8** %26
ret void
}

LLVM IR (-O2):
define void @_my_free(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
float Q_powf(float x, int y) {
  float r = x;
  for (y--; y > 0; y--)
    r = r * r;
  return r;
}


x86 assembly (clang, -O0):
<Q_powf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1146 <Q_powf+0x46>
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <Q_powf+0x1f>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_powf>:
cmp    $0x2,%edi
jl     111c <Q_powf+0x1c>
add    $0x1,%edi
nopl   0x0(%rax,%rax,1)
mulss  %xmm0,%xmm0
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     1110 <Q_powf+0x10>
ret

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

LLVM IR (-O2):
define float @Q_powf(float %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi float [ %8, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = fmul float %5, %5
%9 = icmp ugt i32 %6, 2
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi float [ %0, %2 ], [ %8, %4 ]
ret float %11
}
void __putchar(const char c) {}


x86 assembly (clang, -O0):
<__putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__putchar(i8 signext %0) {
ret void
}
void gp_exit(int exit_status, int code) {}


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

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

LLVM IR (-O0):
define void @gp_exit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @gp_exit(i32 %0, i32 %1) {
ret void
}
int main(void) {
  int i;
  i = atoi("2593");
  printf("%s%d\n%s%d\n", "The string \"2593\" converted to int is ", i,
         "The converted value minus 593 is ", i - 593);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%r8d
sub    $0x251,%r8d
lea    0xeb0(%rip),%rdi
lea    0xeb4(%rip),%rsi
lea    0xed4(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <atoi@plt>
lea    -0x251(%rax),%r8d
lea    0xec8(%rip),%rdi
lea    0xecc(%rip),%rsi
lea    0xeec(%rip),%rcx
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"2593\00"
@.str.1 = [11 x i8] c"%s%d\0A%s%d\0A\00"
@.str.2 = [39 x i8] c"The string \222593\22 converted to int is \00"
@.str.3 = [34 x i8] c"The converted value minus 593 is \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 593
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"2593\00"
@.str.1 = [11 x i8] c"%s%d\0A%s%d\0A\00"
@.str.2 = [39 x i8] c"The string \222593\22 converted to int is \00"
@.str.3 = [34 x i8] c"The converted value minus 593 is \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = add nsw i32 %1, -593
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
long conv_8859_1_to_uni_(const uint8_t *const in, const size_t in_bytes,
                         uint32_t *cp) {
  assert(in_bytes > 0);
  *cp = *in;
  return 1;
}


x86 assembly (clang, -O0):
<conv_8859_1_to_uni_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_8859_1_to_uni_>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
mov    %eax,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @conv_8859_1_to_uni_(i32* %0, i64 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32*
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i64, i64* %5
%8 = icmp ugt i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
store i32 %12, i32* %13
ret i64 1
}

LLVM IR (-O2):
define i64 @conv_8859_1_to_uni_(i32* nocapture %0, i64 %1, i32* nocapture writeonly %2) {
%4 = icmp ne i64 %1, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* %0
store i32 %7, i32* %2
ret i64 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_stream(void const *p, void const *ctx) {
  (void)ctx;
  fclose((FILE *)p);
}


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

x86 assembly (clang, -O2):
<close_stream>:
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @close_stream(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 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
define void @close_stream(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @fclose(i32* %3)
ret void
}