xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int cookie1;
  int cookie2;
  if (cookie1 == 0x41424344) {
    if (cookie2 == 0x45464748) {
      printf("you win!\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x41424344,-0x8(%rbp)
jne    114a <main+0x3a>
cmpl   $0x45464748,-0xc(%rbp)
jne    1145 <main+0x35>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    114a <main+0x3a>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct xdg_shell {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *xdg_shell_get_user_data(struct xdg_shell *xdg_shell) {
  return wl_proxy_get_user_data((struct wl_proxy *)xdg_shell);
}


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

x86 assembly (clang, -O2):
<xdg_shell_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.xdg_shell = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @xdg_shell_get_user_data(%struct.xdg_shell* %0) {
%2 = alloca %struct.xdg_shell*
store %struct.xdg_shell* %0, %struct.xdg_shell** %2
%3 = load %struct.xdg_shell*, %struct.xdg_shell** %2
%4 = bitcast %struct.xdg_shell* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.xdg_shell = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @xdg_shell_get_user_data(%struct.xdg_shell* %0) {
%2 = bitcast %struct.xdg_shell* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
int test_for(int x) {
  int i, sum;
  sum = 0;
  for (i = 0; i < x; i++) {
    sum = sum + x;
  }
  return sum;
}


x86 assembly (clang, -O0):
<test_for>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <test_for+0x38>
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <test_for+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_for>:
mov    %edi,%ecx
imul   %edi,%ecx
xor    %eax,%eax
test   %edi,%edi
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_for(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = mul i32 %0, %0
%4 = select i1 %2, i32 %3, i32 0
ret i32 %4
}
/* Variables and functions */
float sin(float);
__attribute__((no)) float foo() { return sin(12.4f); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  0xee4(%rip),%xmm0
call   1030 <sin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @foo() {
%1 = call float @sin(float 0x4028CCCCC0000000)
ret float %1
}

LLVM IR (-O2):
define float @foo() {
ret float 0xBFC53287A0000000
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double x = 3.1415;
  double y = 2.7178;
  double z;
  int i = 0;
  printf("%f\n", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
store double 3.141500e+00, double* %2
store double 2.717800e+00, double* %3
store i32 0, i32* %5
%6 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glHint(unsigned int, unsigned int);
void Hint(unsigned int t, unsigned int m) { glHint(t, m); }


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

x86 assembly (clang, -O2):
<Hint>:
jmp    1030 <glHint@plt>

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

LLVM IR (-O2):
define void @Hint(i32 %0, i32 %1) {
%3 = tail call i32 @glHint(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 2;
  printf("n =%i\n", !n);
  n = !n;
  printf("n =%i\n", !n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"n =%i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 2, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"n =%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ prg16setBank0(int);
int /*<<< orphan*/ prg16setBank1(int);
void m231SetPrgROMBank(uint32_t bank) {
  prg16setBank0(bank & ~0x7FFF);
  prg16setBank1(bank);
}


x86 assembly (clang, -O0):
<m231SetPrgROMBank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff8000,%edi
call   1030 <prg16setBank0@plt>
mov    -0x4(%rbp),%edi
call   1040 <prg16setBank1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m231SetPrgROMBank>:
push   %rbx
mov    %edi,%ebx
and    $0xffff8000,%edi
call   1030 <prg16setBank0@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <prg16setBank1@plt>

LLVM IR (-O0):
define void @m231SetPrgROMBank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -32768
%5 = call i32 @prg16setBank0(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @prg16setBank1(i32 %6)
ret void
}

LLVM IR (-O2):
define void @m231SetPrgROMBank(i32 %0) {
%2 = and i32 %0, -32768
%3 = tail call i32 @prg16setBank0(i32 %2)
%4 = tail call i32 @prg16setBank1(i32 %0)
ret void
}
/* Variables and functions */
size_t SIZE_MAX;
scalar_t__ errno;
int /*<<< orphan*/ perror(char *);
size_t strtoul(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
size_t estrtoul(const char *s) {
  size_t result;
  errno = 0;
  result = strtoul(s, NULL, 0);
  if (errno != 0) {
    perror("strtoul");
    return SIZE_MAX;
  }
  return result;
}


x86 assembly (clang, -O0):
<estrtoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e8c(%rip),%rax
cmpq   $0x0,(%rax)
je     117d <estrtoul+0x5d>
lea    0xe9b(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <estrtoul+0x65>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrtoul>:
push   %rbx
mov    0x2eb8(%rip),%rbx
movq   $0x0,(%rbx)
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
cmpq   $0x0,(%rbx)
jne    1140 <estrtoul+0x20>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i64 0
@.str = [8 x i8] c"strtoul\00"
@SIZE_MAX = global i64 0
define i64 @estrtoul(i8* nocapture %0) {
store i64 0, i64* @errno
%2 = tail call i64 @strtoul(i8* nocapture %0, i32* null, i32 0)
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i64, i64* @SIZE_MAX
br label %8
8: ; preds = %1, %5
%9 = phi i64 [ %7, %5 ], [ %2, %1 ]
ret i64 %9
}
pri() {}


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

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

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

LLVM IR (-O2):
define i32 @pri() {
ret i32 undef
}
double get_scale_factor(const double *x, int dim) {
  if (dim == 0)
    return x[0];
  return 1.0;
}


x86 assembly (clang, -O0):
<get_scale_factor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1127 <get_scale_factor+0x27>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1134 <get_scale_factor+0x34>
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_scale_factor>:
test   %esi,%esi
je     110d <get_scale_factor+0xd>
movsd  0xef4(%rip),%xmm0
ret
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @get_scale_factor(double* %0, i32 %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
store double %11, double* %3
br label %13
12: ; preds = %2
store double 1.000000e+00, double* %3
br label %13
13: ; preds = %12, %8
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @get_scale_factor(double* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load double, double* %0
br label %6
6: ; preds = %2, %4
%7 = phi double [ %5, %4 ], [ 1.000000e+00, %2 ]
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ make_regexp(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void rule_for_word(char *word, char *token) {
  char regexp[4096];
  strcpy(regexp, word);
  make_regexp(regexp);
  printf("%s {\n   yylval.str = newstr(yytext); return %s;\n}\n", regexp,
         token);
}


x86 assembly (clang, -O0):
<rule_for_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1010(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x1010(%rbp),%rdi
call   1050 <make_regexp@plt>
lea    -0x1010(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rule_for_word>:
push   %r14
push   %rbx
sub    $0x1008,%rsp
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <make_regexp@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [51 x i8] c"%s {\0A yylval.str = newstr(yytext); return %s;\0A}\0A\00"
define void @rule_for_word(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [4096 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%10 = call i32 @make_regexp(i8* %9)
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"%s {\0A yylval.str = newstr(yytext); return %s;\0A}\0A\00"
define void @rule_for_word(i8* %0, i8* %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @make_regexp(i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_desc(char *desc) { write("csv-task.csv", "%s,", desc); }


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

x86 assembly (clang, -O2):
<function_desc>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_desc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_desc(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char **malloc(int);
int /*<<< orphan*/ printFF(char *, char **, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
void ls() {
  char **s = malloc(sizeof(char *));
  char *ls = "Modules: dummy, editor, shell, fortune";
  s[0] = ls;
  printFF("%s", s, 0);
  putchar('\n');
}


x86 assembly (clang, -O0):
<ls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xec0(%rip),%rdi
xor    %edx,%edx
call   1040 <printFF@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls>:
push   %rax
mov    $0x8,%edi
call   1050 <malloc@plt>
lea    0xebe(%rip),%rcx
mov    %rcx,(%rax)
lea    0xedb(%rip),%rdi
mov    %rax,%rsi
xor    %edx,%edx
call   1040 <printFF@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Modules: dummy, editor, shell, fortune\00"
@.str.1 = [3 x i8] c"%s\00"
define void @ls() {
%1 = alloca i8**
%2 = alloca i8*
%3 = call i8** @malloc(i32 8)
store i8** %3, i8*** %1
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = load i8**, i8*** %1
%6 = getelementptr inbounds i8*, i8** %5, i64 0
store i8* %4, i8** %6
%7 = load i8**, i8*** %1
%8 = call i32 @printFF(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %7, i32 0)
%9 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Modules: dummy, editor, shell, fortune\00"
@.str.1 = [3 x i8] c"%s\00"
define void @ls() {
%1 = tail call i8** @malloc(i32 8)
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = tail call i32 @printFF(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %1, i32 0)
%3 = tail call i32 @putchar(i8 signext 10)
ret void
}
int toColor(int r, int g, int b) { return (r << 5) | (g << 2) | b; }


x86 assembly (clang, -O0):
<toColor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toColor>:
shl    $0x5,%edi
lea    0x0(,%rsi,4),%eax
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @toColor(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 = shl i32 %7, 5
%9 = load i32, i32* %5
%10 = shl i32 %9, 2
%11 = or i32 %8, %10
%12 = load i32, i32* %6
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @toColor(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 5
%5 = shl i32 %1, 2
%6 = or i32 %5, %4
%7 = or i32 %6, %2
ret i32 %7
}
unsigned xrop3_60_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;
  stk1 = T ^ S;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_60_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    -0x10(%rbp),%eax
xor    -0xc(%rbp),%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_60_1_1>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_60_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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = xor i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = load i32, i32* %6
%26 = xor i32 %25, -1
%27 = and i32 %24, %26
%28 = load i32, i32* %7
%29 = xor i32 %28, -1
%30 = and i32 %27, %29
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = or i32 %30, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %7
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_60_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error() {
  fprintf(stderr, "Program has encounterd an error.\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<error>:
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 = [34 x i8] c"Program has encounterd an error.\0A\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Program has encounterd an error.\0A\00"
define void @error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(char *);
void ft_display2d(char *array[]) {
  int i;
  i = -1;
  while (array[++i])
    ft_putendl(array[i]);
}


x86 assembly (clang, -O0):
<ft_display2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1154 <ft_display2d+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <ft_putendl@plt>
jmp    1123 <ft_display2d+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_display2d>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <ft_display2d+0x21>
add    $0x8,%rbx
call   1030 <ft_putendl@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <ft_display2d+0x10>
pop    %rbx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct Node *);
void free_node(struct Node *node) { free(node); }


x86 assembly (clang, -O0):
<free_node>:
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):
<free_node>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Node = type { i32 }
define void @free_node(%struct.Node* %0) {
%2 = alloca %struct.Node*
store %struct.Node* %0, %struct.Node** %2
%3 = load %struct.Node*, %struct.Node** %2
%4 = call i32 @free(%struct.Node* %3)
ret void
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define void @free_node(%struct.Node* nocapture %0) {
%2 = tail call i32 @free(%struct.Node* %0)
ret void
}
void null_scene_close() {}


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

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

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

LLVM IR (-O2):
define void @null_scene_close() {
ret void
}
double sgn(double x) {
  if (x == 0.0)
    return (x);
  else if (x < 0.0)
    return (-1.0);
  else
    return (1.0);
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1130 <sgn+0x30>
jp     1130 <sgn+0x30>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115d <sgn+0x5d>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1150 <sgn+0x50>
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115d <sgn+0x5d>
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @sgn(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, double -1.000000e+00, double 1.000000e+00
%5 = select i1 %2, double %0, double %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int sem_destroy(int /*<<< orphan*/ *);
__attribute__((weak)) int __real_sem_destroy(sem_t *sem) {
  return sem_destroy(sem);
}


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

x86 assembly (clang, -O2):
<__real_sem_destroy>:
jmp    1030 <sem_destroy@plt>

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

LLVM IR (-O2):
define weak i32 @__real_sem_destroy(i32* %0) {
%2 = tail call i32 @sem_destroy(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gmx_saltbr(int, char **);
int main(int argc, char *argv[]) {
  gmx_saltbr(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_saltbr(i32 %0, i8** %1)
ret i32 0
}
int _parse_tcp_arg(char *name, char *port_arg, char **host, char **port) {
  name = &name[sizeof("tcp:") - 1];
  if (!port_arg) {
    port_arg = "20000";
  }
  *host = name;
  *port = port_arg;
  return 0;
}


x86 assembly (clang, -O0):
<_parse_tcp_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <_parse_tcp_arg+0x36>
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_parse_tcp_arg>:
add    $0x4,%rdi
test   %rsi,%rsi
lea    0xef2(%rip),%rax
cmovne %rsi,%rax
mov    %rdi,(%rdx)
mov    %rax,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"20000\00"
define i32 @_parse_tcp_arg(i8* %0, i8* %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = icmp eq i8* %1, null
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1
store i8* %5, i8** %2
store i8* %7, i8** %3
ret i32 0
}
int test_fun(int x, int y) {
  int c = 0;
  while (x > y) {
    y = y + 1;
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1134 <test_fun+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_fun+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
xor    %eax,%eax
sub    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @test_fun(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 = %10, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
br label %6
15: ; preds = %6
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub i32 %0, %1
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
unsigned long addIntToHash(unsigned long hash, const char *key, int val) {
  return 0;
}


x86 assembly (clang, -O0):
<addIntToHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @addIntToHash(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i64 0
}

LLVM IR (-O2):
define i64 @addIntToHash(i64 %0, i8* nocapture readnone %1, i32 %2) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x53() {
  Assert_real((isprint(83)),
              "/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_isprint.c",
              420, ("isprint should be 1 for S"));
}


x86 assembly (clang, -O0):
<t_isprint_0x53>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1a4,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x53>:
push   %rax
mov    $0x53,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1a4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for S\00"
define void @t_isprint_0x53() {
%1 = call i32 @isprint(i32 83)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for S\00"
define void @t_isprint_0x53() {
%1 = tail call i32 @isprint(i32 83)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
float fast_inv(float a) {
  union fu32_u {
    float f;
    uint32_t u;
  };
  union fu32_u x;
  x.f = a;
  x.u = 0x7eeeeeee - x.u;
  x.f = x.f * (2.0f - a * x.f);
  return x.f;
}


x86 assembly (clang, -O0):
<fast_inv>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0x7eeeeeee,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xeb8(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_inv>:
movd   %xmm0,%eax
mov    $0x7eeeeeee,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm2
mulss  %xmm2,%xmm0
movss  0xee5(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
%union.fu32_u = type { i64 }
define float @fast_inv(float %0) {
%2 = alloca float
%3 = alloca %union.fu32_u
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.fu32_u* %3 to float*
store float %4, float* %5
%6 = bitcast %union.fu32_u* %3 to i64*
%7 = load i64, i64* %6
%8 = sub nsw i64 2129587950, %7
%9 = bitcast %union.fu32_u* %3 to i64*
store i64 %8, i64* %9
%10 = bitcast %union.fu32_u* %3 to float*
%11 = load float, float* %10
%12 = load float, float* %2
%13 = bitcast %union.fu32_u* %3 to float*
%14 = load float, float* %13
%15 = fneg float %12
%16 = call float @llvm.fmuladd.f32(float %15, float %14, float 2.000000e+00)
%17 = fmul float %11, %16
%18 = bitcast %union.fu32_u* %3 to float*
store float %17, float* %18
%19 = bitcast %union.fu32_u* %3 to float*
%20 = load float, float* %19
ret float %20
}

LLVM IR (-O2):
define float @fast_inv(float %0) {
%2 = bitcast float %0 to i32
%3 = sub i32 2129587950, %2
%4 = bitcast i32 %3 to float
%5 = fneg float %0
%6 = tail call float @llvm.fmuladd.f32(float %5, float %4, float 2.000000e+00)
%7 = fmul float %6, %4
ret float %7
}
int mystrstr(char *str1, char *str2) {
  while (*str1 == *str2) {
    str1++;
    str2++;
  }
  if (*str1 == '\0') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mystrstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113f <mystrstr+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <mystrstr+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115b <mystrstr+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <mystrstr+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrstr>:
mov    (%rdi),%cl
cmp    (%rsi),%cl
jne    1120 <mystrstr+0x20>
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%ecx
lea    0x1(%rax),%rdx
cmp    (%rsi,%rax,1),%cl
mov    %rdx,%rax
je     1110 <mystrstr+0x10>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @mystrstr(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i8* [ %10, %6 ], [ %1, %2 ]
%8 = phi i8* [ %9, %6 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = load i8, i8* %10
%13 = icmp eq i8 %11, %12
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = phi i8 [ %3, %2 ], [ %11, %6 ]
%16 = icmp eq i8 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, ...);
void dmpstr(const char *prefix, unsigned int i, const char *s[],
            unsigned int maxi) {
  if (i > maxi)
    printf("%s%u", prefix, i);
  else
    printf("%s%s", prefix, s[i]);
}


x86 assembly (clang, -O0):
<dmpstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jbe    114c <dmpstr+0x3c>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1169 <dmpstr+0x59>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,8),%rdx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmpstr>:
mov    %esi,%eax
mov    %rdi,%rsi
cmp    %ecx,%eax
jbe    1129 <dmpstr+0x19>
lea    0xee0(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>
mov    %eax,%eax
mov    (%rdx,%rax,8),%rdx
lea    0xecf(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%u\00"
@.str.1 = [5 x i8] c"%s%s\00"
define void @dmpstr(i8* %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = icmp ugt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14)
br label %24
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = load i8**, i8*** %7
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %22)
br label %24
24: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%u\00"
@.str.1 = [5 x i8] c"%s%s\00"
define void @dmpstr(i8* %0, i32 %1, i8** nocapture %2, i32 %3) {
%5 = icmp ugt i32 %1, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %13
8: ; preds = %4
%9 = zext i32 %1 to i64
%10 = getelementptr inbounds i8*, i8** %2, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %11)
br label %13
13: ; preds = %8, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int load(int /*<<< orphan*/ *, int, int, int, int);
uint64_t loadX(uint8_t *mem, uint64_t addr, uint64_t hint) {
  return load(mem, addr, (hint >> 4) & 0x3, (hint >> 1) & 0x7,
              (hint & 0x1) == 1);
}


x86 assembly (clang, -O0):
<loadX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
sar    $0x4,%edx
and    $0x3,%edx
mov    -0x10(%rbp),%ecx
sar    $0x1,%ecx
and    $0x7,%ecx
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%r8d
call   1030 <load@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadX>:
mov    %edx,%r8d
shr    $0x4,%edx
and    $0x3,%edx
mov    %r8d,%ecx
shr    %ecx
and    $0x7,%ecx
and    $0x1,%r8d
jmp    1030 <load@plt>

LLVM IR (-O0):
define i32 @loadX(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = ashr i32 %9, 4
%11 = and i32 %10, 3
%12 = load i32, i32* %6
%13 = ashr i32 %12, 1
%14 = and i32 %13, 7
%15 = load i32, i32* %6
%16 = and i32 %15, 1
%17 = icmp eq i32 %16, 1
%18 = zext i1 %17 to i32
%19 = call i32 @load(i32* %7, i32 %8, i32 %11, i32 %14, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @loadX(i32* %0, i32 %1, i32 %2) {
%4 = lshr i32 %2, 4
%5 = and i32 %4, 3
%6 = lshr i32 %2, 1
%7 = and i32 %6, 7
%8 = and i32 %2, 1
%9 = tail call i32 @load(i32* %0, i32 %1, i32 %5, i32 %7, i32 %8)
ret i32 %9
}
/* Variables and functions */
void strlen(void) {}


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

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

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

LLVM IR (-O2):
define void @strlen() {
ret void
}
/* Variables and functions */
int act2000_isa_reset(unsigned short);
int /*<<< orphan*/ check_region(unsigned short, int);
int /*<<< orphan*/ cli();
int /*<<< orphan*/ restore_flags(unsigned long);
int /*<<< orphan*/ save_flags(unsigned long);
int act2000_isa_detect(unsigned short portbase) {
  int ret = 0;
  unsigned long flags;
  save_flags(flags);
  cli();
  if (!check_region(portbase, 8))
    ret = act2000_isa_reset(portbase);
  restore_flags(flags);
  return ret;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <save_flags@plt>
mov    $0x0,%al
call   1060 <cli@plt>
mov    $0x8,%esi
movzwl -0x2(%rbp),%edi
call   1050 <check_region@plt>
cmp    $0x0,%eax
jne    1199 <act2000_isa_detect+0x49>
movzwl -0x2(%rbp),%edi
call   1070 <act2000_isa_reset@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <restore_flags@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <save_flags@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1060 <cli@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1050 <check_region@plt>
test   %eax,%eax
jne    117d <act2000_isa_detect+0x2d>
movzwl %bx,%edi
call   1070 <act2000_isa_reset@plt>
mov    %eax,%ebp
call   1030 <restore_flags@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @act2000_isa_detect(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
store i16 %0, i16* %2
store i32 0, i32* %3
%5 = load i64, i64* %4
%6 = call i32 @save_flags(i64 %5)
%7 = call i32 (...) @cli()
%8 = load i16, i16* %2
%9 = call i32 @check_region(i16 zeroext %8, i32 8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i16, i16* %2
%13 = call i32 @act2000_isa_reset(i16 zeroext %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %1
%15 = load i64, i64* %4
%16 = call i32 @restore_flags(i64 %15)
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @act2000_isa_detect(i16 zeroext %0) {
%2 = tail call i32 @save_flags(i64 undef)
%3 = tail call i32 (...) @cli()
%4 = tail call i32 @check_region(i16 zeroext %0, i32 8)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @act2000_isa_reset(i16 zeroext %0)
br label %8
8: ; preds = %6, %1
%9 = phi i32 [ 0, %1 ], [ %7, %6 ]
%10 = tail call i32 @restore_flags(i64 undef)
ret i32 %9
}