xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *strdup(char const *);
int /*<<< orphan*/ system(char *);
void MkDir2(const char *dname) {
  char temp[512];
  sprintf(temp, "mkdir %s", strdup(dname));
  system(temp);
}


x86 assembly (clang, -O0):
<MkDir2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    -0x218(%rbp),%rdi
mov    %rax,%rdx
lea    0xe99(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MkDir2>:
push   %rbx
sub    $0x200,%rsp
call   1050 <strdup@plt>
lea    0xebc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"mkdir %s\00"
define void @MkDir2(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%9 = call i32 @system(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"mkdir %s\00"
define void @MkDir2(i8* nocapture %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = tail call i8* @strdup(i8* %0)
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int ArgNum();
scalar_t__ GetFlag(int);
int Cnd_GtF(void) {
  int v = ArgNum();
  return (GetFlag(v) > GetFlag(ArgNum()));
}


x86 assembly (clang, -O0):
<Cnd_GtF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetFlag@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_GtF>:
push   %rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setg   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cnd_GtF() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i64 @GetFlag(i32 %3)
%5 = call i32 (...) @ArgNum()
%6 = call i64 @GetFlag(i32 %5)
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @Cnd_GtF() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i64 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = tail call i64 @GetFlag(i32 %3)
%5 = icmp sgt i64 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct t_weechat_plugin {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plugin_script_config_read(struct t_weechat_plugin *);
int plugin_script_config_cb(const void *pointer, void *data, const char *option,
                            const char *value) {
  struct t_weechat_plugin *plugin;
  (void)data;
  (void)option;
  (void)value;
  plugin = (struct t_weechat_plugin *)pointer;
  plugin_script_config_read(plugin);
  return 0;
}


x86 assembly (clang, -O0):
<plugin_script_config_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <plugin_script_config_read@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.t_weechat_plugin = type { i32 }
define i32 @plugin_script_config_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.t_weechat_plugin*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to %struct.t_weechat_plugin*
store %struct.t_weechat_plugin* %14, %struct.t_weechat_plugin** %9
%15 = load %struct.t_weechat_plugin*, %struct.t_weechat_plugin** %9
%16 = call i32 @plugin_script_config_read(%struct.t_weechat_plugin* %15)
ret i32 0
}

LLVM IR (-O2):
%struct.t_weechat_plugin = type { i32 }
define i32 @plugin_script_config_cb(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = bitcast i8* %0 to %struct.t_weechat_plugin*
%6 = tail call i32 @plugin_script_config_read(%struct.t_weechat_plugin* %5)
ret i32 0
}
/* Variables and functions */
char getchar();
response() {
  char c;
  c = getchar();
  if (c != '\n')
    while (getchar() != '\n')
      ;
  else
    c = 'n';
  return (c);
}


x86 assembly (clang, -O0):
<response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1151 <response+0x41>
jmp    1134 <response+0x24>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     114c <response+0x3c>
jmp    1134 <response+0x24>
jmp    1155 <response+0x45>
movb   $0x6e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<response>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
mov    $0x6e,%eax
cmp    $0xa,%bl
je     113e <response+0x2e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1130 <response+0x20>
movsbl %bl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @response() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %13
6: ; preds = %0
br label %7
7: ; preds = %11, %6
%8 = call signext i8 (...) @getchar()
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
br label %14
13: ; preds = %0
store i8 110, i8* %1
br label %14
14: ; preds = %13, %12
%15 = load i8, i8* %1
%16 = sext i8 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @response() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = sext i8 %1 to i32
br label %8
8: ; preds = %6, %0
%9 = phi i32 [ 110, %0 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int chislo;
  scanf("%d", &chislo);
  printf("%d", prime(chislo));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <prime@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
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)
%4 = load i32, i32* %2
%5 = call i32 @prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
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)
%4 = load i32, i32* %1
%5 = call i32 @prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int main() {
  double a = 2;
  char c = ' ';
  char d = '\0';
  int kong = 32;
  printf("%f\n", a);
  printf("一个空字符串%c在这里\n", c);
  printf("一个空字符串%c在这里\n", d);
  printf("一个空字符串%s在这里\n", kong);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movb   $0x20,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
movl   $0x20,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsbl -0x9(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0xa(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [31 x i8] c"\E4\B8\80\E4\B8\AA\E7\A9\BA\E5\AD\97\E7\AC\A6\E4\B8\B2%c\E5\9C\A8\E8\BF\99\E9\87\8C\0A\00"
@.str.2 = [31 x i8] c"\E4\B8\80\E4\B8\AA\E7\A9\BA\E5\AD\97\E7\AC\A6\E4\B8\B2%s\E5\9C\A8\E8\BF\99\E9\87\8C\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store double 2.000000e+00, double* %1
store i8 32, i8* %2
store i8 0, i8* %3
store i32 32, i32* %4
%5 = load double, double* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [31 x i8] c"\E4\B8\80\E4\B8\AA\E7\A9\BA\E5\AD\97\E7\AC\A6\E4\B8\B2%c\E5\9C\A8\E8\BF\99\E9\87\8C\0A\00"
@.str.2 = [31 x i8] c"\E4\B8\80\E4\B8\AA\E7\A9\BA\E5\AD\97\E7\AC\A6\E4\B8\B2%s\E5\9C\A8\E8\BF\99\E9\87\8C\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 2.000000e+00)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 32)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 32)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ get_eip(int /*<<< orphan*/);
int /*<<< orphan*/ get_instruction(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ procprint(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void proc_ins_eip(pid_t pid) {
  procprint("current ins:%x, current eip:%x\n",
            get_instruction(pid, get_eip(pid)), get_eip(pid));
}


x86 assembly (clang, -O0):
<proc_ins_eip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_eip@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <get_instruction@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_eip@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe96(%rip),%rdi
call   1050 <procprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_ins_eip>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <get_eip@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <get_instruction@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <get_eip@plt>
lea    0xead(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <procprint@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"current ins:%x, current eip:%x\0A\00"
define void @proc_ins_eip(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @get_eip(i32 %4)
%6 = call i32 @get_instruction(i32 %3, i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @get_eip(i32 %7)
%9 = call i32 @procprint(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"current ins:%x, current eip:%x\0A\00"
define void @proc_ins_eip(i32 %0) {
%2 = tail call i32 @get_eip(i32 %0)
%3 = tail call i32 @get_instruction(i32 %0, i32 %2)
%4 = tail call i32 @get_eip(i32 %0)
%5 = tail call i32 @procprint(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int charger_close() {
  printf("Charnger close\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Charnger close\0A\00"
define i32 @charger_close() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Charnger close\00"
define i32 @charger_close() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
extern int cmp(char **a, char **b) { return strcmp(*a, *b); }


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
/* Variables and functions */
double probZUT(double);
double probZLT(double z) { return 1.0 - probZUT(z); }


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

x86 assembly (clang, -O2):
<probZLT>:
push   %rax
call   1030 <probZUT@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @probZLT(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @probZUT(double %3)
%5 = fsub double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @probZLT(double %0) {
%2 = tail call double @probZUT(double %0)
%3 = fsub double 1.000000e+00, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ japi_setfocus(int);
void j_setfocus(int arg0) { japi_setfocus(arg0); }


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

x86 assembly (clang, -O2):
<j_setfocus>:
jmp    1030 <japi_setfocus@plt>

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

LLVM IR (-O2):
define void @j_setfocus(i32 %0) {
%2 = tail call i32 @japi_setfocus(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(unsigned int);
void ft_putnbr_X(unsigned int n) {
  if (n > 15)
    ft_putnbr_X(n / 16);
  if ((n % 16) + 48 > '9')
    ft_putchar((n % 16) + 55);
  else
    ft_putchar((n % 16) + 48);
}


x86 assembly (clang, -O0):
<ft_putnbr_X>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jbe    1140 <ft_putnbr_X+0x20>
mov    -0x4(%rbp),%edi
shr    $0x4,%edi
call   1040 <ft_putnbr_X@plt>
mov    -0x4(%rbp),%eax
and    $0xf,%eax
add    $0x30,%eax
cmp    $0x39,%eax
jbe    1165 <ft_putnbr_X+0x45>
mov    -0x4(%rbp),%edi
and    $0xf,%edi
add    $0x37,%edi
call   1030 <ft_putchar@plt>
jmp    1173 <ft_putnbr_X+0x53>
mov    -0x4(%rbp),%edi
and    $0xf,%edi
add    $0x30,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_X>:
push   %rbx
mov    %edi,%ebx
cmp    $0x10,%edi
jb     1132 <ft_putnbr_X+0x12>
mov    %ebx,%edi
shr    $0x4,%edi
call   1040 <ft_putnbr_X@plt>
and    $0xf,%ebx
lea    0x30(%rbx),%eax
add    $0x37,%ebx
cmp    $0x3a,%eax
cmovb  %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putnbr_X(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 15
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = udiv i32 %6, 16
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 16
%11 = add i32 %10, 48
%12 = icmp ugt i32 %11, 57
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i32, i32* %2
%15 = urem i32 %14, 16
%16 = add i32 %15, 55
%17 = call i32 @ft_putchar(i32 %16)
br label %23
18: ; preds = %8
%19 = load i32, i32* %2
%20 = urem i32 %19, 16
%21 = add i32 %20, 48
%22 = call i32 @ft_putchar(i32 %21)
br label %23
23: ; preds = %18, %13
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_X(i32 %0) {
%2 = icmp ugt i32 %0, 15
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i32 %0, 4
tail call void @ft_putnbr_X(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = and i32 %0, 15
%7 = or i32 %6, 48
%8 = icmp ugt i32 %7, 57
%9 = add nuw nsw i32 %6, 55
%10 = select i1 %8, i32 %9, i32 %7
%11 = tail call i32 @ft_putchar(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void exitMessage(char *msg) {
  printf("> ERROR: %s\n", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<exitMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitMessage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"> ERROR: %s\0A\00"
define void @exitMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"> ERROR: %s\0A\00"
define void @exitMessage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int lace_builtin_lace_main(unsigned int, char **, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *);
int main_lace(unsigned argc, char **argv) {
  return lace_builtin_lace_main(argc, argv, NULL, NULL);
}


x86 assembly (clang, -O0):
<main_lace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <lace_builtin_lace_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_lace>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <lace_builtin_lace_main@plt>

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

LLVM IR (-O2):
define i32 @main_lace(i32 %0, i8** %1) {
%3 = tail call i32 @lace_builtin_lace_main(i32 %0, i8** %1, i32* null, i32* null)
ret i32 %3
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int match(const char *s1, const char *s2) { return strcmp(s1, s2) == 0; }


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @match(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int ssize_t;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int read(int, unsigned char *, int);
int recv_control(int fd) {
  unsigned char c;
  const ssize_t size = read(fd, &c, sizeof(c));
  if (size == sizeof(c))
    return c;
  else
    return -1;
}


x86 assembly (clang, -O0):
<recv_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x10(%rbp)
movslq -0x10(%rbp),%rax
cmp    $0x1,%rax
jne    1149 <recv_control+0x39>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <recv_control+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_control>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movzbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @recv_control(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @read(i32 %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = icmp eq i64 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
store i32 %13, i32* %2
br label %15
14: ; preds = %1
store i32 -1, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @recv_control(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ swap(char *, char *);
char *reverse_string(char *test_string, int string_size) {
  char *pb = test_string;
  char *pe = pb + string_size;
  while (pb < pe) {
    swap(pb, pe);
    pb++;
    pe--;
  }
  return test_string;
}


x86 assembly (clang, -O0):
<reverse_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    116e <reverse_string+0x5e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <swap@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1136 <reverse_string+0x26>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1148 <reverse_string+0x38>
mov    %esi,%r15d
add    %r14,%r15
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <swap@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
cmp    %r15,%rbx
jb     1130 <reverse_string+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @reverse_string(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
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8* %11, i8** %6
br label %12
12: ; preds = %16, %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = icmp ult i8* %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = call i32 @swap(i8* %17, i8* %18)
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %5
%22 = load i8*, i8** %6
%23 = getelementptr inbounds i8, i8* %22, i32 -1
store i8* %23, i8** %6
br label %12
24: ; preds = %12
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @reverse_string(i8* returned %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
br label %7
7: ; preds = %4, %7
%8 = phi i8* [ %12, %7 ], [ %6, %4 ]
%9 = phi i8* [ %11, %7 ], [ %0, %4 ]
%10 = tail call i32 @swap(i8* %9, i8* %8)
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = getelementptr inbounds i8, i8* %8, i64 -1
%13 = icmp ult i8* %11, %12
br i1 %13, label %7, label %14
14: ; preds = %7, %2
ret i8* %0
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ irc_notify_hook_timer_ison();
void irc_config_change_network_notify_check_ison(
    void *data, struct t_config_option *option) {
  (void)data;
  (void)option;
  irc_notify_hook_timer_ison();
}


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

x86 assembly (clang, -O2):
<irc_config_change_network_notify_check_ison>:
xor    %eax,%eax
jmp    1030 <irc_notify_hook_timer_ison@plt>

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @irc_config_change_network_notify_check_ison(i8* %0, %struct.t_config_option* %1) {
%3 = alloca i8*
%4 = alloca %struct.t_config_option*
store i8* %0, i8** %3
store %struct.t_config_option* %1, %struct.t_config_option** %4
%5 = load i8*, i8** %3
%6 = load %struct.t_config_option*, %struct.t_config_option** %4
%7 = call i32 (...) @irc_notify_hook_timer_ison()
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @irc_config_change_network_notify_check_ison(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1) {
%3 = tail call i32 (...) @irc_notify_hook_timer_ison()
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *skin_buffer_alloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<skin_buffer_alloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @skin_buffer_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
unsigned short map2check_non_det_ushort() { return 0; }


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

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

LLVM IR (-O0):
define zeroext i16 @map2check_non_det_ushort() {
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @map2check_non_det_ushort() {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_setdtr();
int /*<<< orphan*/ waitms(int);
void setdtr(void) {
  waitms(50);
  serial_setdtr();
  waitms(50);
}


x86 assembly (clang, -O0):
<setdtr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
call   1030 <waitms@plt>
mov    $0x0,%al
call   1040 <serial_setdtr@plt>
mov    $0x32,%edi
call   1030 <waitms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setdtr>:
push   %rax
mov    $0x32,%edi
call   1030 <waitms@plt>
xor    %eax,%eax
call   1040 <serial_setdtr@plt>
mov    $0x32,%edi
pop    %rax
jmp    1030 <waitms@plt>

LLVM IR (-O0):
define void @setdtr() {
%1 = call i32 @waitms(i32 50)
%2 = call i32 (...) @serial_setdtr()
%3 = call i32 @waitms(i32 50)
ret void
}

LLVM IR (-O2):
define void @setdtr() {
%1 = tail call i32 @waitms(i32 50)
%2 = tail call i32 (...) @serial_setdtr()
%3 = tail call i32 @waitms(i32 50)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t le32_to_cpupu(const uint32_t *p) {
  const uint8_t *p1 = (const uint8_t *)p;
  return p1[0] | (p1[1] << 8) | (p1[2] << 16) | (p1[3] << 24);
}


x86 assembly (clang, -O0):
<le32_to_cpupu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le32_to_cpupu>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @le32_to_cpupu(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %7, %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 16
%17 = or i32 %12, %16
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = shl i32 %20, 24
%22 = or i32 %17, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @le32_to_cpupu(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %6, %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = shl i32 %12, 24
%14 = or i32 %10, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ logl(int);
long double log1pl(long double x) { logl(1 + x); }


x86 assembly (clang, -O0):
<log1pl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fld1
faddp  %st,%st(1)
fnstcw -0x26(%rbp)
movzwl -0x26(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x28(%rbp)
fldcw  -0x28(%rbp)
fistpl -0x24(%rbp)
fldcw  -0x26(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <logl@plt>
fldt   -0x10(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1pl>:
push   %rax
fldt   0x10(%rsp)
fld1
faddp  %st,%st(1)
fnstcw (%rsp)
movzwl (%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x2(%rsp)
fldcw  0x2(%rsp)
fistpl 0x4(%rsp)
fldcw  (%rsp)
mov    0x4(%rsp),%edi
call   1030 <logl@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
define x86_fp80 @log1pl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %3
%5 = fadd x86_fp80 0xK3FFF8000000000000000, %4
%6 = fptosi x86_fp80 %5 to i32
%7 = call i32 @logl(i32 %6)
%8 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @log1pl(x86_fp80 %0) {
%2 = fadd x86_fp80 %0, 0xK3FFF8000000000000000
%3 = fptosi x86_fp80 %2 to i32
%4 = tail call i32 @logl(i32 %3)
ret x86_fp80 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_list_sort();
int main(int argc, const char *argv[]) {
  test_list_sort();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_list_sort()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void writeln(char str[], int value) { printf("%s %d\n", str, value); }


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

x86 assembly (clang, -O2):
<writeln>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %d\0A\00"
define void @writeln(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
void nrf24l01p_irq_rx_dr_handle() {}


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

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

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

LLVM IR (-O2):
define void @nrf24l01p_irq_rx_dr_handle() {
ret void
}
/* Variables and functions */
char *_map_file(char const *, int);
char *map_file(char const *filename) { return _map_file(filename, 1); }


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

x86 assembly (clang, -O2):
<map_file>:
mov    $0x1,%esi
jmp    1030 <_map_file@plt>

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

LLVM IR (-O2):
define i8* @map_file(i8* %0) {
%2 = tail call i8* @_map_file(i8* %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ mintaka_state_run();
void mintaka_state_run_() { mintaka_state_run(); }


x86 assembly (clang, -O0):
<mintaka_state_run_>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mintaka_state_run@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mintaka_state_run_>:
xor    %eax,%eax
jmp    1030 <mintaka_state_run@plt>

LLVM IR (-O0):
define void @mintaka_state_run_() {
%1 = call i32 (...) @mintaka_state_run()
ret void
}

LLVM IR (-O2):
define void @mintaka_state_run_() {
%1 = tail call i32 (...) @mintaka_state_run()
ret void
}
unsigned char fn1(unsigned char a) { return a >> ~6; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xfffffff9,%ecx
sar    %cl,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @fn1(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, -7
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @fn1(i8 zeroext %0) {
ret i8 poison
}
/* Type definitions */
typedef int dev_t;
typedef scalar_t__ dev;

/* Variables and functions */
unsigned new_encode_dev(dev_t dev) {
  unsigned v = 0xff;
  unsigned major = ((unsigned int)((dev) >> 20));
  unsigned minor = ((unsigned int)((dev) & ((1U << 20) - 1)));
  return (minor & 0xff) | (major << 8) | ((minor & ~v) << 12);
}


x86 assembly (clang, -O0):
<new_encode_dev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x14,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
shl    $0xc,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_encode_dev>:
movzbl %dil,%ecx
mov    %edi,%eax
sar    $0xc,%eax
and    $0xffffff00,%eax
or     %ecx,%eax
shl    $0xc,%edi
and    $0xfff00000,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @new_encode_dev(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 255, i32* %3
%6 = load i32, i32* %2
%7 = ashr i32 %6, 20
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = and i32 %8, 1048575
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = and i32 %10, 255
%12 = load i32, i32* %4
%13 = shl i32 %12, 8
%14 = or i32 %11, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %3
%17 = xor i32 %16, -1
%18 = and i32 %15, %17
%19 = shl i32 %18, 12
%20 = or i32 %14, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @new_encode_dev(i32 %0) {
%2 = and i32 %0, 255
%3 = ashr i32 %0, 12
%4 = and i32 %3, -256
%5 = or i32 %4, %2
%6 = shl i32 %0, 12
%7 = and i32 %6, -1048576
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void to_binary(unsigned long n) {
  int r;
  r = n % 2;
  if (n >= 2)
    to_binary(n / 2);
  putchar(r == 0 ? '0' : '1');
  return;
}


x86 assembly (clang, -O0):
<to_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %eax,-0xc(%rbp)
cmpq   $0x2,-0x8(%rbp)
jb     114f <to_binary+0x2f>
mov    -0x8(%rbp),%rdi
shr    $0x1,%rdi
call   1040 <to_binary@plt>
mov    -0xc(%rbp),%edx
mov    $0x31,%eax
mov    $0x30,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_binary>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%rdi
jb     1135 <to_binary+0x15>
mov    %rbx,%rdi
shr    %rdi
call   1040 <to_binary@plt>
and    $0x1,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @to_binary(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = urem i64 %4, 2
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i64, i64* %2
%8 = icmp uge i64 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* %2
%11 = udiv i64 %10, 2
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 48, i32 49
%17 = trunc i32 %16 to i8
%18 = call i32 @putchar(i8 signext %17)
ret void
}

LLVM IR (-O2):
define void @to_binary(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i64 %0, 1
tail call void @to_binary(i64 %4)
br label %5
5: ; preds = %3, %1
%6 = and i64 %0, 1
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8 48, i8 49
%9 = tail call i32 @putchar(i8 signext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_98() {
  Assert_real((isqrt(98) == 9),
              "/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/stdlib/isqrt.c",
              495, ("Integer square root of 98 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_98>:
push   %rbp
mov    %rsp,%rbp
mov    $0x62,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1ef,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_98>:
push   %rax
mov    $0x62,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1ef,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 98 should be 9\00"
define void @t_sqrt_98() {
%1 = call i32 @isqrt(i32 98)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 98 should be 9\00"
define void @t_sqrt_98() {
%1 = tail call i32 @isqrt(i32 98)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int);
void mmap_free(void *ptr, int size) { munmap(ptr, size); }


x86 assembly (clang, -O0):
<mmap_free>:
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 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmap_free>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @mmap_free(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
ret void
}
double log10(double x) { return 0; }


x86 assembly (clang, -O0):
<log10>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @log10(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @log10(double %0) {
ret double 0.000000e+00
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
struct timespec msec_to_timespec(unsigned int msec) {
  struct timespec ts;
  ts.tv_sec = msec / 1000;
  ts.tv_nsec = (msec % 1000) * 1000000;
  return ts;
}


x86 assembly (clang, -O0):
<msec_to_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msec_to_timespec>:
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rcx
shr    $0x26,%rcx
imul   $0x3e8,%ecx,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
shl    $0x20,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @msec_to_timespec(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = udiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %3
%8 = urem i32 %7, 1000
%9 = mul i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 %9, i32* %10
%11 = bitcast %struct.timespec* %2 to i64*
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @msec_to_timespec(i32 %0) {
%2 = udiv i32 %0, 1000
%3 = urem i32 %0, 1000
%4 = mul nuw nsw i32 %3, 1000000
%5 = zext i32 %4 to i64
%6 = shl nuw nsw i64 %5, 32
%7 = zext i32 %2 to i64
%8 = or i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int printUsage(char *execName) {
  printf("VGM OPNA->OPNB converter"
         "Usage: %s file.vgm\n",
         execName);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"VGM OPNA->OPNB converterUsage: %s file.vgm\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [44 x i8] c"VGM OPNA->OPNB converterUsage: %s file.vgm\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}