xunge/DecIR huggingface dataset:
/* Variables and functions */
int _write_sysfs_int(char *, char *, int, int, int /*<<< orphan*/,
                     int /*<<< orphan*/);
int write_sysfs_int_and_verify(char *filename, char *basedir, int val) {
  return _write_sysfs_int(filename, basedir, val, 1, 0, 0);
}


x86 assembly (clang, -O0):
<write_sysfs_int_and_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <_write_sysfs_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sysfs_int_and_verify>:
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_write_sysfs_int@plt>

LLVM IR (-O0):
define i32 @write_sysfs_int_and_verify(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 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @_write_sysfs_int(i8* %7, i8* %8, i32 %9, i32 1, i32 0, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_sysfs_int_and_verify(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_write_sysfs_int(i8* %0, i8* %1, i32 %2, i32 1, i32 0, i32 0)
ret i32 %4
}
int test2(int b, int c, int d) { return (b ^ d) == (c ^ d); }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @test2(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ core7_print(char *, char *, char *, char const *);
void U_EMRSETVIEWPORTORGEX_print(const char *contents) {
  core7_print("U_EMRSETVIEWPORTORGEX", "ptlOrigin:", "", contents);
}


x86 assembly (clang, -O0):
<U_EMRSETVIEWPORTORGEX_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xeeb(%rip),%rdx
call   1030 <core7_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRSETVIEWPORTORGEX_print>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xef5(%rip),%rsi
lea    0xef8(%rip),%rdx
jmp    1030 <core7_print@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"U_EMRSETVIEWPORTORGEX\00"
@.str.1 = [11 x i8] c"ptlOrigin:\00"
@.str.2 = [1 x i8] zeroinitializer
define void @U_EMRSETVIEWPORTORGEX_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core7_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"U_EMRSETVIEWPORTORGEX\00"
@.str.1 = [11 x i8] c"ptlOrigin:\00"
@.str.2 = [1 x i8] zeroinitializer
define void @U_EMRSETVIEWPORTORGEX_print(i8* %0) {
%2 = tail call i32 @core7_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Dalloc(int **, int);
int /*<<< orphan*/ EMALLOC(int, int **);
void ini_ii(int maxp, int **ii, int **ii0, int **ii_hst) {
  Dalloc(ii, maxp);
  Dalloc(ii0, maxp);
  EMALLOC(maxp, ii_hst);
}


x86 assembly (clang, -O0):
<ini_ii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <Dalloc@plt>
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <Dalloc@plt>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <EMALLOC@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_ii>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    %ebp,%esi
call   1030 <Dalloc@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <Dalloc@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <EMALLOC@plt>

LLVM IR (-O0):
define void @ini_ii(i32 %0, i32** %1, i32** %2, i32** %3) {
%5 = alloca i32
%6 = alloca i32**
%7 = alloca i32**
%8 = alloca i32**
store i32 %0, i32* %5
store i32** %1, i32*** %6
store i32** %2, i32*** %7
store i32** %3, i32*** %8
%9 = load i32**, i32*** %6
%10 = load i32, i32* %5
%11 = call i32 @Dalloc(i32** %9, i32 %10)
%12 = load i32**, i32*** %7
%13 = load i32, i32* %5
%14 = call i32 @Dalloc(i32** %12, i32 %13)
%15 = load i32, i32* %5
%16 = load i32**, i32*** %8
%17 = call i32 @EMALLOC(i32 %15, i32** %16)
ret void
}

LLVM IR (-O2):
define void @ini_ii(i32 %0, i32** %1, i32** %2, i32** %3) {
%5 = tail call i32 @Dalloc(i32** %1, i32 %0)
%6 = tail call i32 @Dalloc(i32** %2, i32 %0)
%7 = tail call i32 @EMALLOC(i32 %0, i32** %3)
ret void
}
/* Variables and functions */
double f_seal_ClampDegrees(double const);
double f_seal_SubtractDegrees(const double a, const double b) {
  return f_seal_ClampDegrees(a - b);
}


x86 assembly (clang, -O0):
<f_seal_SubtractDegrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <f_seal_ClampDegrees@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_seal_SubtractDegrees>:
subsd  %xmm1,%xmm0
jmp    1030 <f_seal_ClampDegrees@plt>

LLVM IR (-O0):
define double @f_seal_SubtractDegrees(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @f_seal_ClampDegrees(double %7)
ret double %8
}

LLVM IR (-O2):
define double @f_seal_SubtractDegrees(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @f_seal_ClampDegrees(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int read(int, void *, size_t);
int recebe(int socket, void *dados, size_t tam) {
  int ret;
  if ((ret = read(socket, dados, tam)) < 0) {
    perror("Erro no Read!");
  }
  return ret;
}


x86 assembly (clang, -O0):
<recebe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    115b <recebe+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recebe>:
push   %rbx
call   1030 <read@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1130 <recebe+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1040 <perror@plt>
jmp    112c <recebe+0xc>

LLVM IR (-O0):
@.str = [14 x i8] c"Erro no Read!\00"
define i32 @recebe(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @read(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@.str = [14 x i8] c"Erro no Read!\00"
define i32 @recebe(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lcd_display_number_w_decimal(int, int);
void lcd_display_number(int number) {
  lcd_display_number_w_decimal(number, -1);
}


x86 assembly (clang, -O0):
<lcd_display_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xffffffff,%esi
call   1030 <lcd_display_number_w_decimal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_display_number>:
mov    $0xffffffff,%esi
jmp    1030 <lcd_display_number_w_decimal@plt>

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

LLVM IR (-O2):
define void @lcd_display_number(i32 %0) {
%2 = tail call i32 @lcd_display_number_w_decimal(i32 %0, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, char *, char *);
int test_assertions2() {
  {
    if (!(1)) {
      printf("%s:%d '%s' %s\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/5821gkv/lipo-sapr-lab4/refs/heads/"
             "master/yla_test_test.c",
             33, "1", "true assertion incorrect");
      return -1;
    }
  };
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @test_assertions2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test74_Test_20_testHandler__I() { printf("Test Handler!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Test Handler!\00"
define void @test74_Test_20_testHandler__I() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
int file_remove(char *filename) {
  remove(filename);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @file_remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 0
}
int dbl(int x) { return x * 2; }


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

x86 assembly (clang, -O2):
<dbl>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @dbl(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ word;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char word[] = {'H', 'e', 'l', 'l', 'o', '!'};
  int i;
  for (i = 0; i < (int)sizeof(word); ++i)
    printf("%c", word[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    1169 <main+0x59>
movslq -0x10(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <main+0x2a>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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    $0x21,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.word = [6 x i8] c"Hello!"
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 72)
%2 = tail call i32 @putchar(i32 101)
%3 = tail call i32 @putchar(i32 108)
%4 = tail call i32 @putchar(i32 108)
%5 = tail call i32 @putchar(i32 111)
%6 = tail call i32 @putchar(i32 33)
%7 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
struct crk5_exl_dat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct crk5_exl_dat *);
void crk5_exl_dat_delete(struct crk5_exl_dat *exl) {
  if (!exl)
    return;
  free(exl);
}


x86 assembly (clang, -O0):
<crk5_exl_dat_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <crk5_exl_dat_delete+0x1c>
jmp    1135 <crk5_exl_dat_delete+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.crk5_exl_dat = type { i32 }
define void @crk5_exl_dat_delete(%struct.crk5_exl_dat* %0) {
%2 = icmp eq %struct.crk5_exl_dat* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.crk5_exl_dat* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pixel_render_transform(double *, double *, int, int);
int /*<<< orphan*/ render_world_transform(double *, double *, int, int);
void pixel_world_transform(double *cx, double *cy, int sx, int sy) {
  pixel_render_transform(cx, cy, sx, sy);
  render_world_transform(cx, cy, sx, sy);
}


x86 assembly (clang, -O0):
<pixel_world_transform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <pixel_render_transform@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <render_world_transform@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_world_transform>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <pixel_render_transform@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <render_world_transform@plt>

LLVM IR (-O0):
define void @pixel_world_transform(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_render_transform(double* %9, double* %10, i32 %11, i32 %12)
%14 = load double*, double** %5
%15 = load double*, double** %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @render_world_transform(double* %14, double* %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @pixel_world_transform(double* %0, double* %1, i32 %2, i32 %3) {
%5 = tail call i32 @pixel_render_transform(double* %0, double* %1, i32 %2, i32 %3)
%6 = tail call i32 @render_world_transform(double* %0, double* %1, i32 %2, i32 %3)
ret void
}
double ephAngleRed(double deg) {
  double theta;
  theta = deg - 360 * (int)(deg / 360);
  return (theta < 0) ? theta + 360 : theta;
}


x86 assembly (clang, -O0):
<ephAngleRed>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee5(%rip),%xmm2
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%eax
imul   $0x168,%eax,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115b <ephAngleRed+0x5b>
movsd  0xeb4(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1165 <ephAngleRed+0x65>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ephAngleRed>:
movsd  0xef8(%rip),%xmm2
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%eax
imul   $0x168,%eax,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ephAngleRed(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 3.600000e+02
%7 = fptosi double %6 to i32
%8 = mul nsw i32 360, %7
%9 = sitofp i32 %8 to double
%10 = fsub double %4, %9
store double %10, double* %3
%11 = load double, double* %3
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load double, double* %3
%15 = fadd double %14, 3.600000e+02
br label %18
16: ; preds = %1
%17 = load double, double* %3
br label %18
18: ; preds = %16, %13
%19 = phi double [ %15, %13 ], [ %17, %16 ]
ret double %19
}

LLVM IR (-O2):
define double @ephAngleRed(double %0) {
%2 = fdiv double %0, 3.600000e+02
%3 = fptosi double %2 to i32
%4 = mul nsw i32 %3, 360
%5 = sitofp i32 %4 to double
%6 = fsub double %0, %5
%7 = fcmp olt double %6, 0.000000e+00
%8 = fadd double %6, 3.600000e+02
%9 = select i1 %7, double %8, double %6
ret double %9
}
int Cannonball(int n) {
  if (n == 1)
    return 1;
  else {
    return (Cannonball(n - 1) + n * n);
  }
}


x86 assembly (clang, -O0):
<Cannonball>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <Cannonball+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1148 <Cannonball+0x38>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <Cannonball@plt>
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cannonball>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     114b <Cannonball+0x4b>
lea    -0x2(%rdi),%ecx
mov    %ecx,%eax
imul   %edi,%eax
add    $0x1,%eax
imul   %ecx,%eax
mov    $0x3,%esi
sub    %edi,%esi
sub    %edi,%esi
lea    -0x3(%rdi),%edx
imul   %rcx,%rdx
lea    -0x4(%rdi),%ecx
imul   %rdx,%rcx
shr    %rdx
imul   %esi,%edx
shr    %rcx
imul   $0x55555556,%ecx,%ecx
imul   %edi,%edi
add    %eax,%edi
add    %edx,%edi
lea    (%rcx,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @Cannonball(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %28, label %3
3: ; preds = %1
%4 = add i32 %0, -2
%5 = mul i32 %4, %0
%6 = add i32 %5, 1
%7 = mul i32 %4, %6
%8 = mul i32 %0, -2
%9 = add i32 %8, 3
%10 = zext i32 %4 to i33
%11 = add i32 %0, -3
%12 = zext i32 %11 to i33
%13 = mul i33 %10, %12
%14 = lshr i33 %13, 1
%15 = trunc i33 %14 to i32
%16 = mul i32 %9, %15
%17 = add i32 %0, -4
%18 = zext i32 %17 to i33
%19 = mul i33 %13, %18
%20 = lshr i33 %19, 1
%21 = trunc i33 %20 to i32
%22 = mul i32 %21, 1431655766
%23 = mul i32 %0, %0
%24 = add i32 %23, %7
%25 = add i32 %24, %16
%26 = add i32 %25, %22
%27 = add i32 %26, 1
br label %28
28: ; preds = %3, %1
%29 = phi i32 [ 1, %1 ], [ %27, %3 ]
ret i32 %29
}
int cmp(const void *a, const void *b) {
  int a1 = *(int *)a, b1 = *(int *)b;
  if (a1 < b1)
    return -1;
  if (a1 == b1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <cmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <cmp+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <cmp+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void remap_irq() {
  outb(0x20, 0x11);
  outb(0xA0, 0x11);
  outb(0x21, 0x20);
  outb(0xA1, 0x28);
  outb(0x21, 0x04);
  outb(0xA1, 0x02);
  outb(0x21, 0x01);
  outb(0xA1, 0x01);
  outb(0x21, 0x0);
  outb(0xA1, 0x0);
}


x86 assembly (clang, -O0):
<remap_irq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remap_irq>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @remap_irq() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 @outb(i32 33, i32 32)
%4 = call i32 @outb(i32 161, i32 40)
%5 = call i32 @outb(i32 33, i32 4)
%6 = call i32 @outb(i32 161, i32 2)
%7 = call i32 @outb(i32 33, i32 1)
%8 = call i32 @outb(i32 161, i32 1)
%9 = call i32 @outb(i32 33, i32 0)
%10 = call i32 @outb(i32 161, i32 0)
ret void
}

LLVM IR (-O2):
define void @remap_irq() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 @outb(i32 33, i32 32)
%4 = tail call i32 @outb(i32 161, i32 40)
%5 = tail call i32 @outb(i32 33, i32 4)
%6 = tail call i32 @outb(i32 161, i32 2)
%7 = tail call i32 @outb(i32 33, i32 1)
%8 = tail call i32 @outb(i32 161, i32 1)
%9 = tail call i32 @outb(i32 33, i32 0)
%10 = tail call i32 @outb(i32 161, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void stop88n(void) { exit(1); }


x86 assembly (clang, -O0):
<stop88n>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @stop88n() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @stop88n() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int abs(int);
int max(int a, int b) {
  if (a > b) {
    return abs(a);
  } else if (b > a) {
    return abs(b);
  }
  return abs(a);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113a <max+0x2a>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
jmp    1166 <max+0x56>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1156 <max+0x46>
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
jmp    1166 <max+0x56>
jmp    115b <max+0x4b>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
cmp    %edi,%esi
cmovle %edi,%esi
cmovl  %edi,%esi
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %3, i32 %0, i32 %5
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
ret i32 %7
}
__attribute__((no, noclone)) int f3(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @f3() {
ret i32 1
}
void multidim_arr2_Bad() {
  int a[2][3];
  a[1][3] = 0;
}


x86 assembly (clang, -O0):
<multidim_arr2_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @multidim_arr2_Bad() {
%1 = alloca [2 x [3 x i32]]
%2 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 1
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 3
store i32 0, i32* %3
ret void
}

LLVM IR (-O2):
define void @multidim_arr2_Bad() {
ret void
}
void SSMR3GetU64(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetU64() {
ret void
}
void con_respond(char *message) {}


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

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

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

LLVM IR (-O2):
define void @con_respond(i8* nocapture %0) {
ret void
}
int my_square_root(int nb) {
  int i;
  i = 0;
  if (nb == 1)
    return (1);
  while (i <= nb / 2) {
    if (i * i == nb)
      return (i);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_square_root>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1124 <my_square_root+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1177 <my_square_root+0x77>
jmp    1129 <my_square_root+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1170 <my_square_root+0x70>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1162 <my_square_root+0x62>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <my_square_root+0x77>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <my_square_root+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_square_root>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1132 <my_square_root+0x32>
xor    %eax,%eax
cmp    $0xffffffff,%edi
jl     1132 <my_square_root+0x32>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
add    $0x1,%ecx
xor    %eax,%eax
nop
mov    %eax,%edx
imul   %eax,%edx
cmp    %edi,%edx
je     1132 <my_square_root+0x32>
add    $0x1,%eax
cmp    %eax,%ecx
jne    1120 <my_square_root+0x20>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_square_root(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, -1
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = sdiv i32 %0, 2
br label %7
7: ; preds = %5, %11
%8 = phi i32 [ %12, %11 ], [ 0, %5 ]
%9 = mul nsw i32 %8, %8
%10 = icmp eq i32 %9, %0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = add nuw nsw i32 %8, 1
%13 = icmp eq i32 %8, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %11, %3, %1
%15 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %8, %7 ], [ 0, %11 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char const *, char const *, int);
int /*<<< orphan*/ unsetenv(char const *);
void Q_setenv(const char *name, const char *value) {
  if (value) {
    setenv(name, value, 1);
  } else {
    unsetenv(name);
  }
}


x86 assembly (clang, -O0):
<Q_setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <Q_setenv+0x32>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
jmp    115b <Q_setenv+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <unsetenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_setenv>:
test   %rsi,%rsi
je     112f <Q_setenv+0xf>
mov    $0x1,%edx
jmp    1030 <setenv@plt>
jmp    1040 <unsetenv@plt>

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

LLVM IR (-O2):
define void @Q_setenv(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
br label %8
6: ; preds = %2
%7 = tail call i32 @unsetenv(i8* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void sigsevhand(int sig) {
  fprintf(stderr, "Sigsev occured\n");
  exit(1);
}


x86 assembly (clang, -O0):
<sigsevhand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Sigsev occured\0A\00"
define void @sigsevhand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Sigsev occured\0A\00"
define void @sigsevhand(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
void cmp_pain_deinit(struct CmpPain *pain) { (void)pain; }


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

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

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

LLVM IR (-O2):
%struct.CmpPain = type opaque
define void @cmp_pain_deinit(%struct.CmpPain* nocapture %0) {
ret void
}
void ExttViewAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttViewAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _free(char *);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
void mon_free(char *cp) {
  monLock();
  _free(cp);
  monUnlock();
}


x86 assembly (clang, -O0):
<mon_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_free@plt>
mov    $0x0,%al
call   1050 <monUnlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_free>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %rbx,%rdi
call   1030 <_free@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <monUnlock@plt>

LLVM IR (-O0):
define void @mon_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @monLock()
%4 = load i8*, i8** %2
%5 = call i32 @_free(i8* %4)
%6 = call i32 (...) @monUnlock()
ret void
}

LLVM IR (-O2):
define void @mon_free(i8* %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call i32 @_free(i8* %0)
%4 = tail call i32 (...) @monUnlock()
ret void
}
/* Variables and functions */
double atan(double);
double sqrt(double);
double _PHYSICS_get_orbit_circumference(double semi_major_axis,
                                        double semi_minor_axis) {
  return ((sqrt(0.5 * ((semi_major_axis * semi_major_axis) +
                       (semi_minor_axis * semi_minor_axis)))) *
          (4.0 * atan(1.0) * 2)) /
         2;
}


x86 assembly (clang, -O0):
<_PHYSICS_get_orbit_circumference>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xea4(%rip),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe73(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe63(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_PHYSICS_get_orbit_circumference>:
push   %rax
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xecb(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1145 <_PHYSICS_get_orbit_circumference+0x25>
sqrtsd %xmm0,%xmm0
jmp    114a <_PHYSICS_get_orbit_circumference+0x2a>
call   1040 <sqrt@plt>
movsd  %xmm0,(%rsp)
movsd  0xeb1(%rip),%xmm0
call   1030 <atan@plt>
movsd  (%rsp),%xmm0
mulsd  0xea7(%rip),%xmm0
mulsd  0xe8f(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_PHYSICS_get_orbit_circumference(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = fmul double 5.000000e-01, %10
%12 = call double @sqrt(double %11)
%13 = call double @atan(double 1.000000e+00)
%14 = fmul double 4.000000e+00, %13
%15 = fmul double %14, 2.000000e+00
%16 = fmul double %12, %15
%17 = fdiv double %16, 2.000000e+00
ret double %17
}

LLVM IR (-O2):
define double @_PHYSICS_get_orbit_circumference(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = fmul double %4, 5.000000e-01
%6 = tail call double @sqrt(double %5)
%7 = tail call double @atan(double 1.000000e+00)
%8 = fmul double %6, 0x401921FB54442D18
%9 = fmul double %8, 5.000000e-01
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x64() {
  Assert_real((isodigit(100) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              505, ("isodigit should be 0 for d"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1f9,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x64>:
push   %rax
mov    $0x64,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1f9,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for d\00"
define void @t_isodigit_0x64() {
%1 = call i64 @isodigit(i32 100)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for d\00"
define void @t_isodigit_0x64() {
%1 = tail call i64 @isodigit(i32 100)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

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

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


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

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

LLVM IR (-O2):
define void @set_XSizeHints_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int /*<<< orphan*/ WriteUint16Be(int /*<<< orphan*/, void *);
int32_t WriteInt16Be(int16_t value, void *out) {
  return WriteUint16Be((uint16_t)value, out);
}


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

x86 assembly (clang, -O2):
<WriteInt16Be>:
jmp    1030 <WriteUint16Be@plt>

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

LLVM IR (-O2):
define i32 @WriteInt16Be(i64 %0, i8* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @WriteUint16Be(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void calls_free(void *victim) { free(victim); }


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

x86 assembly (clang, -O2):
<calls_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @calls_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void TimerIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<TimerIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntEnable>:
or     %rsi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @TimerIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 12
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}