xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ CloseOutputFile();
int /*<<< orphan*/ put_bit(int);
void CloseCoder(void) {
  int i;
  put_bit(1);
  for (i = 0; i < 7; i++)
    put_bit(0);
  CloseOutputFile();
}


x86 assembly (clang, -O0):
<CloseCoder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <put_bit@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jge    1158 <CloseCoder+0x38>
xor    %edi,%edi
call   1040 <put_bit@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <CloseCoder+0x19>
mov    $0x0,%al
call   1030 <CloseOutputFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CloseCoder>:
push   %rax
mov    $0x1,%edi
call   1040 <put_bit@plt>
xor    %edi,%edi
call   1040 <put_bit@plt>
xor    %edi,%edi
call   1040 <put_bit@plt>
xor    %edi,%edi
call   1040 <put_bit@plt>
xor    %edi,%edi
call   1040 <put_bit@plt>
xor    %edi,%edi
call   1040 <put_bit@plt>
xor    %edi,%edi
call   1040 <put_bit@plt>
xor    %edi,%edi
call   1040 <put_bit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CloseOutputFile@plt>

LLVM IR (-O0):
define void @CloseCoder() {
%1 = alloca i32
%2 = call i32 @put_bit(i32 1)
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 7
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @put_bit(i32 0)
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = call i32 (...) @CloseOutputFile()
ret void
}

LLVM IR (-O2):
define void @CloseCoder() {
%1 = tail call i32 @put_bit(i32 1)
%2 = tail call i32 @put_bit(i32 0)
%3 = tail call i32 @put_bit(i32 0)
%4 = tail call i32 @put_bit(i32 0)
%5 = tail call i32 @put_bit(i32 0)
%6 = tail call i32 @put_bit(i32 0)
%7 = tail call i32 @put_bit(i32 0)
%8 = tail call i32 @put_bit(i32 0)
%9 = tail call i32 (...) @CloseOutputFile()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int raw_num_regs(uint8_t r_type) {
  switch (r_type) {
  case 0x00:
    return (0x00 + 1);
  case 0x01:
    return (0x07 + 1);
  case 0x02:
    return (0x14 + 1);
  case 0x03:
    return ((0x80 + 31) + 1);
  case 0x04:
    return (0x11 + 1);
  case 0x05:
    return (0x04 + 1);
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<raw_num_regs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x5,%rax
ja     1174 <raw_num_regs+0x74>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    117b <raw_num_regs+0x7b>
movl   $0x8,-0x4(%rbp)
jmp    117b <raw_num_regs+0x7b>
movl   $0x15,-0x4(%rbp)
jmp    117b <raw_num_regs+0x7b>
movl   $0xa0,-0x4(%rbp)
jmp    117b <raw_num_regs+0x7b>
movl   $0x12,-0x4(%rbp)
jmp    117b <raw_num_regs+0x7b>
movl   $0x5,-0x4(%rbp)
jmp    117b <raw_num_regs+0x7b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_num_regs>:
mov    $0xffffffff,%eax
cmp    $0x5,%edi
ja     1117 <raw_num_regs+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @raw_num_regs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
]
5: ; preds = %1
store i32 1, i32* %2
br label %12
6: ; preds = %1
store i32 8, i32* %2
br label %12
7: ; preds = %1
store i32 21, i32* %2
br label %12
8: ; preds = %1
store i32 160, i32* %2
br label %12
9: ; preds = %1
store i32 18, i32* %2
br label %12
10: ; preds = %1
store i32 5, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.raw_num_regs = [6 x i32] [i32 1, i32 8, i32 21, i32 160, i32 18, i32 5]
define i32 @raw_num_regs(i32 %0) {
%2 = icmp ult i32 %0, 6
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.raw_num_regs, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ process_file(char *);
int main(int argc, char **argv) {
  if (argc != 3) {
    printf("Usage ./memory_manager allocation_seq_file allocation_file\n");
    exit(0);
  }
  process_file(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     115c <main+0x2c>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <process_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <process_file@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage ./memory_manager allocation_seq_file allocation_file\0A\00"
define i32 @main(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 = icmp ne i32 %5, 3
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @process_file(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@str = [59 x i8] c"Usage ./memory_manager allocation_seq_file allocation_file\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @process_file(i8* %9)
ret i32 0
}
void mem_free(p) void *p;
{
  mem_free_debug(p,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/JoshuaSBrown/"
                 "OPV_MonteCarloCode/refs/heads/master/CodeFix5/Code/MEM/mem.c",
                 296);
}


x86 assembly (clang, -O0):
<mem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x128,%edx
mov    $0x0,%al
call   1030 <mem_free_debug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_free>:
lea    0xee9(%rip),%rsi
mov    $0x128,%edx
xor    %eax,%eax
jmp    1030 <mem_free_debug@plt>

LLVM IR (-O0):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/master/CodeFix5/Code/MEM/mem.c\00"
define void @mem_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mem_free_debug to i32 (i8*, i8*, i32, ...)*)(i8* %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 296)
ret void
}

LLVM IR (-O2):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/master/CodeFix5/Code/MEM/mem.c\00"
define void @mem_free(i8* %0) {
%2 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mem_free_debug to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 296)
ret void
}
mvi(op, to, from) int op, to, from;
{
  emit(op);
  emit(to);
  emit(from);
}


x86 assembly (clang, -O0):
<mvi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <emit@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <emit@plt>
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1030 <emit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvi>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
xor    %eax,%eax
call   1030 <emit@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <emit@plt>
mov    %ebx,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <emit@plt>

LLVM IR (-O0):
define i32 @mvi(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %8)
%10 = load i32, i32* %6
%11 = call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %10)
%12 = load i32, i32* %7
%13 = call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
define i32 @mvi(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %0)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %1)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pack(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unpack(int);
int main() {
  printf("testing with TPL_FILE:\n");
  pack(0);
  unpack(0);
  printf("testing with TPL_FD:\n");
  pack(1);
  unpack(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <pack@plt>
xor    %edi,%edi
call   1050 <unpack@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <pack@plt>
mov    $0x1,%edi
call   1050 <unpack@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"testing with TPL_FILE:\0A\00"
@.str.1 = [22 x i8] c"testing with TPL_FD:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @pack(i32 0)
%4 = call i32 @unpack(i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @pack(i32 1)
%7 = call i32 @unpack(i32 1)
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"testing with TPL_FILE:\00"
@str.2 = [21 x i8] c"testing with TPL_FD:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @pack(i32 0)
%3 = tail call i32 @unpack(i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @pack(i32 1)
%6 = tail call i32 @unpack(i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ matchfcb_exact(int, int, char *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int bfopen(int drive, int user, char *n83) {
  if (matchfcb_exact(drive, user, n83, 0, 0))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<bfopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <matchfcb_exact@plt>
cmp    $0x0,%rax
je     114d <bfopen+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <bfopen+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfopen>:
push   %rax
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <matchfcb_exact@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bfopen(i32 %0, i32 %1, i8* %2) {
%4 = tail call i64 @matchfcb_exact(i32 %0, i32 %1, i8* %2, i32 0, i32 0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void print_usage(char *progname) {
  fprintf(stdout,
          "Enable system attention/fault indicators.\n"
          "\nUsage : %s -f [<loc_code>]\n"
          "\t-f : Fault indicator\n"
          "\t-t : Truncate location code if necessary\n"
          "\t-h : Print this message and exit\n"
          "\n\tloc_code : Location code\n",
          progname);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [196 x i8] c"Enable system attention/fault indicators.\0A\0AUsage : %s -f [<loc_code>]\0A\09-f : Fault indicator\0A\09-t : Truncate location code if necessary\0A\09-h : Print this message and exit\0A\0A\09loc_code : Location code\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [196 x i8] c"Enable system attention/fault indicators.\0A\0AUsage : %s -f [<loc_code>]\0A\09-f : Fault indicator\0A\09-t : Truncate location code if necessary\0A\09-h : Print this message and exit\0A\0A\09loc_code : Location code\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ condition_alphabet(char);
scalar_t__ condition_numeric(char);
int condition_alphanumeric(char c) {
  return condition_alphabet(c) || condition_numeric(c);
}


x86 assembly (clang, -O0):
<condition_alphanumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <condition_alphabet@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <condition_alphanumeric+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <condition_numeric@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_alphanumeric>:
push   %rbx
mov    %edi,%ebx
call   1030 <condition_alphabet@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <condition_alphanumeric+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <condition_numeric@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @condition_alphanumeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @condition_alphabet(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @condition_numeric(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @condition_alphanumeric(i8 signext %0) {
%2 = tail call i64 @condition_alphabet(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @condition_numeric(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int wpas_dbus_unregister_persistent_group(struct wpa_supplicant *wpa_s,
                                          int nid) {
  return 0;
}


x86 assembly (clang, -O0):
<wpas_dbus_unregister_persistent_group>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define i32 @wpas_dbus_unregister_persistent_group(%struct.wpa_supplicant* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int shmget(int, int /*<<< orphan*/, int);
int get_grib_shmid(int readonly) {
  int shmid;
  if (readonly) {
    shmid = shmget(
        ((22 << 25) | (12 << 20) | (13 << 15) | (7 << 10) | (18 << 5) | 2), 0,
        0444);
  } else {
    shmid = shmget(
        ((22 << 25) | (12 << 20) | (13 << 15) | (7 << 10) | (18 << 5) | 2), 0,
        0664);
  }
  return shmid;
}


x86 assembly (clang, -O0):
<get_grib_shmid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <get_grib_shmid+0x2e>
mov    $0x2cc69e42,%edi
xor    %esi,%esi
mov    $0x124,%edx
call   1030 <shmget@plt>
mov    %eax,-0x8(%rbp)
jmp    1152 <get_grib_shmid+0x42>
mov    $0x2cc69e42,%edi
xor    %esi,%esi
mov    $0x1b4,%edx
call   1030 <shmget@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_grib_shmid>:
test   %edi,%edi
mov    $0x1b4,%eax
mov    $0x124,%edx
cmove  %eax,%edx
mov    $0x2cc69e42,%edi
xor    %esi,%esi
jmp    1030 <shmget@plt>

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

LLVM IR (-O2):
define i32 @get_grib_shmid(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 436, i32 292
%4 = tail call i32 @shmget(i32 751214146, i32 0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SC68error_add(char *, char const *);
void *gzip_load(const char *fname, int *ptr_ulen) {
  if (ptr_ulen)
    *ptr_ulen = 0;
  SC68error_add("gzip_load(%s) : no zlib support", fname);
  return 0;
}


x86 assembly (clang, -O0):
<gzip_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1135 <gzip_load+0x25>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <SC68error_add@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gzip_load>:
push   %rax
mov    %rdi,%rax
test   %rsi,%rsi
je     111f <gzip_load+0xf>
movl   $0x0,(%rsi)
lea    0xeda(%rip),%rdi
mov    %rax,%rsi
call   1030 <SC68error_add@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"gzip_load(%s) : no zlib support\00"
define i8* @gzip_load(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32*, i32** %4
store i32 0, i32* %8
br label %9
9: ; preds = %7, %2
%10 = load i8*, i8** %3
%11 = call i32 @SC68error_add(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i8* null
}

LLVM IR (-O2):
@.str = [32 x i8] c"gzip_load(%s) : no zlib support\00"
define noalias i8* @gzip_load(i8* %0, i32* writeonly %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i32 0, i32* %1
br label %5
5: ; preds = %4, %2
%6 = tail call i32 @SC68error_add(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* null
}
void func_call(void) {
  printf("%s\n", __func__);
  exit(0);
}


x86 assembly (clang, -O0):
<func_call>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<func_call>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.func_call = [10 x i8] c"func_call\00"
define void @func_call() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.func_call, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@__func__.func_call = [10 x i8] c"func_call\00"
define void @func_call() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.func_call, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
}
_Complex double test_casinh(_Complex double x) { return __builtin_casinh(x); }


x86 assembly (clang, -O0):
<test_casinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <casinh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_casinh>:
jmp    1030 <casinh@plt>

LLVM IR (-O0):
define { double, double } @test_casinh(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %9, double* %12
store double %11, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%17 = load double, double* %16
%18 = call { double, double } @casinh(double %15, double %17)
%19 = extractvalue { double, double } %18, 0
%20 = extractvalue { double, double } %18, 1
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%22 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %19, double* %21
store double %20, double* %22
%23 = load { double, double }, { double, double }* %3
ret { double, double } %23
}

LLVM IR (-O2):
define { double, double } @test_casinh(double %0, double %1) {
%3 = tail call { double, double } @casinh(double %0, double %1)
ret { double, double } %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freep(void **p) {
  if (*p)
    free(*p);
}


x86 assembly (clang, -O0):
<freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <freep+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freep>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <freep+0xd>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @freep(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
br label %6
6: ; preds = %4, %1
ret void
}
int pdb_free_link_node_cb(struct pdb_node_t *nptr) { return 1; }


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

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

LLVM IR (-O0):
%struct.pdb_node_t = type opaque
define i32 @pdb_free_link_node_cb(%struct.pdb_node_t* %0) {
%2 = alloca %struct.pdb_node_t*
store %struct.pdb_node_t* %0, %struct.pdb_node_t** %2
ret i32 1
}

LLVM IR (-O2):
%struct.pdb_node_t = type opaque
define i32 @pdb_free_link_node_cb(%struct.pdb_node_t* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int _ozJC4(int, unsigned long volatile *, unsigned int);
__attribute__((no)) unsigned __attribute__((stdcall, regparm(3)))
fFvjz3(volatile unsigned long *RdZoN, unsigned kKiv65) {
  return _ozJC4(01, RdZoN, kKiv65);
}


x86 assembly (clang, -O0):
<fFvjz3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <_ozJC4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fFvjz3>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <_ozJC4@plt>

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

LLVM IR (-O2):
define i32 @fFvjz3(i64* %0, i32 %1) {
%3 = tail call i32 @_ozJC4(i32 1, i64* %0, i32 %1)
ret i32 %3
}
IR0I1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((*p0) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jg     113a <IR0I1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <IR0I1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0I1>:
xor    %eax,%eax
cmpb   $0x22,(%r8)
setl   %al
ret

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

LLVM IR (-O2):
define i32 @IR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = load i8, i8* %4
%8 = icmp slt i8 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
int cellId(int x, int y) { return x + y * 9; }


x86 assembly (clang, -O0):
<cellId>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x9,-0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cellId>:
lea    (%rsi,%rsi,8),%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @cellId(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 = mul nsw i32 %6, 9
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @cellId(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 9
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
double atan2(double, double);
double my_atan2(double y, double x) { return atan2(y, x); }


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

x86 assembly (clang, -O2):
<my_atan2>:
jmp    1030 <atan2@plt>

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

LLVM IR (-O2):
define double @my_atan2(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void write_char(int fd, char val) {
  uint8_t byte = val & 0xff;
  write(fd, &byte, 1);
}


x86 assembly (clang, -O0):
<write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @write_char(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
%10 = load i32, i32* %3
%11 = call i32 @write(i32 %10, i8* %5, i32 1)
ret void
}

LLVM IR (-O2):
define void @write_char(i32 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  char command[100] = {0};
  sprintf(command, "bash /home/keith/projects/md2x/md2x.sh %s %s", "", "");
  system(command);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
lea    -0x80(%rbp),%rdi
lea    0xea3(%rip),%rsi
lea    0xec8(%rip),%rcx
mov    %rcx,%rdx
call   1050 <sprintf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xeac(%rip),%rsi
lea    0xed1(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rcx,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"bash /home/keith/projects/md2x/md2x.sh %s %s\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [100 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [100 x i8]* %5 to i8*
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = call i32 @system(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"bash /home/keith/projects/md2x/md2x.sh %s %s\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @system(i8* %4)
ret i32 0
}
int triangle(int n) { return n * (n + 1) / 2; }


x86 assembly (clang, -O0):
<triangle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle>:
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @triangle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @triangle(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ff(int /*<<< orphan*/, int, int /*<<< orphan*/);
void testTortureExecute(void) {
  ff(0, 1, 0);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <ff@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <ff@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @ff(i32 0, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @ff(i32 0, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, int);
void *realloc(void *, int);
int /*<<< orphan*/ stderr;
void *myRealloc(void *p, int nBytes) {
  void *q;
  q = realloc(p, nBytes);
  if (q == NULL)
    fprintf(stderr, "Memory error on realloc(%p,%d)\n", p, nBytes);
  return (q);
}


x86 assembly (clang, -O0):
<myRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1166 <myRealloc+0x46>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myRealloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1040 <realloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1152 <myRealloc+0x32>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1030 <fprintf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Memory error on realloc(%p,%d)\0A\00"
define i8* @myRealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14)
br label %16
16: ; preds = %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Memory error on realloc(%p,%d)\0A\00"
define i8* @myRealloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %8
8: ; preds = %5, %2
ret i8* %3
}
float testf(float x, float y) { return __builtin_copysignf(x, y); }


x86 assembly (clang, -O0):
<testf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<testf>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @testf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.copysign.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @testf(float %0, float %1) {
%3 = tail call float @llvm.copysign.f32(float %0, float %1)
ret float %3
}
void ubifs_debugging_exit(struct ubifs_info *c) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define void @ubifs_debugging_exit(%struct.ubifs_info* nocapture %0) {
ret void
}
void CRYPTO_dbg_set_options(long bits) { return; }


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

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

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

LLVM IR (-O2):
define void @CRYPTO_dbg_set_options(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void nrerror(char error_text[]) {
  printf("ERROR: terminating program - %s\n", error_text);
  exit(1);
}


x86 assembly (clang, -O0):
<nrerror>:
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    $0x1,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@.str = [33 x i8] c"ERROR: terminating program - %s\0A\00"
define void @nrerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int geterror(int err, char res[]) {
  strcpy(res, strerror(errno));
  return 0;
}


x86 assembly (clang, -O0):
<geterror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geterror>:
push   %rbx
mov    %rsi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @geterror(i32 %0, i8* %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @strcpy(i8* %1, i32 %4)
ret i32 0
}
int cmp_double_des(const void *x, const void *y) {
  if (*(double *)x > *(double *)y) {
    return -1;
  } else if (*(double *)x < *(double *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_double_des>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112e <cmp_double_des+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <cmp_double_des+0x60>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1154 <cmp_double_des+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1160 <cmp_double_des+0x60>
jmp    1159 <cmp_double_des+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_double_des>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_double_des(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
unsigned int dcc_argv_len(char **a) {
  unsigned int i;
  for (i = 0; a[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<dcc_argv_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpq   $0x0,(%rax,%rcx,8)
je     1134 <dcc_argv_len+0x34>
jmp    1126 <dcc_argv_len+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <dcc_argv_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcc_argv_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi,%rax,8)
jne    1110 <dcc_argv_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @dcc_argv_len(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
void mtd_del_bb(struct mtd_info *mtd) {}


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

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

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

LLVM IR (-O2):
%struct.mtd_info = type opaque
define void @mtd_del_bb(%struct.mtd_info* nocapture %0) {
ret void
}
float f(float x, float y) {
  float f = (x * x + y * y) / (x * x * x - y * y * y);
  return f;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm1,%xmm3
mulss  %xmm1,%xmm3
movaps %xmm0,%xmm4
mulss  %xmm0,%xmm4
movaps %xmm4,%xmm2
addss  %xmm3,%xmm2
mulss  %xmm1,%xmm3
mulss  %xmm0,%xmm4
subss  %xmm3,%xmm4
divss  %xmm4,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %3
%8 = load float, float* %4
%9 = load float, float* %4
%10 = fmul float %8, %9
%11 = call float @llvm.fmuladd.f32(float %6, float %7, float %10)
%12 = load float, float* %3
%13 = load float, float* %3
%14 = fmul float %12, %13
%15 = load float, float* %3
%16 = load float, float* %4
%17 = load float, float* %4
%18 = fmul float %16, %17
%19 = load float, float* %4
%20 = fmul float %18, %19
%21 = fneg float %20
%22 = call float @llvm.fmuladd.f32(float %14, float %15, float %21)
%23 = fdiv float %11, %22
store float %23, float* %5
%24 = load float, float* %5
ret float %24
}

LLVM IR (-O2):
define float @f(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = fmul float %0, %0
%6 = fneg float %3
%7 = fmul float %6, %1
%8 = tail call float @llvm.fmuladd.f32(float %5, float %0, float %7)
%9 = fdiv float %4, %8
ret float %9
}