xunge/DecIR huggingface dataset:
/* Variables and functions */
int addNonRecursive(int, int);
int addRecursive(int, int);
int /*<<< orphan*/ printf(char *, ...);
void interView03Test(void) {
  printf("%d\n", addNonRecursive(100, 212887));
  printf("----------\n");
  printf("%d\n", addRecursive(100, 212887));
}


x86 assembly (clang, -O0):
<interView03Test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
mov    $0x33f97,%esi
call   1050 <addNonRecursive@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x64,%edi
mov    $0x33f97,%esi
call   1040 <addRecursive@plt>
mov    %eax,%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interView03Test>:
push   %rbx
mov    $0x64,%edi
mov    $0x33f97,%esi
call   1060 <addNonRecursive@plt>
lea    0xea9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
mov    $0x33f97,%esi
call   1050 <addRecursive@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [12 x i8] c"----------\0A\00"
define void @interView03Test() {
%1 = call i32 @addNonRecursive(i32 100, i32 212887)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @addRecursive(i32 100, i32 212887)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@str = [11 x i8] c"----------\00"
define void @interView03Test() {
%1 = tail call i32 @addNonRecursive(i32 100, i32 212887)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @addRecursive(i32 100, i32 212887)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
double squareRoot(double num) {
  double error = 0.0000001;
  double x = num;
  while ((x - num / x) > error)
    x = (x + num / x) / 2;
  return (x);
}


x86 assembly (clang, -O0):
<squareRoot>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1167 <squareRoot+0x67>
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1120 <squareRoot+0x20>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<squareRoot>:
movapd %xmm0,%xmm2
divsd  %xmm0,%xmm2
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
ucomisd 0xee8(%rip),%xmm1
jbe    1152 <squareRoot+0x52>
movsd  0xee6(%rip),%xmm3
movsd  0xed6(%rip),%xmm4
movapd %xmm0,%xmm1
xchg   %ax,%ax
addsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
movapd %xmm1,%xmm5
subsd  %xmm2,%xmm5
ucomisd %xmm4,%xmm5
ja     1130 <squareRoot+0x30>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @squareRoot(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0x3E7AD7F29ABCAF48, double* %3
%5 = load double, double* %2
store double %5, double* %4
br label %6
6: ; preds = %14, %1
%7 = load double, double* %4
%8 = load double, double* %2
%9 = load double, double* %4
%10 = fdiv double %8, %9
%11 = fsub double %7, %10
%12 = load double, double* %3
%13 = fcmp ogt double %11, %12
br i1 %13, label %14, label %21
14: ; preds = %6
%15 = load double, double* %4
%16 = load double, double* %2
%17 = load double, double* %4
%18 = fdiv double %16, %17
%19 = fadd double %15, %18
%20 = fdiv double %19, 2.000000e+00
store double %20, double* %4
br label %6
21: ; preds = %6
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @squareRoot(double %0) {
%2 = fdiv double %0, %0
%3 = fsub double %0, %2
%4 = fcmp ogt double %3, 0x3E7AD7F29ABCAF48
br i1 %4, label %5, label %13
5: ; preds = %1, %5
%6 = phi double [ %10, %5 ], [ %2, %1 ]
%7 = phi double [ %9, %5 ], [ %0, %1 ]
%8 = fadd double %7, %6
%9 = fmul double %8, 5.000000e-01
%10 = fdiv double %0, %9
%11 = fsub double %9, %10
%12 = fcmp ogt double %11, 0x3E7AD7F29ABCAF48
br i1 %12, label %5, label %13
13: ; preds = %5, %1
%14 = phi double [ %0, %1 ], [ %9, %5 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ insertionSort(char *);
int strcmp(char *, char *);
int compareViaAnagram(char *str1, char *str2) {
  insertionSort(str1);
  insertionSort(str2);
  return strcmp(str1, str2);
}


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

x86 assembly (clang, -O2):
<compareViaAnagram>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <insertionSort@plt>
mov    %r14,%rdi
call   1040 <insertionSort@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compareViaAnagram(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 = call i32 @insertionSort(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @insertionSort(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcmp(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compareViaAnagram(i8* %0, i8* %1) {
%3 = tail call i32 @insertionSort(i8* %0)
%4 = tail call i32 @insertionSort(i8* %1)
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %5
}
/* Variables and functions */
const char *mbed_trace_exclude_filters_get(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @mbed_trace_exclude_filters_get() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mbed_trace_exclude_filters_get() {
ret i8* null
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ lstat(char *, struct stat *);
int dev_attr_filter(char *filename) {
  struct stat filestat;
  if (lstat(filename, &filestat))
    return 0;
  if (S_ISREG(filestat.st_mode))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<dev_attr_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <lstat@plt>
cmp    $0x0,%rax
je     114f <dev_attr_filter+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1174 <dev_attr_filter+0x54>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
je     116d <dev_attr_filter+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <dev_attr_filter+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_attr_filter>:
push   %rax
mov    %rsp,%rsi
call   1030 <lstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <dev_attr_filter+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dev_attr_filter(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int mayor(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main(void) {
  int a, b;
  printf("\nInserte dos números: ");
  scanf("\n%d", &a);
  scanf("\n%d", &b);
  printf("\n%d es mayor\n", mayor(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <mayor@plt>
mov    %eax,%esi
lea    0xea2(%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    0xece(%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 <mayor@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0AInserte dos n\C3\BAmeros: \00"
@.str.1 = [4 x i8] c"\0A%d\00"
@.str.2 = [14 x i8] c"\0A%d es mayor\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @mayor(i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0AInserte dos n\C3\BAmeros: \00"
@.str.1 = [4 x i8] c"\0A%d\00"
@.str.2 = [14 x i8] c"\0A%d es mayor\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @mayor(i32 %8, i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void memError(void) {
  fprintf(stderr, "Error, unable to allocate memory. Exiting.\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Error, unable to allocate memory. Exiting.\0A\00"
@EXIT_FAILURE = global i32 0
define void @memError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Error, unable to allocate memory. Exiting.\0A\00"
@EXIT_FAILURE = global i32 0
define void @memError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
double top(double *stack, int *pos) { return stack[*pos]; }


x86 assembly (clang, -O0):
<top>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<top>:
movslq (%rsi),%rax
movsd  (%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @top(double* %0, i32* %1) {
%3 = alloca double*
%4 = alloca i32*
store double* %0, double** %3
store i32* %1, i32** %4
%5 = load double*, double** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %5, i64 %8
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @top(double* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
ret double %6
}
int vde_chain_nm6_free(void *mem) {
  (void)mem;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @vde_chain_nm6_free(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(long *, int, int, int /*<<< orphan*/ *);
void fput_long(long val, FILE *file) { fwrite(&val, sizeof(long), 1, file); }


x86 assembly (clang, -O0):
<fput_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput_long>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @fput_long(i64 %0, i32* nocapture %1) {
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i32 @fwrite(i64* %3, i32 8, i32 1, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TAB_Fct(char);
void IF_TABSum(void) { TAB_Fct('+'); }


x86 assembly (clang, -O0):
<IF_TABSum>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1030 <TAB_Fct@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_TABSum>:
mov    $0x2b,%edi
jmp    1030 <TAB_Fct@plt>

LLVM IR (-O0):
define void @IF_TABSum() {
%1 = call i32 @TAB_Fct(i8 signext 43)
ret void
}

LLVM IR (-O2):
define void @IF_TABSum() {
%1 = tail call i32 @TAB_Fct(i8 signext 43)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strlen(char *);
scalar_t__ write(int, char *, int /*<<< orphan*/);
void write_player(int socket_descriptor, char *mesg) {
  if ((write(socket_descriptor, mesg, strlen(mesg))) <= 0) {
    perror("erreur : impossible d'ecrire le message destine au joueur.");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<write_player>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jg     1194 <write_player+0x54>
lea    0xe7b(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_player>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %rax,%rax
jle    1168 <write_player+0x28>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe91(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"erreur : impossible d'ecrire le message destine au joueur.\00"
define void @write_player(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @write(i32 %5, i8* %6, i32 %8)
%10 = icmp sle i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"erreur : impossible d'ecrire le message destine au joueur.\00"
define void @write_player(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @write(i32 %0, i8* %1, i32 %3)
%5 = icmp slt i64 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ file_short;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int write_short(FILE *file, short s) {
  unsigned char file_short[2];
  file_short[0] = (s & (unsigned)0xff00) >> 8;
  file_short[1] = s & 0xff;
  if (fwrite((char *)file_short, (int)sizeof(file_short), 1, file) != 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<write_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
mov    %al,-0x14(%rbp)
movswl -0x12(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x13(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     116a <write_short+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1171 <write_short+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_short>:
push   %rax
mov    %rdi,%rcx
rol    $0x8,%si
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_short(i32* %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i16
%6 = alloca [2 x i8]
store i32* %0, i32** %4
store i16 %1, i16* %5
%7 = load i16, i16* %5
%8 = sext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = lshr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
store i8 %11, i8* %12
%13 = load i16, i16* %5
%14 = sext i16 %13 to i32
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
store i8 %16, i8* %17
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%19 = load i32*, i32** %4
%20 = call i32 @fwrite(i8* %18, i32 2, i32 1, i32* %19)
%21 = icmp ne i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %2
store i32 0, i32* %3
br label %24
23: ; preds = %2
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @write_short(i32* nocapture %0, i16 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @fwrite(i8* %4, i32 2, i32 1, i32* %0)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int test_begin();
int /*<<< orphan*/ test_range();
int /*<<< orphan*/ test_updown();
int main(void) {
  int res;
  res = test_begin();
  test_updown();
  test_range();
  return res;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <test_begin@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <test_updown@plt>
xor    %eax,%eax
call   1040 <test_range@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @test_begin()
store i32 %3, i32* %2
%4 = call i32 (...) @test_updown()
%5 = call i32 (...) @test_range()
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_begin()
%2 = tail call i32 (...) @test_updown()
%3 = tail call i32 (...) @test_range()
ret i32 %1
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
scalar_t__ st_pop(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, int);
void equal(struct forth_instance *fi) { st_push(fi, st_pop(fi) == st_pop(fi)); }


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <st_pop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <st_pop@plt>
xor    %esi,%esi
cmp    %rax,%r14
sete   %sil
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @equal(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i64 @st_pop(%struct.forth_instance* %4)
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = call i64 @st_pop(%struct.forth_instance* %6)
%8 = icmp eq i64 %5, %7
%9 = zext i1 %8 to i32
%10 = call i32 @st_push(%struct.forth_instance* %3, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @equal(%struct.forth_instance* %0) {
%2 = tail call i64 @st_pop(%struct.forth_instance* %0)
%3 = tail call i64 @st_pop(%struct.forth_instance* %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @st_push(%struct.forth_instance* %0, i32 %5)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int lstat(char const *, struct stat *);
int /*<<< orphan*/ printf(char *, char const *);
off_t get_file_size(const char *file) {
  struct stat ss;
  printf("rename_before_close"
         ": stat(%s)\n",
         file);
  int ret = lstat(file, &ss);
  assert(ret == 0);
  return ss.st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <lstat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <lstat@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [31 x i8] c"rename_before_close: stat(%s)\0A\00"
define i32 @get_file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @lstat(i8* %7, %struct.stat* %3)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [31 x i8] c"rename_before_close: stat(%s)\0A\00"
define i32 @get_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @lstat(i8* %0, %struct.stat* %2)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
int SquareOfSum(int n) {
  long int result = 0;
  for (int i = 1; i <= n; i++) {
    result += i;
  }
  result *= result;
  return result;
}


x86 assembly (clang, -O0):
<SquareOfSum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113c <SquareOfSum+0x3c>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <SquareOfSum+0x16>
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SquareOfSum>:
test   %edi,%edi
jle    111d <SquareOfSum+0x1d>
lea    -0x1(%rdi),%eax
add    $0xfffffffe,%edi
imul   %rax,%rdi
shr    %rdi
lea    (%rdi,%rax,2),%rax
add    $0x1,%rax
imul   %eax,%eax
ret
xor    %eax,%eax
imul   %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @SquareOfSum(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i64
%6 = shl nuw nsw i64 %5, 1
%7 = zext i32 %4 to i64
%8 = add nsw i32 %0, -2
%9 = zext i32 %8 to i64
%10 = mul nuw nsw i64 %7, %9
%11 = lshr i64 %10, 1
%12 = add nuw nsw i64 %6, %11
%13 = add nuw nsw i64 %12, 1
br label %14
14: ; preds = %3, %1
%15 = phi i64 [ 0, %1 ], [ %13, %3 ]
%16 = mul nsw i64 %15, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xgraphicsexpose_x(void *_p, int _v) {
  ((XEvent *)_p)->xgraphicsexpose.x = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xgraphicsexpose_x>:
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_XEvent_xgraphicsexpose_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xgraphicsexpose_x(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_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xgraphicsexpose_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ benchmark();
int /*<<< orphan*/ initialise_board();
int /*<<< orphan*/ start_trigger();
int /*<<< orphan*/ stop_trigger();
int main(void) {
  int i;
  initialise_board();
  start_trigger();
  for (i = 0; i < (4096 >> 2); i++)
    benchmark();
  stop_trigger();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initialise_board@plt>
mov    $0x0,%al
call   1030 <start_trigger@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jge    1186 <main+0x46>
mov    $0x0,%al
call   1050 <benchmark@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1040 <stop_trigger@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <initialise_board@plt>
xor    %eax,%eax
call   1030 <start_trigger@plt>
mov    $0x400,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <benchmark@plt>
add    $0xffffffff,%ebx
jne    1160 <main+0x20>
xor    %eax,%eax
call   1040 <stop_trigger@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialise_board()
%2 = tail call i32 (...) @start_trigger()
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 (...) @benchmark()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 1024
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 (...) @stop_trigger()
ret i32 0
}
__typeof__(isalnum((void *)1)) test_isalnum_9(void) {
  return isalnum((void *)1);
}


x86 assembly (clang, -O0):
<test_isalnum_9>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
mov    %eax,%edi
call   1030 <isalnum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isalnum_9>:
mov    $0x1,%edi
jmp    1030 <isalnum@plt>

LLVM IR (-O0):
define i32 @test_isalnum_9() {
%1 = call i32 @isalnum(i32 ptrtoint (i8* inttoptr (i64 1 to i8*) to i32))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_isalnum_9() {
%1 = tail call i32 @isalnum(i32 1)
ret i32 %1
}
unsigned long long divmodk(unsigned long long num, unsigned long long den,
                           unsigned long long *rem_p) {
  unsigned long long quot = 0, qbit = 1;
  while ((unsigned long long)den >= 0) {
    den <<= 1;
    qbit <<= 1;
  }
  while (qbit) {
    if (den <= num) {
      num -= den;
      quot += qbit;
    }
    den >>= 1;
    qbit >>= 1;
  }
  if (rem_p)
    *rem_p = num;
  return quot;
}


x86 assembly (clang, -O0):
<divmodk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
jb     1148 <divmodk+0x48>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1120 <divmodk+0x20>
jmp    114d <divmodk+0x4d>
cmpq   $0x0,-0x28(%rbp)
je     119e <divmodk+0x9e>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
ja     1181 <divmodk+0x81>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    114d <divmodk+0x4d>
cmpq   $0x0,-0x18(%rbp)
je     11b4 <divmodk+0xb4>
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @divmodk(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
store i64 0, i64* %7
store i64 1, i64* %8
br label %9
9: ; preds = %12, %3
%10 = load i64, i64* %5
%11 = icmp uge i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i64, i64* %5
%14 = shl i64 %13, 1
store i64 %14, i64* %5
%15 = load i64, i64* %8
%16 = shl i64 %15, 1
store i64 %16, i64* %8
br label %9
17: ; preds = %9
br label %18
18: ; preds = %32, %17
%19 = load i64, i64* %8
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %37
21: ; preds = %18
%22 = load i64, i64* %5
%23 = load i64, i64* %4
%24 = icmp ule i64 %22, %23
br i1 %24, label %25, label %32
25: ; preds = %21
%26 = load i64, i64* %5
%27 = load i64, i64* %4
%28 = sub i64 %27, %26
store i64 %28, i64* %4
%29 = load i64, i64* %8
%30 = load i64, i64* %7
%31 = add i64 %30, %29
store i64 %31, i64* %7
br label %32
32: ; preds = %25, %21
%33 = load i64, i64* %5
%34 = lshr i64 %33, 1
store i64 %34, i64* %5
%35 = load i64, i64* %8
%36 = lshr i64 %35, 1
store i64 %36, i64* %8
br label %18
37: ; preds = %18
%38 = load i64*, i64** %6
%39 = icmp ne i64* %38, null
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i64, i64* %4
%42 = load i64*, i64** %6
store i64 %41, i64* %42
br label %43
43: ; preds = %40, %37
%44 = load i64, i64* %7
ret i64 %44
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Discover the joy of learning.\n");
  printf("Hiroshima Univ.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Discover the joy of learning.\0A\00"
@.str.1 = [17 x i8] c"Hiroshima Univ.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"Discover the joy of learning.\00"
@str.2 = [16 x i8] c"Hiroshima Univ.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void g() {
  int x[100];
  int i;
  for (i = 0; i < 100; i++)
    x[i] = 0;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x194(%rbp)
cmpl   $0x64,-0x194(%rbp)
jge    1148 <g+0x48>
movslq -0x194(%rbp),%rax
movl   $0x0,-0x190(%rbp,%rax,4)
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    1115 <g+0x15>
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g() {
%1 = alloca [100 x i32]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %8
store i32 0, i32* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @g() {
ret void
}
void inslash2rv_eol() {}


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

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

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

LLVM IR (-O2):
define void @inslash2rv_eol() {
ret void
}
/* Variables and functions */
int strlen(char *);
char *strrchr(char *, char);
char *get_extension(char *path) {
  char *ptr = strrchr(path, '.');
  if (ptr == NULL)
    return path + strlen(path);
  return ptr;
}


x86 assembly (clang, -O0):
<get_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <get_extension+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <get_extension+0x57>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_extension>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1135 <get_extension+0x15>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_extension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ %2, %1 ]
ret i8* %9
}
int int_size_is_32() {
  int msb_16 = 1 << 15;
  int msb_32 = 1 << 31;
  return msb_16 > 0 && msb_16 + msb_16 != 0 && msb_32 < 0 &&
         msb_32 + msb_32 == 0;
}


x86 assembly (clang, -O0):
<int_size_is_32>:
push   %rbp
mov    %rsp,%rbp
movl   $0x8000,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jle    1153 <int_size_is_32+0x53>
mov    -0x4(%rbp),%ecx
add    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1153 <int_size_is_32+0x53>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    1153 <int_size_is_32+0x53>
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_size_is_32() {
%1 = alloca i32
%2 = alloca i32
store i32 32768, i32* %1
store i32 -2147483648, i32* %2
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %0
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = add nsw i32 %6, %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = add nsw i32 %14, %15
%17 = icmp eq i32 %16, 0
br label %18
18: ; preds = %13, %10, %5, %0
%19 = phi i1 [ false, %10 ], [ false, %5 ], [ false, %0 ], [ %17, %13 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @int_size_is_32() {
ret i32 1
}
void val_delete_sts_list(void *v) { (void)v; }


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

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

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

LLVM IR (-O2):
define void @val_delete_sts_list(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
int main() {
  const char *p = "Hello, world!\n";
  for (; *p; p++)
    putchar(*p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <main+0x44>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112a <main+0x1a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x77,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 72)
%2 = tail call i32 @putchar(i8 signext 101)
%3 = tail call i32 @putchar(i8 signext 108)
%4 = tail call i32 @putchar(i8 signext 108)
%5 = tail call i32 @putchar(i8 signext 111)
%6 = tail call i32 @putchar(i8 signext 44)
%7 = tail call i32 @putchar(i8 signext 32)
%8 = tail call i32 @putchar(i8 signext 119)
%9 = tail call i32 @putchar(i8 signext 111)
%10 = tail call i32 @putchar(i8 signext 114)
%11 = tail call i32 @putchar(i8 signext 108)
%12 = tail call i32 @putchar(i8 signext 100)
%13 = tail call i32 @putchar(i8 signext 33)
%14 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int __infer_nondet_int();
int iscntrl(int x) { return __infer_nondet_int(); }


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

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

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

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void u32_to_le(unsigned char *x, const uint32_t u) {
  x[0] = (unsigned char)u;
  x[1] = (unsigned char)(u >> 8);
  x[2] = (unsigned char)(u >> 16);
  x[3] = (unsigned char)(u >> 24);
}


x86 assembly (clang, -O0):
<u32_to_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @u32_to_le(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 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 %16, i8* %18
%19 = load i32, i32* %4
%20 = ashr i32 %19, 24
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @u32_to_le(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}