xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
int quitaEspacios(FILE *fichero) {
  int caracter;
  while (isspace(caracter = fgetc(fichero)))
    ;
  return caracter;
}


x86 assembly (clang, -O0):
<quitaEspacios>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%edi
mov    %edi,-0xc(%rbp)
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     114e <quitaEspacios+0x2e>
jmp    112c <quitaEspacios+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quitaEspacios>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1130 <quitaEspacios+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @quitaEspacios(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %9, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
%7 = call i64 @isspace(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @quitaEspacios(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = tail call i64 @isspace(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int yywrap() { return true; }


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

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

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

LLVM IR (-O2):
define i32 @yywrap() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlockattr_t;

/* Variables and functions */
int ENOSYS;
int pthread_rwlockattr_init(pthread_rwlockattr_t *attr) { return -ENOSYS; }


x86 assembly (clang, -O0):
<pthread_rwlockattr_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_rwlockattr_init>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @pthread_rwlockattr_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_rwlockattr_init(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double randnum(const double min, const double max) {
  double temp = (double)rand() / (double)RAND_MAX;
  temp = min + (max - min) * temp;
  return temp;
}


x86 assembly (clang, -O0):
<randnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randnum>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm2
mov    0x2eb5(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randnum(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to double
%10 = fdiv double %7, %9
store double %10, double* %5
%11 = load double, double* %3
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fsub double %12, %13
%15 = load double, double* %5
%16 = call double @llvm.fmuladd.f64(double %14, double %15, double %11)
store double %16, double* %5
%17 = load double, double* %5
ret double %17
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randnum(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
%8 = fsub double %1, %0
%9 = tail call double @llvm.fmuladd.f64(double %8, double %7, double %0)
ret double %9
}
char *hash_plugin_detailed(void) {
  return ("androidfde - Android Full Disk Encryption plugin\n"
          "------------------------------------------------\n"
          "Use this module to crack Android encrypted partitions\n"
          "Input should be a encrypted device file specified with -f\n"
          "Known software that uses this password hashing method:\n"
          "Android\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


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

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

LLVM IR (-O0):
@.str = [319 x i8] c"androidfde - Android Full Disk Encryption plugin\0A------------------------------------------------\0AUse this module to crack Android encrypted partitions\0AInput should be a encrypted device file specified with -f\0AKnown software that uses this password hashing method:\0AAndroid\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([319 x i8], [319 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [319 x i8] c"androidfde - Android Full Disk Encryption plugin\0A------------------------------------------------\0AUse this module to crack Android encrypted partitions\0AInput should be a encrypted device file specified with -f\0AKnown software that uses this password hashing method:\0AAndroid\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([319 x i8], [319 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int recebe_num(int i) {
  int n;
  printf("Informe a posicao %d: ", i);
  scanf("%d", &n);
  return n;
}


x86 assembly (clang, -O0):
<recebe_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recebe_num>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"Informe a posicao %d: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @recebe_num(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) { printf("build-resize image width height\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"build-resize image width height\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"build-resize image width height\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ google_map_output_heading_close(int /*<<< orphan*/ *);
void google_map_station_output_head_close(FILE *output_file) {
  google_map_output_heading_close(output_file);
}


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

x86 assembly (clang, -O2):
<google_map_station_output_head_close>:
jmp    1030 <google_map_output_heading_close@plt>

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

LLVM IR (-O2):
define void @google_map_station_output_head_close(i32* %0) {
%2 = tail call i32 @google_map_output_heading_close(i32* %0)
ret void
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ listen(int, int);
scalar_t__ read(int, char *, int);
int main(void) {
  struct sockaddr_in6 tcp;
  int sock = 0, slen;
  listen(sock, 1);
  sock = accept(sock, (struct sockaddr *)&tcp, &slen);
  char c;
  while (read(sock, &c, 1)) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1040 <listen@plt>
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <accept@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
je     1186 <main+0x56>
jmp    1166 <main+0x36>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <listen@plt>
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
xor    %edi,%edi
call   1050 <accept@plt>
mov    %eax,%ebx
lea    0xf(%rsp),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sockaddr_in6
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @listen(i32 %6, i32 1)
%8 = load i32, i32* %3
%9 = bitcast %struct.sockaddr_in6* %2 to %struct.sockaddr*
%10 = call i32 @accept(i32 %8, %struct.sockaddr* %9, i32* %4)
store i32 %10, i32* %3
br label %11
11: ; preds = %15, %0
%12 = load i32, i32* %3
%13 = call i64 @read(i32 %12, i8* %5, i32 1)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
br label %11
16: ; preds = %11
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @main() {
%1 = alloca %struct.sockaddr_in6
%2 = alloca i32
%3 = alloca i8
%4 = bitcast %struct.sockaddr_in6* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 @listen(i32 0, i32 1)
%7 = bitcast %struct.sockaddr_in6* %1 to %struct.sockaddr*
%8 = call i32 @accept(i32 0, %struct.sockaddr* %7, i32* %2)
br label %9
9: ; preds = %9, %0
%10 = call i64 @read(i32 %8, i8* %3, i32 1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %9
12: ; preds = %9
ret i32 0
}
void sdb_init_ingres(void) { ; }


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

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

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

LLVM IR (-O2):
define void @sdb_init_ingres() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ old_fc_dl_sl_save(void *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void old_fc_dl_sl_print(void *s, int nproc) { old_fc_dl_sl_save(s, stdout); }


x86 assembly (clang, -O0):
<old_fc_dl_sl_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
call   1030 <old_fc_dl_sl_save@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<old_fc_dl_sl_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <old_fc_dl_sl_save@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @old_fc_dl_sl_print(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @old_fc_dl_sl_save(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void apagaLinha(void) {
  printf("\n%c[%d;%df", 0x1B, 15, 01);
  printf("                                                                     "
         "           ");
  printf("%c[%d;%dm%c[%dm", 27, 40, 31, 27, 0);
  printf("\n%c[%d;%df", 0x1B, 15, 01);
}


x86 assembly (clang, -O0):
<apagaLinha>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1b,%esi
mov    $0xf,%edx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
mov    $0x1b,%r8d
mov    $0x28,%edx
mov    $0x1f,%ecx
xor    %r9d,%r9d
mov    %r8d,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
mov    $0x1b,%esi
mov    $0xf,%edx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apagaLinha>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1b,%esi
mov    $0xf,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
mov    $0x1b,%esi
mov    $0x28,%edx
mov    $0x1f,%ecx
mov    $0x1b,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1b,%esi
mov    $0xf,%edx
mov    $0x1,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0A%c[%d;%df\00"
@.str.1 = [81 x i8] c" \00"
@.str.2 = [16 x i8] c"%c[%d;%dm%c[%dm\00"
define void @apagaLinha() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i32 15, i32 1)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 27, i32 40, i32 31, i32 27, i32 0)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i32 15, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0A%c[%d;%df\00"
@.str.1 = [81 x i8] c" \00"
@.str.2 = [16 x i8] c"%c[%d;%dm%c[%dm\00"
define void @apagaLinha() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i32 15, i32 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 27, i32 40, i32 31, i32 27, i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i32 15, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nrf_write(int, unsigned char *, int);
void __attribute__((unused)) nrf_set_status(unsigned char status) {
  nrf_write(0x20 | 0x07, &status, 1);
}


x86 assembly (clang, -O0):
<nrf_set_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x27,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <nrf_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_set_status>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x27,%edi
mov    $0x1,%edx
call   1030 <nrf_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @nrf_set_status(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @nrf_write(i32 39, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @nrf_set_status(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @nrf_write(i32 39, i8* %2, i32 1)
ret void
}
void _program() { printf("Exception: %s\n", __FUNCTION__); }


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

x86 assembly (clang, -O2):
<_program>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._program = [9 x i8] c"_program\00"
define void @_program() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__._program, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._program = [9 x i8] c"_program\00"
define void @_program() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__._program, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glutSolidTeapot(double);
void drawSTeapot(void) {
  glColor3f(0.5, 0.5, 0.0);
  glutSolidTeapot(3.80);
}


x86 assembly (clang, -O0):
<drawSTeapot>:
push   %rbp
mov    %rsp,%rbp
movsd  0xedc(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1040 <glColor3f@plt>
movsd  0xec1(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSTeapot>:
push   %rax
movsd  0xed7(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
call   1040 <glColor3f@plt>
movsd  0xecc(%rip),%xmm0
pop    %rax
jmp    1030 <glutSolidTeapot@plt>

LLVM IR (-O0):
define void @drawSTeapot() {
%1 = call i32 @glColor3f(double 5.000000e-01, double 5.000000e-01, double 0.000000e+00)
%2 = call i32 @glutSolidTeapot(double 3.800000e+00)
ret void
}

LLVM IR (-O2):
define void @drawSTeapot() {
%1 = tail call i32 @glColor3f(double 5.000000e-01, double 5.000000e-01, double 0.000000e+00)
%2 = tail call i32 @glutSolidTeapot(double 3.800000e+00)
ret void
}
int any_MSB_zero(unsigned x) {
  int msb_mask = 0xFF << (sizeof(int) - 1 << 3);
  return !!(~x & msb_mask);
}


x86 assembly (clang, -O0):
<any_MSB_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xff000000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_MSB_zero>:
xor    %eax,%eax
cmp    $0xff000000,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @any_MSB_zero(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -16777216, i32* %3
%4 = load i32, i32* %2
%5 = xor i32 %4, -1
%6 = load i32, i32* %3
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @any_MSB_zero(i32 %0) {
%2 = icmp ult i32 %0, -16777216
%3 = zext i1 %2 to i32
ret i32 %3
}
int DestroyMat(int **A, int size) {
  int i;
  for (i = 0; i < size; ++i) {
    free(A[i]);
  }
  free(A);
  return 0;
}


x86 assembly (clang, -O0):
<DestroyMat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <DestroyMat+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <DestroyMat+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DestroyMat>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <DestroyMat+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <DestroyMat+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @DestroyMat(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void error_msg(char *msg) {
  printf(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_msg>:
push   %rax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error_msg(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void smclock_destroy(struct smclock *clock __attribute__((unused))) {}


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

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

LLVM IR (-O0):
%struct.smclock = type opaque
define void @smclock_destroy(%struct.smclock* %0) {
%2 = alloca %struct.smclock*
store %struct.smclock* %0, %struct.smclock** %2
ret void
}

LLVM IR (-O2):
%struct.smclock = type opaque
define void @smclock_destroy(%struct.smclock* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroyHistory(char **commands, unsigned long size) {
  for (unsigned long i = 0; i < size; i++)
    free(commands[i]);
}


x86 assembly (clang, -O0):
<destroyHistory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <destroyHistory+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <destroyHistory+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyHistory>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1142 <destroyHistory+0x32>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <destroyHistory+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @destroyHistory(i8** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i32 @free(i8* %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ia_unsetbit16(uint16_t word, int i) { return word & ~(1 << i); }


x86 assembly (clang, -O0):
<ia_unsetbit16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ia_unsetbit16(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ia_unsetbit16(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
void delay_cache(int n) {
  int i;
  for (i = 0; i < n; i++)
    ;
}


x86 assembly (clang, -O0):
<delay_cache>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <delay_cache+0x2d>
jmp    111f <delay_cache+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay_cache+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay_cache(i32 %0) {
ret void
}
double GetWindageMOA(double *sln, int yardage) {
  double size = sln[50001 * 10 + 1];
  if (yardage < size) {
    return sln[10 * yardage + 5];
  } else
    return 0;
}


x86 assembly (clang, -O0):
<GetWindageMOA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x3d0958(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114d <GetWindageMOA+0x4d>
mov    -0x10(%rbp),%rax
imul   $0xa,-0x14(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <GetWindageMOA+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetWindageMOA>:
cvtsi2sd %esi,%xmm1
movsd  0x3d0958(%rdi),%xmm2
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm2
jbe    1122 <GetWindageMOA+0x22>
add    %esi,%esi
lea    (%rsi,%rsi,4),%eax
cltq
movsd  0x28(%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @GetWindageMOA(double* %0, i32 %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 500011
%9 = load double, double* %8
store double %9, double* %6
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = load double, double* %6
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %22
14: ; preds = %2
%15 = load double*, double** %4
%16 = load i32, i32* %5
%17 = mul nsw i32 10, %16
%18 = add nsw i32 %17, 5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %15, i64 %19
%21 = load double, double* %20
store double %21, double* %3
br label %23
22: ; preds = %2
store double 0.000000e+00, double* %3
br label %23
23: ; preds = %22, %14
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @GetWindageMOA(double* nocapture %0, i32 %1) {
%3 = getelementptr inbounds double, double* %0, i64 500011
%4 = load double, double* %3
%5 = sitofp i32 %1 to double
%6 = fcmp ogt double %4, %5
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = mul nsw i32 %1, 10
%9 = add nsw i32 %8, 5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %0, i64 %10
%12 = load double, double* %11
br label %13
13: ; preds = %2, %7
%14 = phi double [ %12, %7 ], [ 0.000000e+00, %2 ]
ret double %14
}
void autonomous8() {}


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

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

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

LLVM IR (-O2):
define void @autonomous8() {
ret void
}
/* Variables and functions */
int f(int);
int main(void) { return f(1); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void midi_mem_free(void *ptr, const char *file, int line) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<midi_mem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <midi_mem_free+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midi_mem_free>:
test   %rdi,%rdi
je     111a <midi_mem_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @midi_mem_free(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @midi_mem_free(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
int mdp_ppp_load_blur(struct mdp_info *mdp) { return 0; }


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

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

LLVM IR (-O0):
%struct.mdp_info = type opaque
define i32 @mdp_ppp_load_blur(%struct.mdp_info* %0) {
%2 = alloca %struct.mdp_info*
store %struct.mdp_info* %0, %struct.mdp_info** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mdp_info = type opaque
define i32 @mdp_ppp_load_blur(%struct.mdp_info* nocapture readnone %0) {
ret i32 0
}
void av_int_list_length_for_size() {}


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

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

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

LLVM IR (-O2):
define void @av_int_list_length_for_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __semi_call(int, uintptr_t);
int main(int argc, char *argv[argc]) {
  uintptr_t exit_block[2] = {0x20026, 0};
  uintptr_t exit_code = (uintptr_t)&exit_block;
  __semi_call(0x04, (uintptr_t) "Hello World");
  __semi_call(0x18, exit_code);
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x4,%edi
lea    0xec0(%rip),%rsi
call   1030 <__semi_call@plt>
mov    -0x28(%rbp),%rsi
mov    $0x18,%edi
call   1030 <__semi_call@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeea(%rip),%rsi
mov    $0x4,%edi
call   1030 <__semi_call@plt>
mov    %rsp,%rsi
mov    $0x18,%edi
call   1030 <__semi_call@plt>
mov    $0xffffffff,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.exit_block = [2 x i64] [i64 131110, i64 0]
@.str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i64]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = bitcast [2 x i64]* %6 to i8*
%11 = ptrtoint [2 x i64]* %6 to i64
store i64 %11, i64* %7
%12 = call i32 @__semi_call(i32 4, i64 ptrtoint ([12 x i8]* @.str to i64))
%13 = load i64, i64* %7
%14 = call i32 @__semi_call(i32 24, i64 %13)
ret i32 -1
}

LLVM IR (-O2):
@__const.main.exit_block = [2 x i64] [i64 131110, i64 0]
@.str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i64]
%4 = bitcast [2 x i64]* %3 to i8*
%5 = ptrtoint [2 x i64]* %3 to i64
%6 = call i32 @__semi_call(i32 4, i64 ptrtoint ([12 x i8]* @.str to i64))
%7 = call i32 @__semi_call(i32 24, i64 %5)
ret i32 -1
}
char *XKeysymToString() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @XKeysymToString() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int sleepMs(int x) {
  usleep(x * 1000);
  return 0;
}


x86 assembly (clang, -O0):
<sleepMs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepMs>:
push   %rax
imul   $0x3e8,%edi,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sleepMs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @sleepMs(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ what;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void put8(char *where, uint8_t what) { memcpy(where, &what, sizeof(what)); }


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

x86 assembly (clang, -O2):
<put8>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @put8(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
size_t backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, size_t, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void cause_bt() {
  void *frames[20];
  size_t size = 0;
  size = backtrace(frames, 20);
  fprintf(stderr, "Backtrace:");
  backtrace_symbols_fd(frames, size, 2);
}


x86 assembly (clang, -O0):
<cause_bt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movq   $0x0,-0xa8(%rbp)
lea    -0xa0(%rbp),%rdi
mov    $0x14,%esi
call   1040 <backtrace@plt>
mov    %rax,-0xa8(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0xa8(%rbp),%rsi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cause_bt>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x14,%esi
call   1040 <backtrace@plt>
mov    %rax,%rbx
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1050 <fprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Backtrace:\00"
define void @cause_bt() {
%1 = alloca [20 x i8*]
%2 = alloca i64
store i64 0, i64* %2
%3 = getelementptr inbounds [20 x i8*], [20 x i8*]* %1, i64 0, i64 0
%4 = call i64 @backtrace(i8** %3, i32 20)
store i64 %4, i64* %2
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [20 x i8*], [20 x i8*]* %1, i64 0, i64 0
%8 = load i64, i64* %2
%9 = call i32 @backtrace_symbols_fd(i8** %7, i64 %8, i32 2)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Backtrace:\00"
define void @cause_bt() {
%1 = alloca [20 x i8*]
%2 = bitcast [20 x i8*]* %1 to i8*
%3 = getelementptr inbounds [20 x i8*], [20 x i8*]* %1, i64 0, i64 0
%4 = call i64 @backtrace(i8** %3, i32 20)
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @backtrace_symbols_fd(i8** %3, i64 %4, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int const, int /*<<< orphan*/ *);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int readDouble(FILE *fr, char *line, const int maxLineLength, double *target) {
  if (!fgets(line, maxLineLength, fr)) {
    return 0;
  }
  sscanf(line, "%lf", target);
  return 1;
}


x86 assembly (clang, -O0):
<readDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%eax
jne    115c <readDouble+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1177 <readDouble+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1040 <sscanf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readDouble>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <fgets@plt>
test   %eax,%eax
je     1157 <readDouble+0x37>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <sscanf@plt>
mov    $0x1,%eax
jmp    1159 <readDouble+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @readDouble(i32* nocapture %0, i8* %1, i32 %2, double* %3) {
%5 = tail call i32 @fgets(i8* %1, i32 %2, i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 1, %7 ], [ 0, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
unsigned char *sqlite3_column_text(int /*<<< orphan*/ *, int);
char *strdup(char const *);
char *sqlite3_column_string(sqlite3_stmt *stmt, int n) {
  const unsigned char *value = sqlite3_column_text(stmt, n);
  return value == NULL ? NULL : strdup((const char *)value);
}


x86 assembly (clang, -O0):
<sqlite3_column_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sqlite3_column_text@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <sqlite3_column_string+0x35>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1162 <sqlite3_column_string+0x42>
mov    -0x18(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3_column_string>:
push   %rax
call   1030 <sqlite3_column_text@plt>
test   %rax,%rax
je     1134 <sqlite3_column_string+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sqlite3_column_string(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i8* @sqlite3_column_text(i32* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
br label %15
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = call i8* @strdup(i8* %13)
br label %15
15: ; preds = %12, %11
%16 = phi i8* [ null, %11 ], [ %14, %12 ]
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @sqlite3_column_string(i32* %0, i32 %1) {
%3 = tail call i8* @sqlite3_column_text(i32* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @strdup(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
void swap(char *a, char *b) {
  char d = *a;
  *a = *b;
  *b = d;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
unsigned xrop3_181_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S | D;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_181_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_181_1_1>:
mov    %esi,%eax
or     %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_181_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %7
%39 = xor i32 %38, -1
%40 = and i32 %37, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = and i32 %41, %42
%44 = or i32 %40, %43
%45 = load i32, i32* %5
%46 = load i32, i32* %7
%47 = and i32 %45, %46
%48 = or i32 %44, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @xrop3_181_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = or i32 %8, %4
%10 = xor i32 %9, -256
ret i32 %10
}