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

/* Variables and functions */
int /*<<< orphan*/ funcb(int, int /*<<< orphan*/);
int setjmp(int /*<<< orphan*/);
void funca(char *s, jmp_buf env) {
  int i;
  i = setjmp(env);
  if (i == 4)
    return;
  funcb(++i, env);
  return;
}


x86 assembly (clang, -O0):
<funca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <setjmp@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jne    1149 <funca+0x29>
jmp    115a <funca+0x3a>
mov    -0x10(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x10(%rbp)
mov    -0xc(%rbp),%esi
call   1040 <funcb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funca>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
call   1030 <setjmp@plt>
cmp    $0x4,%eax
je     113b <funca+0x1b>
mov    %eax,%edi
add    $0x1,%edi
mov    %ebx,%esi
call   1040 <funcb@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @funca(i8* nocapture readnone %0, i32 %1) {
%3 = call i32 @setjmp(i32 %1)
%4 = icmp eq i32 %3, 4
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = add nsw i32 %3, 1
%7 = call i32 @funcb(i32 %6, i32 %1)
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Compile statement 3\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Compile statement 3\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Compile statement 3\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int sigsuspend(int /*<<< orphan*/ *);
int __pause(void) {
  sigset_t set;
  sigprocmask(0, NULL, &set);
  return sigsuspend(&set);
}


x86 assembly (clang, -O0):
<__pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x4(%rbp),%rdx
call   1030 <sigprocmask@plt>
lea    -0x4(%rbp),%rdi
call   1040 <sigsuspend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pause>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <sigprocmask@plt>
mov    %rbx,%rdi
call   1040 <sigsuspend@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__pause() {
%1 = alloca i32
%2 = call i32 @sigprocmask(i32 0, i32* null, i32* %1)
%3 = call i32 @sigsuspend(i32* %1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @__pause() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigprocmask(i32 0, i32* null, i32* %1)
%4 = call i32 @sigsuspend(i32* %1)
ret i32 %4
}
void EC_GROUP_set_generator(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_set_generator() {
ret void
}
/* Type definitions */
struct sim_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sim_state *);
int /*<<< orphan*/ sim_cleanup(struct sim_state *);
void free_sim_state(struct sim_state *state) {
  sim_cleanup(state);
  free(state);
}


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

x86 assembly (clang, -O2):
<free_sim_state>:
push   %rbx
mov    %rdi,%rbx
call   1040 <sim_cleanup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sim_state = type { i32 }
define void @free_sim_state(%struct.sim_state* %0) {
%2 = tail call i32 @sim_cleanup(%struct.sim_state* %0)
%3 = tail call i32 @free(%struct.sim_state* %0)
ret void
}
void _Jv_NewStringLatin1() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_NewStringLatin1() {
ret void
}
int maxi(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<maxi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maxi+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maxi+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxi>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @maxi(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @maxi(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t bjtime2gmtime(uint64_t ts) { return ts - 28800; }


x86 assembly (clang, -O0):
<bjtime2gmtime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x7080,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bjtime2gmtime>:
lea    -0x7080(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @bjtime2gmtime(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 28800
ret i64 %4
}

LLVM IR (-O2):
define i64 @bjtime2gmtime(i64 %0) {
%2 = add nsw i64 %0, -28800
ret i64 %2
}
void check_service_result_freshness(void) {}


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

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

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

LLVM IR (-O2):
define void @check_service_result_freshness() {
ret void
}
void BLZ_Invert(char *buffer, int length) {
  char *bottom, ch;
  bottom = buffer + length - 1;
  while (buffer < bottom) {
    ch = *buffer;
    *buffer++ = *bottom;
    *bottom-- = ch;
  }
}


x86 assembly (clang, -O0):
<BLZ_Invert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1165 <BLZ_Invert+0x65>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    111e <BLZ_Invert+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BLZ_Invert>:
movslq %esi,%rax
add    %rdi,%rax
add    $0xffffffffffffffff,%rax
cmp    %rdi,%rax
jbe    113c <BLZ_Invert+0x3c>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl -0x1(%rdi),%ecx
movzbl (%rax),%edx
mov    %dl,-0x1(%rdi)
mov    %cl,(%rax)
add    $0xffffffffffffffff,%rax
lea    0x1(%rdi),%rcx
cmp    %rax,%rdi
mov    %rcx,%rdi
jb     1120 <BLZ_Invert+0x20>
ret

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

LLVM IR (-O2):
define void @BLZ_Invert(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ugt i8* %5, %0
br i1 %6, label %7, label %15
7: ; preds = %2, %7
%8 = phi i8* [ %13, %7 ], [ %5, %2 ]
%9 = phi i8* [ %12, %7 ], [ %0, %2 ]
%10 = load i8, i8* %9
%11 = load i8, i8* %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %11, i8* %9
store i8 %10, i8* %8
%13 = getelementptr inbounds i8, i8* %8, i64 -1
%14 = icmp ult i8* %12, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %2
ret void
}
void termop_index(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      313, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x139,%r8d
lea    0xf37(%rip),%r9
lea    0xf3d(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_index>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf64(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x139,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_index = [13 x i8] c"termop_index\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_index(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 313, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.termop_index, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_index = [13 x i8] c"termop_index\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_index(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 313, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.termop_index, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Type definitions */
struct mount_attr {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, char const *, unsigned int, struct mount_attr *, size_t);
int sys_mount_setattr(int dfd, const char *path, unsigned int flags,
                      struct mount_attr *attr, size_t size) {
  return syscall(442, dfd, path, flags, attr, size);
}


x86 assembly (clang, -O0):
<sys_mount_setattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0x1ba,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_mount_setattr>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1ba,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.mount_attr = type { i32 }
define i32 @sys_mount_setattr(i32 %0, i8* %1, i32 %2, %struct.mount_attr* %3, i64 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca %struct.mount_attr*
%10 = alloca i64
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store %struct.mount_attr* %3, %struct.mount_attr** %9
store i64 %4, i64* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load %struct.mount_attr*, %struct.mount_attr** %9
%15 = load i64, i64* %10
%16 = call i32 @syscall(i32 442, i32 %11, i8* %12, i32 %13, %struct.mount_attr* %14, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.mount_attr = type { i32 }
define i32 @sys_mount_setattr(i32 %0, i8* %1, i32 %2, %struct.mount_attr* %3, i64 %4) {
%6 = tail call i32 @syscall(i32 442, i32 %0, i8* %1, i32 %2, %struct.mount_attr* %3, i64 %4)
ret i32 %6
}
/* Variables and functions */
double cos(double);
double sin(double);
int ptod2(double r, double t, double *x, double *y) {
  double tr;
  static double dtor = 1.7453292519943296e-2;
  tr = t * dtor;
  *x = r * cos(tr);
  *y = r * sin(tr);
  return 0;
}


x86 assembly (clang, -O0):
<ptod2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  0x2ee9(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptod2>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
mulsd  0xec5(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
movapd %xmm1,%xmm0
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@ptod2.dtor = internal global double 0x3F91DF46A2529D39
define i32 @ptod2(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load double, double* %6
%11 = load double, double* @ptod2.dtor
%12 = fmul double %10, %11
store double %12, double* %9
%13 = load double, double* %5
%14 = load double, double* %9
%15 = call double @cos(double %14)
%16 = fmul double %13, %15
%17 = load double*, double** %7
store double %16, double* %17
%18 = load double, double* %5
%19 = load double, double* %9
%20 = call double @sin(double %19)
%21 = fmul double %18, %20
%22 = load double*, double** %8
store double %21, double* %22
ret i32 0
}

LLVM IR (-O2):
define i32 @ptod2(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fmul double %1, 0x3F91DF46A2529D39
%6 = tail call double @cos(double %5)
%7 = fmul double %6, %0
store double %7, double* %2
%8 = tail call double @sin(double %5)
%9 = fmul double %8, %0
store double %9, double* %3
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *fp;
  fp = fopen("test.txt", "a");
  fprintf(fp, "Testing...\n");
  fp++;
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i32 1
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 11, i64 1, i32* %1)
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = tail call i32 @fclose(i32* %3)
ret i32 0
}
int HelpItem34(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem34() {
ret i32 0
}
void ft_striter(char *s, void (*f)(char *)) {
  int i;
  if (s && f) {
    i = 0;
    while (s[i]) {
      f((s + i));
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <ft_striter+0x63>
cmpq   $0x0,-0x10(%rbp)
je     1163 <ft_striter+0x63>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115e <ft_striter+0x5e>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rcx
add    %rcx,%rdi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <ft_striter+0x2d>
jmp    1163 <ft_striter+0x63>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6, %9
%10 = phi i64 [ %12, %9 ], [ 0, %6 ]
%11 = phi i8* [ %13, %9 ], [ %0, %6 ]
tail call void %1(i8* %11)
%12 = add nuw i64 %10, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %9
16: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(int, char *, char *);
int /*<<< orphan*/ strncpy(char *, unsigned char *, int);
int decode_comment(unsigned char *element, int element_len) {
  char comment[127];
  strncpy(comment, element, element_len);
  comment[element_len] = 0;
  lprintf(14, "Text: %s\r\n", comment);
  return 0;
}


x86 assembly (clang, -O0):
<decode_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x90(%rbp,%rax,1)
lea    -0x90(%rbp),%rdx
mov    $0xe,%edi
lea    0xe9c(%rip),%rsi
call   1040 <lprintf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_comment>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %esi,%ebx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,(%rsp,%rax,1)
lea    0xeb6(%rip),%rsi
mov    $0xe,%edi
mov    %r14,%rdx
call   1040 <lprintf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Text: %s\0D\0A\00"
define i32 @decode_comment(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [127 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [127 x i8], [127 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @strncpy(i8* %6, i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [127 x i8], [127 x i8]* %5, i64 0, i64 %11
store i8 0, i8* %12
%13 = getelementptr inbounds [127 x i8], [127 x i8]* %5, i64 0, i64 0
%14 = call i32 @lprintf(i32 14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Text: %s\0D\0A\00"
define i32 @decode_comment(i8* %0, i32 %1) {
%3 = alloca [127 x i8]
%4 = getelementptr inbounds [127 x i8], [127 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds [127 x i8], [127 x i8]* %3, i64 0, i64 %6
store i8 0, i8* %7
%8 = call i32 @lprintf(i32 14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void whitespace_test(void) {
  char *str;
  printf("whitspace:\n");
  printf("N=%d\n", 2);
  printf("min=%d\n", 4);
}


x86 assembly (clang, -O0):
<whitespace_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whitespace_test>:
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"whitspace:\0A\00"
@.str.1 = [6 x i8] c"N=%d\0A\00"
@.str.2 = [8 x i8] c"min=%d\0A\00"
define void @whitespace_test() {
%1 = alloca i8*
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"N=%d\0A\00"
@.str.2 = [8 x i8] c"min=%d\0A\00"
@str = [11 x i8] c"whitspace:\00"
define void @whitespace_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int do_test(int, char **);
int main() {
  int argc = 0;
  char *argv[] = {NULL};
  return do_test(argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <do_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <do_test@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1 x i8*]
%2 = bitcast [1 x i8*]* %1 to i8*
%3 = bitcast [1 x i8*]* %1 to i64*
store i64 0, i64* %3
%4 = getelementptr inbounds [1 x i8*], [1 x i8*]* %1, i64 0, i64 0
%5 = call i32 @do_test(i32 0, i8** %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d\n%d", a == b, a != b);
  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
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %esi,%esi
xor    %edx,%edx
cmp    (%rsp),%eax
sete   %sil
setne  %dl
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [6 x i8] c"%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
%10 = icmp ne i32 %6, %7
%11 = zext i1 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11)
ret i32 0
}
/* Variables and functions */
void bzero(void *ptr, size_t size) {
  unsigned long i;
  unsigned char *p = ptr;
  for (i = 0; i < size; ++i)
    p[i] = 0;
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1147 <bzero+0x47>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <bzero+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %rsi,%rsi
je     1124 <bzero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, size_t);
int /*<<< orphan*/ *stderr;
void message(char *msg, size_t n, FILE *ofile) {
  fprintf(stderr, msg, n);
  if (ofile != NULL) {
    fprintf(ofile, msg, n);
  }
}


x86 assembly (clang, -O0):
<message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <fprintf@plt>
cmpq   $0x0,-0x18(%rbp)
je     1157 <message+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
test   %r15,%r15
je     114b <message+0x3b>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32* null
define void @message(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i32*, i32** @stderr
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = call i32 @fprintf(i32* %7, i8* %8, i64 %9)
%11 = load i32*, i32** %6
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i32*, i32** %6
%15 = load i8*, i8** %4
%16 = load i64, i64* %5
%17 = call i32 @fprintf(i32* %14, i8* %15, i64 %16)
br label %18
18: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
@stderr = global i32* null
define void @message(i8* nocapture %0, i64 %1, i32* %2) {
%4 = load i32*, i32** @stderr
%5 = tail call i32 @fprintf(i32* %4, i8* %0, i64 %1)
%6 = icmp eq i32* %2, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @fprintf(i32* %2, i8* %0, i64 %1)
br label %9
9: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *printHello(void *threadId) {
  long tid;
  tid = (long)threadId;
  printf("Hello World! It's me, thread #%ld!\n", tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<printHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHello>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Hello World! It's me, thread #%ld!\0A\00"
define i8* @printHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [36 x i8] c"Hello World! It's me, thread #%ld!\0A\00"
define noalias i8* @printHello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Type definitions */
struct szl_obj {
  int dummy;
};
struct szl_interp {
  int dummy;
};

/* Variables and functions */
scalar_t__ szl_int_to_str(struct szl_interp *, struct szl_obj *);
scalar_t__ szl_str_to_wstr(struct szl_interp *, struct szl_obj *);
int szl_int_to_wstr(struct szl_interp *interp, struct szl_obj *obj) {
  return szl_int_to_str(interp, obj) && szl_str_to_wstr(interp, obj);
}


x86 assembly (clang, -O0):
<szl_int_to_wstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <szl_int_to_str@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1166 <szl_int_to_wstr+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <szl_str_to_wstr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<szl_int_to_wstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <szl_int_to_str@plt>
test   %rax,%rax
je     114c <szl_int_to_wstr+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <szl_str_to_wstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    114e <szl_int_to_wstr+0x2e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.szl_interp = type { i32 }
%struct.szl_obj = type { i32 }
define i32 @szl_int_to_wstr(%struct.szl_interp* %0, %struct.szl_obj* %1) {
%3 = alloca %struct.szl_interp*
%4 = alloca %struct.szl_obj*
store %struct.szl_interp* %0, %struct.szl_interp** %3
store %struct.szl_obj* %1, %struct.szl_obj** %4
%5 = load %struct.szl_interp*, %struct.szl_interp** %3
%6 = load %struct.szl_obj*, %struct.szl_obj** %4
%7 = call i64 @szl_int_to_str(%struct.szl_interp* %5, %struct.szl_obj* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load %struct.szl_interp*, %struct.szl_interp** %3
%11 = load %struct.szl_obj*, %struct.szl_obj** %4
%12 = call i64 @szl_str_to_wstr(%struct.szl_interp* %10, %struct.szl_obj* %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ false, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
%struct.szl_interp = type { i32 }
%struct.szl_obj = type { i32 }
define i32 @szl_int_to_wstr(%struct.szl_interp* %0, %struct.szl_obj* %1) {
%3 = tail call i64 @szl_int_to_str(%struct.szl_interp* %0, %struct.szl_obj* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @szl_str_to_wstr(%struct.szl_interp* %0, %struct.szl_obj* %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void macscp2_2() { puts("macscp2_2"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"macscp2_2\00"
define void @macscp2_2() {
%1 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"macscp2_2\00"
define void @macscp2_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
int indice_de_colonne(char c) { return c - 'a'; }


x86 assembly (clang, -O0):
<indice_de_colonne>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indice_de_colonne>:
lea    -0x61(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @indice_de_colonne(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 97
ret i32 %5
}

LLVM IR (-O2):
define i32 @indice_de_colonne(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -97
ret i32 %3
}
unsigned xrop3_98_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | D;
  stk2 = S & stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_98_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
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
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_98_1_1>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%esi
mov    %edi,%ecx
not    %cl
movzbl %cl,%ecx
not    %eax
and    %ecx,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_98_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i8 %0, -1
%6 = zext i8 %5 to i32
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ cause_bt();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void sig_segv_handler(int sig) {
  fprintf(stderr, "Caught signal %d :\n", sig);
  cause_bt();
  abort();
}


x86 assembly (clang, -O0):
<sig_segv_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1040 <cause_bt@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sig_segv_handler>:
push   %rax
mov    %edi,%edx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1040 <cause_bt@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Caught signal %d :\0A\00"
define void @sig_segv_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @cause_bt()
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Caught signal %d :\0A\00"
define void @sig_segv_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (...) @cause_bt()
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_dobldobl_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(237, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_dobldobl_target_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xed,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dobldobl_target_solutions>:
mov    $0xed,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_dobldobl_target_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 237, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_dobldobl_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 237, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int NoSoundDrv_PCM_Init(int *mixrate, int *numchannels, int *samplebits,
                        void *initdata) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @NoSoundDrv_PCM_Init(i32* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @NoSoundDrv_PCM_Init(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int int64_t;

/* Variables and functions */
int64_t time_diff(const struct timeval t1, const struct timeval t2) {
  return ((int64_t)t1.tv_sec - t2.tv_sec) * 1000000 +
         ((int64_t)t1.tv_usec - t2.tv_usec);
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0xf4240,%eax,%eax
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
mov    %rdi,%rcx
shr    $0x20,%rcx
sub    %esi,%edi
shr    $0x20,%rsi
imul   $0xf4240,%edi,%eax
sub    %esi,%ecx
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @time_diff(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %3 to i64*
store i64 %0, i64* %5
%6 = bitcast %struct.timeval* %4 to i64*
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %8, %10
%12 = mul nsw i32 %11, 1000000
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%16 = load i32, i32* %15
%17 = sub nsw i32 %14, %16
%18 = add nsw i32 %12, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @time_diff(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i64 %0, 32
%5 = trunc i64 %4 to i32
%6 = trunc i64 %1 to i32
%7 = lshr i64 %1, 32
%8 = trunc i64 %7 to i32
%9 = sub nsw i32 %3, %6
%10 = mul nsw i32 %9, 1000000
%11 = sub i32 %5, %8
%12 = add nsw i32 %11, %10
ret i32 %12
}