xunge/DecIR huggingface dataset:
void dlmalloc_trim() {}


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

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

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

LLVM IR (-O2):
define void @dlmalloc_trim() {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ catalan(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int i;
  int count = atoi(argv[1]);
  for (i = 0; i <= count; i++)
    printf("%ld ", catalan(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     118d <main+0x5d>
mov    -0x14(%rbp),%edi
call   1030 <catalan@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
test   %eax,%eax
js     1168 <main+0x38>
mov    %eax,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
lea    0xeb1(%rip),%r14
nop
mov    %ebp,%edi
call   1030 <catalan@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %11, %7 ], [ 0, %2 ]
%9 = tail call i32 @catalan(i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i32 %8, 1
%12 = icmp eq i32 %8, %5
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret i32 0
}
void init_sigchld(void) {}


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

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

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

LLVM IR (-O2):
define void @init_sigchld() {
ret void
}
/* Type definitions */
typedef unsigned int pid_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, unsigned int *, int);
extern void track_process(int fd, pid_t pid, int b) {
  unsigned int buffer[2];
  buffer[0] = pid;
  buffer[1] = b;
  if (!write(fd, buffer, sizeof(unsigned int) * 2)) {
  }
}


x86 assembly (clang, -O0):
<track_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
cmp    $0x0,%eax
jne    114c <track_process+0x3c>
jmp    114c <track_process+0x3c>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @track_process(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i32, i32* %6
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %10, i32* %11
%12 = load i32, i32* %4
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%14 = call i32 @write(i32 %12, i32* %13, i32 8)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %3
br label %17
17: ; preds = %16, %3
ret void
}

LLVM IR (-O2):
define void @track_process(i32 %0, i32 %1, i32 %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %1, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %2, i32* %7
%8 = call i32 @write(i32 %0, i32* %6, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, unsigned char *, int);
void Platform_errch(unsigned char c) { write(1, &c, 1); }


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

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

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

LLVM IR (-O2):
define void @Platform_errch(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
unsigned int bitcount(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int main() {
  unsigned test = 13;
  unsigned result = bitcount(test);
  printf("bitcount(%u) -> %u\n", test, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <bitcount@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xd,%edi
call   1040 <bitcount@plt>
lea    0xece(%rip),%rdi
mov    $0xd,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"bitcount(%u) -> %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 13, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @bitcount(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"bitcount(%u) -> %u\0A\00"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 13)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 13, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, float);
int main() {
  int age;
  float distance;
  age = 15;
  distance = 19382.33;
  printf("The alien is %d old and \n", age);
  printf("comes from %f miles away \n", distance);
  getchar();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movss  0xec2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
movss  0xec0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"The alien is %d old and \0A\00"
@.str.1 = [27 x i8] c"comes from %f miles away \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 15, i32* %2
store float 0x40D2ED9520000000, float* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float %5)
%7 = load float, float* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), float %7)
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"The alien is %d old and \0A\00"
@.str.1 = [27 x i8] c"comes from %f miles away \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float 1.500000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), float 0x40D2ED9520000000)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
int nbl_is_compressed(char *pstrBuffer) {
  return (*((unsigned int *)(pstrBuffer + 0x14))) != 0;
}


x86 assembly (clang, -O0):
<nbl_is_compressed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x14(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbl_is_compressed>:
xor    %eax,%eax
cmpl   $0x0,0x14(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @nbl_is_compressed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 20
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @nbl_is_compressed(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 20
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ parse_sched_entry(char *);
void parse_schedule(FILE *f) {
  char line[512];
  int lineno = 0;
  for (;;) {
    fgets(line, 511, f);
    if (feof(f))
      break;
    lineno++;
    parse_sched_entry(line);
  }
}


x86 assembly (clang, -O0):
<parse_schedule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x214(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x1ff,%esi
call   1030 <fgets@plt>
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%rax
je     1176 <parse_schedule+0x46>
jmp    1196 <parse_schedule+0x66>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
lea    -0x210(%rbp),%rdi
call   1050 <parse_sched_entry@plt>
jmp    1149 <parse_schedule+0x19>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_schedule>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x1ff,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %rax,%rax
jne    1185 <parse_schedule+0x55>
mov    %rsp,%r14
nopl   (%rax)
mov    %r14,%rdi
call   1050 <parse_sched_entry@plt>
mov    %r14,%rdi
mov    $0x1ff,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %rax,%rax
je     1160 <parse_schedule+0x30>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @parse_schedule(i32* %0) {
%2 = alloca i32*
%3 = alloca [512 x i8]
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %13, %1
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32 @fgets(i8* %6, i32 511, i32* %7)
%9 = load i32*, i32** %2
%10 = call i64 @feof(i32* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %18
13: ; preds = %5
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%17 = call i32 @parse_sched_entry(i8* %16)
br label %5
18: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @parse_schedule(i32* nocapture %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @fgets(i8* %3, i32 511, i32* %0)
%5 = call i64 @feof(i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = call i32 @parse_sched_entry(i8* %3)
%9 = call i32 @fgets(i8* %3, i32 511, i32* %0)
%10 = call i64 @feof(i32* %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stress_float_put(float const);
float __attribute__((no)) stress_funccall_float_1(const float a) {
  stress_float_put(a);
  return a;
}


x86 assembly (clang, -O0):
<stress_funccall_float_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <stress_float_put@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funccall_float_1>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <stress_float_put@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stress_funccall_float_1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @stress_float_put(float %3)
%5 = load float, float* %2
ret float %5
}

LLVM IR (-O2):
define float @stress_funccall_float_1(float returned %0) {
%2 = tail call i32 @stress_float_put(float %0)
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _list_connections(void) { printf("list clients connected...\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"list clients connected...\0A\00"
define void @_list_connections() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"list clients connected...\00"
define void @_list_connections() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ writee(char *);
void usage(void) {
  writee("unknown argument.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <writee@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writee@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"unknown argument.\0A\00"
define void @usage() {
%1 = call i32 @writee(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"unknown argument.\0A\00"
define void @usage() {
%1 = tail call i32 @writee(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int main() {
  int n;
  char string[3];
  n = -123;
  itoa(n, string);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x5(%rsp),%rsi
mov    $0xffffff85,%edi
call   1030 <itoa@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
store i32 -123, i32* %1
%3 = load i32, i32* %1
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @itoa(i32 %3, i8* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 -123, i8* %2)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int gstrcmp(const char *a, const char *b) {
  if (!a && !b)
    return 0;
  if (!a || !b)
    return -1;
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<gstrcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <gstrcmp+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <gstrcmp+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1174 <gstrcmp+0x64>
cmpq   $0x0,-0x10(%rbp)
je     1158 <gstrcmp+0x48>
cmpq   $0x0,-0x18(%rbp)
jne    1164 <gstrcmp+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <gstrcmp+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gstrcmp>:
xor    %eax,%eax
mov    %rdi,%rcx
or     %rsi,%rcx
je     112e <gstrcmp+0x1e>
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     112e <gstrcmp+0x1e>
test   %rsi,%rsi
je     112e <gstrcmp+0x1e>
jmp    1030 <strcmp@plt>
ret

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

LLVM IR (-O2):
define i32 @gstrcmp(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = and i1 %3, %4
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %10
10: ; preds = %6, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ -1, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int fast_isprint(uint8_t c) { return (c >= 32 && c < 127); }


x86 assembly (clang, -O0):
<fast_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <fast_isprint+0x20>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @fast_isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @fast_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ problematic(void *);
int main() {
  problematic(((void *)0));
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @problematic(i8* null)
ret i32 0
}
void pthread_testcancel(void) { return; }


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

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

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

LLVM IR (-O2):
define void @pthread_testcancel() {
ret void
}
int copy_io_bitmap(struct task_struct *me, struct task_struct *p) { return 0; }


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define i32 @copy_io_bitmap(%struct.task_struct* %0, %struct.task_struct* %1) {
%3 = alloca %struct.task_struct*
%4 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret i32 0
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @copy_io_bitmap(%struct.task_struct* nocapture readnone %0, %struct.task_struct* nocapture readnone %1) {
ret i32 0
}
void fd269(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
a:;
  typedef int(*j)[n];
p03A:
  goto p03A;
  goto a;
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd269>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd269+0x7>

x86 assembly (clang, -O2):
<fd269>:
jmp    1100 <fd269>

LLVM IR (-O0):
define void @fd269(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; No predecessors!
%42 = load i32, i32* %2
%43 = zext i32 %42 to i64
br label %44
44: ; preds = %44, %41
br label %44
45: ; preds = %45
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd269(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello, world\a"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [14 x i8] c"hello, world\07\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, world\07\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int XGetZoomHints() {}


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

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

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

LLVM IR (-O2):
define i32 @XGetZoomHints() {
ret i32 undef
}
/* Variables and functions */
int ObjectSize2(void *const);
int IndirectObjectSize2(void *const p __attribute__((pass_object_size(2)))) {
  return ObjectSize2(p);
}


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

x86 assembly (clang, -O2):
<IndirectObjectSize2>:
jmp    1030 <ObjectSize2@plt>

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

LLVM IR (-O2):
define i32 @IndirectObjectSize2(i8* %0, i64 %1) {
%3 = tail call i32 @ObjectSize2(i8* %0)
ret i32 %3
}
void xnarch_relay_tick(void) {}


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

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

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

LLVM IR (-O2):
define void @xnarch_relay_tick() {
ret void
}
/* Variables and functions */
bool nrf52_errata_155(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_155() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ onewire_reset(int);
int /*<<< orphan*/ onewire_send_byte(int, int);
int onewire_skip_rom(int pin) {
  if (!onewire_reset(pin)) {
    return 0;
  }
  onewire_send_byte(pin, 0xCC);
  return 1;
}


x86 assembly (clang, -O0):
<onewire_skip_rom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <onewire_reset@plt>
cmp    $0x0,%eax
jne    1148 <onewire_skip_rom+0x28>
movl   $0x0,-0x4(%rbp)
jmp    115c <onewire_skip_rom+0x3c>
mov    -0x8(%rbp),%edi
mov    $0xcc,%esi
call   1030 <onewire_send_byte@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onewire_skip_rom>:
push   %rbx
mov    %edi,%ebx
call   1040 <onewire_reset@plt>
test   %eax,%eax
je     113f <onewire_skip_rom+0x1f>
mov    %ebx,%edi
mov    $0xcc,%esi
call   1030 <onewire_send_byte@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @onewire_skip_rom(i32 %0) {
%2 = tail call i32 @onewire_reset(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @onewire_send_byte(i32 %0, i32 204)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ _next_permutation(int *, int);
void _permutation_sort(int *vet, int size) {
  while (_next_permutation(vet, size))
    ;
}


x86 assembly (clang, -O0):
<_permutation_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <_next_permutation@plt>
cmp    $0x0,%rax
je     113a <_permutation_sort+0x2a>
jmp    111f <_permutation_sort+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_permutation_sort>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <_next_permutation@plt>
test   %rax,%rax
jne    1120 <_permutation_sort+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_permutation_sort(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @_next_permutation(i32* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Clear();
int /*<<< orphan*/ DrawClipTri();
int /*<<< orphan*/ DrawTri();
int /*<<< orphan*/ Swap();
void Draw(void) {
  Clear();
  DrawTri();
  DrawClipTri();
  Swap();
  Clear();
}


x86 assembly (clang, -O0):
<Draw>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Clear@plt>
mov    $0x0,%al
call   1050 <DrawTri@plt>
mov    $0x0,%al
call   1060 <DrawClipTri@plt>
mov    $0x0,%al
call   1040 <Swap@plt>
mov    $0x0,%al
call   1030 <Clear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Draw>:
push   %rax
xor    %eax,%eax
call   1030 <Clear@plt>
xor    %eax,%eax
call   1050 <DrawTri@plt>
xor    %eax,%eax
call   1060 <DrawClipTri@plt>
xor    %eax,%eax
call   1040 <Swap@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Clear@plt>

LLVM IR (-O0):
define void @Draw() {
%1 = call i32 (...) @Clear()
%2 = call i32 (...) @DrawTri()
%3 = call i32 (...) @DrawClipTri()
%4 = call i32 (...) @Swap()
%5 = call i32 (...) @Clear()
ret void
}

LLVM IR (-O2):
define void @Draw() {
%1 = tail call i32 (...) @Clear()
%2 = tail call i32 (...) @DrawTri()
%3 = tail call i32 (...) @DrawClipTri()
%4 = tail call i32 (...) @Swap()
%5 = tail call i32 (...) @Clear()
ret void
}
unsigned int test_00(unsigned int *x, unsigned int *y, int i) {
  return (x[i + 0] - y[i + 0] - x[i + 4] - y[i + 4]) - i * 4;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
add    $0x0,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
add    $0x4,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
add    $0x4,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
movslq %edx,%rcx
mov    (%rdi,%rcx,4),%eax
mov    (%rsi,%rcx,4),%edx
lea    0x0(,%rcx,4),%r8d
add    0x10(%rdi,%rcx,4),%edx
sub    %r8d,%eax
add    0x10(%rsi,%rcx,4),%edx
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_00(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 = add nsw i32 %8, 0
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = load i32, i32* %11
%13 = load i32*, i32** %5
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 0
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
%18 = load i32, i32* %17
%19 = sub i32 %12, %18
%20 = load i32*, i32** %4
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %20, i64 %23
%25 = load i32, i32* %24
%26 = sub i32 %19, %25
%27 = load i32*, i32** %5
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %27, i64 %30
%32 = load i32, i32* %31
%33 = sub i32 %26, %32
%34 = load i32, i32* %6
%35 = mul nsw i32 %34, 4
%36 = sub i32 %33, %35
ret i32 %36
}

LLVM IR (-O2):
define i32 @test_00(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 %4
%8 = load i32, i32* %7
%9 = add nsw i32 %2, 4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = mul i32 %2, -4
%16 = add i32 %6, %15
%17 = add i32 %8, %12
%18 = add i32 %17, %14
%19 = sub i32 %16, %18
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ fatserror(char *);
void editLineNumberOverflow() {
  fatserror("edit script refers to line past end of file");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"edit script refers to line past end of file\00"
define void @editLineNumberOverflow() {
%1 = call i32 @fatserror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"edit script refers to line past end of file\00"
define void @editLineNumberOverflow() {
%1 = tail call i32 @fatserror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ work();
int main() {
  int t;
  scanf("%d", &t);
  do
    work();
  while (--t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1030 <work@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <work@plt>
addl   $0xffffffff,0x4(%rsp)
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %4
4: ; preds = %6, %0
%5 = call i32 (...) @work()
br label %6
6: ; preds = %4
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %4
4: ; preds = %4, %0
%5 = call i32 (...) @work()
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
store i32 %7, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4
ret i32 0
}
double det2(double a11, double a12, double a21, double a22) {
  return a11 * a22 - a12 * a21;
}


x86 assembly (clang, -O0):
<det2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<det2>:
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @det2(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %9, double %10, double %14)
ret double %15
}

LLVM IR (-O2):
define double @det2(double %0, double %1, double %2, double %3) {
%5 = fneg double %1
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x42() {
  Assert_real((isascii(66)),
              "/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_isascii.c",
              335, ("isascii should be 1 for B"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x42>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x14f,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for B\00"
define void @t_isascii_0x42() {
%1 = call i32 @isascii(i32 66)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 335, 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for B\00"
define void @t_isascii_0x42() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int same_col(room1, room2) { return ((room1 % 3) == (room2 % 3)); }


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

x86 assembly (clang, -O2):
<same_col>:
movslq %edi,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
movslq %esi,%rdx
imul   $0x55555556,%rdx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rax
add    %esi,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @same_col(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 = srem i32 %5, 3
%7 = load i32, i32* %4
%8 = srem i32 %7, 3
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @same_col(i32 %0, i32 %1) {
%3 = srem i32 %0, 3
%4 = srem i32 %1, 3
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, short);
void goto_xy(short x, short y) { printf("\033[%d;%dH", y, x); }


x86 assembly (clang, -O0):
<goto_xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
lea    0xecf(%rip),%rdi
movswl %ax,%esi
movswl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<goto_xy>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @goto_xy(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i16, i16* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i16 signext %5, i16 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @goto_xy(i16 signext %0, i16 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i16 signext %1, i16 signext %0)
ret void
}
void change_base(char *base) {
  if (*base == 'A')
    *base = 'G';
  else if (*base == 'G')
    *base = 'A';
  else if (*base == 'T')
    *base = 'C';
  else if (*base == 'C')
    *base = 'T';
}


x86 assembly (clang, -O0):
<change_base>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jne    1124 <change_base+0x24>
mov    -0x8(%rbp),%rax
movb   $0x47,(%rax)
jmp    1182 <change_base+0x82>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x47,%eax
jne    1140 <change_base+0x40>
mov    -0x8(%rbp),%rax
movb   $0x41,(%rax)
jmp    117d <change_base+0x7d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x54,%eax
jne    115c <change_base+0x5c>
mov    -0x8(%rbp),%rax
movb   $0x43,(%rax)
jmp    1178 <change_base+0x78>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x43,%eax
jne    1173 <change_base+0x73>
mov    -0x8(%rbp),%rax
movb   $0x54,(%rax)
jmp    1178 <change_base+0x78>
jmp    117d <change_base+0x7d>
jmp    1182 <change_base+0x82>
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_base>:
mov    (%rdi),%cl
add    $0xbf,%cl
cmp    $0x13,%cl
ja     112b <change_base+0x2b>
mov    $0x47,%al
movzbl %cl,%ecx
lea    0xeea(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x54,%al
jmp    1129 <change_base+0x29>
mov    $0x41,%al
jmp    1129 <change_base+0x29>
mov    $0x43,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @change_base(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 65
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %2
store i8 71, i8* %8
br label %33
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 71
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = load i8*, i8** %2
store i8 65, i8* %15
br label %32
16: ; preds = %9
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 84
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = load i8*, i8** %2
store i8 67, i8* %22
br label %31
23: ; preds = %16
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 67
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = load i8*, i8** %2
store i8 84, i8* %29
br label %30
30: ; preds = %28, %23
br label %31
31: ; preds = %30, %21
br label %32
32: ; preds = %31, %14
br label %33
33: ; preds = %32, %7
ret void
}

LLVM IR (-O2):
define void @change_base(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %8 [
i8 65, label %6
i8 71, label %3
i8 84, label %4
i8 67, label %5
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %4, %5, %3
%7 = phi i8 [ 65, %3 ], [ 84, %5 ], [ 67, %4 ], [ 71, %1 ]
store i8 %7, i8* %0
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
double effective_sample_size(double const *, int const);
double ln_evaluate_asymptotic_parametrised(double, double, double const);
double weighted_log_std(double const *, double const *, int const);
double ln_evaluate_asymptotic(const double *data, const double *weight,
                              const int n, const double bandwidth) {
  double Sigma = weighted_log_std(data, weight, n);
  double neff = effective_sample_size(weight, n);
  return ln_evaluate_asymptotic_parametrised(Sigma, neff, bandwidth);
}


x86 assembly (clang, -O0):
<ln_evaluate_asymptotic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <weighted_log_std@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <effective_sample_size@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1040 <ln_evaluate_asymptotic_parametrised@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_evaluate_asymptotic>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <weighted_log_std@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <effective_sample_size@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ln_evaluate_asymptotic_parametrised@plt>

LLVM IR (-O0):
define double @ln_evaluate_asymptotic(double* %0, double* %1, i32 %2, double %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store double %3, double* %8
%11 = load double*, double** %5
%12 = load double*, double** %6
%13 = load i32, i32* %7
%14 = call double @weighted_log_std(double* %11, double* %12, i32 %13)
store double %14, double* %9
%15 = load double*, double** %6
%16 = load i32, i32* %7
%17 = call double @effective_sample_size(double* %15, i32 %16)
store double %17, double* %10
%18 = load double, double* %9
%19 = load double, double* %10
%20 = load double, double* %8
%21 = call double @ln_evaluate_asymptotic_parametrised(double %18, double %19, double %20)
ret double %21
}

LLVM IR (-O2):
define double @ln_evaluate_asymptotic(double* %0, double* %1, i32 %2, double %3) {
%5 = tail call double @weighted_log_std(double* %0, double* %1, i32 %2)
%6 = tail call double @effective_sample_size(double* %1, i32 %2)
%7 = tail call double @ln_evaluate_asymptotic_parametrised(double %5, double %6, double %3)
ret double %7
}