xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_write_mixed_cell_configuration(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(81, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_write_mixed_cell_configuration>:
mov    $0x51,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @celcon_write_mixed_cell_configuration() {
%1 = tail call i32 @_ada_use_c2phc(i32 81, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ closeServFile();
void onStopPlugin() { closeServFile(); }


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

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

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

LLVM IR (-O2):
define void @onStopPlugin() {
%1 = tail call i32 (...) @closeServFile()
ret void
}
/* Variables and functions */
double polylog(int, double);
double w_polylog_3(double x) { return polylog(3, x); }


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

x86 assembly (clang, -O2):
<w_polylog_3>:
mov    $0x3,%edi
jmp    1030 <polylog@plt>

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

LLVM IR (-O2):
define double @w_polylog_3(double %0) {
%2 = tail call double @polylog(i32 3, double %0)
ret double %2
}
void *dlsym(void *ptr, const char *str) {}


x86 assembly (clang, -O0):
<dlsym>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ move(int, int);
int main(int argc, char *argv[]) {
  initscr();
  move(-10, -20);
  addstr("Hello, World!");
  getch();
  endwin();
  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 <initscr@plt>
mov    $0xfffffff6,%edi
mov    $0xffffffec,%esi
call   1070 <move@plt>
lea    0xe7d(%rip),%rdi
call   1060 <addstr@plt>
mov    $0x0,%al
call   1040 <getch@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
mov    $0xfffffff6,%edi
mov    $0xffffffec,%esi
call   1070 <move@plt>
lea    0xe92(%rip),%rdi
call   1060 <addstr@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
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 (...) @initscr()
%7 = call i32 @move(i32 -10, i32 -20)
%8 = call i32 @addstr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @getch()
%10 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 @move(i32 -10, i32 -20)
%5 = tail call i32 @addstr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @getch()
%7 = tail call i32 (...) @endwin()
ret i32 0
}
extern int _isatty(int file_UNUSED __attribute__((__unused__))) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ forkall();
int /*<<< orphan*/ go();
scalar_t__ waiting(int volatile *);
int main(int argc, char **argv) {
  volatile int a = 0;
  while (waiting(&a) == 0)
    continue;
  (void)forkall();
  (void)go();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <waiting@plt>
cmp    $0x0,%rax
jne    1165 <main+0x35>
jmp    114d <main+0x1d>
mov    $0x0,%al
call   1050 <forkall@plt>
mov    $0x0,%al
call   1030 <go@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <waiting@plt>
test   %rax,%rax
je     1150 <main+0x20>
xor    %eax,%eax
call   1050 <forkall@plt>
xor    %eax,%eax
call   1030 <go@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 0, i32* %6
br label %7
7: ; preds = %10, %2
%8 = call i64 @waiting(i32* %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %7
11: ; preds = %7
%12 = call i32 (...) @forkall()
%13 = call i32 (...) @go()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
br label %5
5: ; preds = %5, %2
%6 = call i64 @waiting(i32* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5
%9 = call i32 (...) @forkall()
%10 = call i32 (...) @go()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ PKCS8_PRIV_KEY_INFO;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_PKCS8INF;
scalar_t__ i2d_PKCS8_PRIV_KEY_INFO;
int PEM_write_bio_PKCS8_PRIV_KEY_INFO(BIO *bp, PKCS8_PRIV_KEY_INFO *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_PKCS8_PRIV_KEY_INFO,
                            PEM_STRING_PKCS8INF, bp, x, NULL, NULL, 0, NULL,
                            NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_PKCS8_PRIV_KEY_INFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_PKCS8_PRIV_KEY_INFO>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb7(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_PKCS8_PRIV_KEY_INFO = global i64 0
@PEM_STRING_PKCS8INF = global i32 0
define i32 @PEM_write_bio_PKCS8_PRIV_KEY_INFO(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_PKCS8_PRIV_KEY_INFO
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PKCS8INF
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_PKCS8_PRIV_KEY_INFO = global i64 0
@PEM_STRING_PKCS8INF = global i32 0
define i32 @PEM_write_bio_PKCS8_PRIV_KEY_INFO(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_PKCS8_PRIV_KEY_INFO
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_PKCS8INF
%6 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Variables and functions */
int isprm(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  for (int i = 1; i <= 100000000; i++) {
    if (isprm(i) == 1)
      printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jg     1176 <main+0x56>
mov    -0x8(%rbp),%edi
call   1030 <isprm@plt>
cmp    $0x1,%eax
jne    1163 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
jmp    1168 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x5f5e101,%ebx
je     1163 <main+0x43>
mov    %ebx,%edi
call   1030 <isprm@plt>
cmp    $0x1,%eax
jne    1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %2
1: ; preds = %8
ret i32 0
2: ; preds = %0, %8
%3 = phi i32 [ 1, %0 ], [ %9, %8 ]
%4 = tail call i32 @isprm(i32 %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %8
8: ; preds = %2, %6
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 100000001
br i1 %10, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handle_child_quit_signal(int signum) { exit(0); }


x86 assembly (clang, -O0):
<handle_child_quit_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<handle_child_quit_signal>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @handle_child_quit_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @handle_child_quit_signal(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_59int32_mem(int *val) {
  return ((*val) & (0x59 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_59int32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x59,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_59int32_mem>:
testb  $0x59,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_59int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 89
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_59int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 89
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int is_hardware_address(int addr) { return addr >= 0xC000; }


x86 assembly (clang, -O0):
<is_hardware_address>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xc000,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hardware_address>:
xor    %eax,%eax
cmp    $0xc000,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @is_hardware_address(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 49152
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_hardware_address(i32 %0) {
%2 = icmp sgt i32 %0, 49151
%3 = zext i1 %2 to i32
ret i32 %3
}
void *render_null(void *dest) { return dest; }


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

x86 assembly (clang, -O2):
<render_null>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @render_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @render_null(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ advance(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main(int argc, char **argv) {
  FILE *myfile;
  myfile = fopen(argv[1], "r");
  if (myfile == NULL)
    return -1;
  advance(myfile);
  fclose(myfile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1175 <main+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <main+0x5e>
mov    -0x18(%rbp),%rdi
call   1040 <advance@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115d <main+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <advance@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @advance(i32* %5)
%9 = tail call i32 @fclose(i32* %5)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBHostPwrEnable(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  (*((volatile uint16_t *)(ui32Base + 0x00000400))) |= 0x00000004;
}


x86 assembly (clang, -O0):
<USBHostPwrEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x400,%eax
cltq
mov    (%rax),%ecx
or     $0x4,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrEnable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
orl    $0x4,0x400(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @USBHostPwrEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1024
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, 4
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @USBHostPwrEnable(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 1024
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, 4
store volatile i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _scanf_getll(char *, long long *, int, int, int);
int /*<<< orphan*/ safe_gets(char *, int);
long long getldec() {
  char buf[80];
  safe_gets(buf, 80);
  long long i = 0;
  _scanf_getll(buf, &i, 10, 80, 1);
  return i;
}


x86 assembly (clang, -O0):
<getldec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
mov    $0x50,%esi
call   1030 <safe_gets@plt>
movq   $0x0,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0xa,%edx
mov    $0x50,%ecx
mov    $0x1,%r8d
call   1040 <_scanf_getll@plt>
mov    -0x58(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getldec>:
push   %rbx
sub    $0x60,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <safe_gets@plt>
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
mov    $0x50,%ecx
mov    $0x1,%r8d
call   1040 <_scanf_getll@plt>
mov    0x8(%rsp),%rax
add    $0x60,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @getldec() {
%1 = alloca [80 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @safe_gets(i8* %3, i32 80)
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = call i32 @_scanf_getll(i8* %3, i64* %2, i32 10, i32 80, i32 1)
%7 = load i64, i64* %2
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ MFRC522_Wr(int, int);
void MFRC522_Reset() { MFRC522_Wr(0x01, 0x0F); }


x86 assembly (clang, -O0):
<MFRC522_Reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0xf,%esi
call   1030 <MFRC522_Wr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MFRC522_Reset>:
mov    $0x1,%edi
mov    $0xf,%esi
jmp    1030 <MFRC522_Wr@plt>

LLVM IR (-O0):
define void @MFRC522_Reset() {
%1 = call i32 @MFRC522_Wr(i32 1, i32 15)
ret void
}

LLVM IR (-O2):
define void @MFRC522_Reset() {
%1 = tail call i32 @MFRC522_Wr(i32 1, i32 15)
ret void
}
void nseel_asm_log(void) {
  __asm__("fldln2\n"
          "fxch\n"
          "fyl2x\n");
}


x86 assembly (clang, -O0):
<nseel_asm_log>:
push   %rbp
mov    %rsp,%rbp
fldln2
fxch   %st(1)
fyl2x
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_log>:
fldln2
fxch   %st(1)
fyl2x
ret

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

LLVM IR (-O2):
define void @nseel_asm_log() {
tail call void asm sideeffect "fldln2\0Afxch\0Afyl2x\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
void nocase(char *str) {
  int i, n;
  n = strlen(str);
  for (i = 0; i < n; i++) {
    str[i] = tolower(str[i]);
  }
}


x86 assembly (clang, -O0):
<nocase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1177 <nocase+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <nocase+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocase>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <nocase+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <nocase+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @nocase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @tolower(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
unsigned char _farnspeekb(unsigned long offset) {
  unsigned char result;
  __asm__ __volatile__(".byte 0x64\n"
                       "	movb (%k1),%b0"
                       : "=q"(result)
                       : "r"(offset));
  return result;
}


x86 assembly (clang, -O0):
<_farnspeekb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %fs:(%eax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_farnspeekb>:
mov    %fs:(%edi),%al
ret

LLVM IR (-O0):
define zeroext i8 @_farnspeekb(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8 asm sideeffect ".byte 0x64\0A\09movb (${1:k}),${0:b}", "=q,r,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @_farnspeekb(i64 %0) {
%2 = tail call i8 asm sideeffect ".byte 0x64\0A\09movb (${1:k}),${0:b}", "=q,r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_init_ssl(int /*<<< orphan*/, int /*<<< orphan*/ *);
void SSL_library_init() { OPENSSL_init_ssl(0, NULL); }


x86 assembly (clang, -O0):
<SSL_library_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <OPENSSL_init_ssl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSL_library_init>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <OPENSSL_init_ssl@plt>

LLVM IR (-O0):
define void @SSL_library_init() {
%1 = call i32 @OPENSSL_init_ssl(i32 0, i32* null)
ret void
}

LLVM IR (-O2):
define void @SSL_library_init() {
%1 = tail call i32 @OPENSSL_init_ssl(i32 0, i32* null)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int _pu_path_is_file(const char *pathname) {
  struct stat statbuf;
  if (stat(pathname, &statbuf) < 0)
    return 0;
  return S_ISREG(statbuf.st_mode) != 0;
}


x86 assembly (clang, -O0):
<_pu_path_is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    114f <_pu_path_is_file+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1166 <_pu_path_is_file+0x46>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pu_path_is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1143 <_pu_path_is_file+0x23>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_pu_path_is_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %1, %6
%13 = phi i32 [ %11, %6 ], [ 0, %1 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ *XOpenDisplay(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/ *);
int main(void) {
  Display *dsp;
  dsp = XOpenDisplay("");
  printf("XOpenDisplay=%p\n", dsp);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [17 x i8] c"XOpenDisplay=%p\0A\00"
define i32 @main() {
%1 = tail call i32* @XOpenDisplay(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
void grad_inverse_transform_simplex(double *dz, const double *z, int K) {}


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

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

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

LLVM IR (-O2):
define void @grad_inverse_transform_simplex(double* nocapture %0, double* nocapture %1, i32 %2) {
ret void
}
gcall(sname) char *sname;
{
  if (*sname == '^') {
    ot("jsb\t");
    outstr(++sname);
  } else {
    ot("jsb\t");
    prefix();
    outstr(sname);
  }
  nl();
}


x86 assembly (clang, -O0):
<gcall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5e,%eax
jne    1182 <gcall+0x42>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <outstr@plt>
jmp    11a2 <gcall+0x62>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    $0x0,%al
call   1060 <prefix@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcall>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%bpl
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
cmp    $0x5e,%bpl
jne    1163 <gcall+0x23>
add    $0x1,%rbx
jmp    116a <gcall+0x2a>
xor    %eax,%eax
call   1060 <prefix@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outstr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"jsb\09\00"
define i32 @gcall(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 94
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %11)
br label %18
13: ; preds = %1
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @prefix()
%16 = load i8*, i8** %3
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %16)
br label %18
18: ; preds = %13, %8
%19 = call i32 (...) @nl()
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [5 x i8] c"jsb\09\00"
define i32 @gcall(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 94
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br i1 %3, label %5, label %7
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
br label %9
7: ; preds = %1
%8 = tail call i32 (...) @prefix()
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %0, %7 ], [ %6, %5 ]
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %10)
%12 = tail call i32 (...) @nl()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_cdecler_1();
int /*<<< orphan*/ test_cdecler_2();
int main() {
  test_cdecler_1();
  test_cdecler_2();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_cdecler_1()
%3 = call i32 (...) @test_cdecler_2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_cdecler_1()
%2 = tail call i32 (...) @test_cdecler_2()
ret i32 0
}
__attribute__((const)) unsigned int _hb_bit_storage(unsigned int number) {
  register unsigned int n_bits = 0;
  while (number) {
    n_bits++;
    number >>= 1;
  }
  return n_bits;
}


x86 assembly (clang, -O0):
<_hb_bit_storage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <_hb_bit_storage+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <_hb_bit_storage+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hb_bit_storage>:
xor    %eax,%eax
test   %edi,%edi
je     111c <_hb_bit_storage+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <_hb_bit_storage+0x10>
ret

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

LLVM IR (-O2):
define i32 @_hb_bit_storage(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ filename_flush_directory(char *, int /*<<< orphan*/);
void filename_flush(void) {
  while (filename_flush_directory("/tmp/WWW/NetSurf/Misc", 0))
    ;
}


x86 assembly (clang, -O0):
<filename_flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <filename_flush+0x9>
lea    0xee0(%rip),%rdi
xor    %esi,%esi
call   1030 <filename_flush_directory@plt>
cmp    $0x0,%rax
je     1136 <filename_flush+0x26>
jmp    1119 <filename_flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename_flush>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <filename_flush_directory@plt>
test   %rax,%rax
jne    1120 <filename_flush+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/tmp/WWW/NetSurf/Misc\00"
define void @filename_flush() {
br label %1
1: ; preds = %4, %0
%2 = call i64 @filename_flush_directory(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"/tmp/WWW/NetSurf/Misc\00"
define void @filename_flush() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @filename_flush_directory(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
long long bit31() { return 0x0000000080000000LL; }


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

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

LLVM IR (-O0):
define i64 @bit31() {
ret i64 2147483648
}

LLVM IR (-O2):
define i64 @bit31() {
ret i64 2147483648
}
int getMaxInt() { return (1 << 31) - 1; }


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

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

LLVM IR (-O0):
define i32 @getMaxInt() {
ret i32 2147483647
}

LLVM IR (-O2):
define i32 @getMaxInt() {
ret i32 2147483647
}
/* Variables and functions */
int /*<<< orphan*/ cdiStreamWriteVarSlice(int, int, int, int, float const *,
                                          int);
void streamWriteVarSliceF(int streamID, int varID, int levelID,
                          const float *data, int nmiss) {
  cdiStreamWriteVarSlice(streamID, varID, levelID, 2, data, nmiss);
}


x86 assembly (clang, -O0):
<streamWriteVarSliceF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0x2,%ecx
call   1030 <cdiStreamWriteVarSlice@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streamWriteVarSliceF>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    $0x2,%ecx
jmp    1030 <cdiStreamWriteVarSlice@plt>

LLVM IR (-O0):
define void @streamWriteVarSliceF(i32 %0, i32 %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store float* %3, float** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load float*, float** %9
%15 = load i32, i32* %10
%16 = call i32 @cdiStreamWriteVarSlice(i32 %11, i32 %12, i32 %13, i32 2, float* %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @streamWriteVarSliceF(i32 %0, i32 %1, i32 %2, float* %3, i32 %4) {
%6 = tail call i32 @cdiStreamWriteVarSlice(i32 %0, i32 %1, i32 %2, i32 2, float* %3, i32 %4)
ret void
}
void gdk_window_invalidate_maybe_recurse() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_invalidate_maybe_recurse() {
ret void
}
int isblank(int c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void testArguments(int argc, char **argv) {
  if (argc < 3 || argc > 3) {
    fprintf(stderr, "Numero invalido de argumentos. (%d) - Esperado 2!\n",
            argc - 1);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<testArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jl     1143 <testArguments+0x23>
cmpl   $0x3,-0x4(%rbp)
jle    1168 <testArguments+0x48>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testArguments>:
cmp    $0x3,%edi
jne    1126 <testArguments+0x6>
ret
push   %rax
mov    %edi,%edx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
add    $0xffffffff,%edx
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Numero invalido de argumentos. (%d) - Esperado 2!\0A\00"
define void @testArguments(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 slt i32 %5, 3
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 3
br i1 %9, label %10, label %16
10: ; preds = %7, %2
%11 = load i32, i32* @stderr
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Numero invalido de argumentos. (%d) - Esperado 2!\0A\00"
define void @testArguments(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = add nsw i32 %0, -1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1Off();
void TestSerialC__Leds__led1Off(void) { LedsP__Leds__led1Off(); }


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

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

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

LLVM IR (-O2):
define void @TestSerialC__Leds__led1Off() {
%1 = tail call i32 (...) @LedsP__Leds__led1Off()
ret void
}
/* Type definitions */
typedef unsigned char uint8_t;
typedef int uint32_t;

/* Variables and functions */
void ADI8BitsClear(uint32_t ui32Base, uint32_t ui32Reg, uint8_t ui8Val) {
  uint32_t ui32RegOffset;
  ;
  ;
  ui32RegOffset = 0x00000020;
  (*((volatile unsigned char *)(ui32Base + ui32RegOffset + ui32Reg))) = ui8Val;
}


x86 assembly (clang, -O0):
<ADI8BitsClear>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x20,-0x10(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADI8BitsClear>:
movslq %edi,%rax
movslq %esi,%rcx
mov    %dl,0x20(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @ADI8BitsClear(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
store i32 32, i32* %7
%8 = load i8, i8* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %7
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
store volatile i8 %8, i8* %15
ret void
}

LLVM IR (-O2):
define void @ADI8BitsClear(i32 %0, i32 %1, i8 zeroext %2) {
%4 = add nsw i32 %0, 32
%5 = add nsw i32 %4, %1
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store volatile i8 %2, i8* %7
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *rmtGetProcAddress(void *handle, const char *symbol) {
  return dlsym(handle, symbol);
}


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

x86 assembly (clang, -O2):
<rmtGetProcAddress>:
jmp    1030 <dlsym@plt>

LLVM IR (-O0):
define i8* @rmtGetProcAddress(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 i8* @dlsym(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @rmtGetProcAddress(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ japi_removeall(int);
void j_removeall(int arg0) { japi_removeall(arg0); }


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

x86 assembly (clang, -O2):
<j_removeall>:
jmp    1030 <japi_removeall@plt>

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

LLVM IR (-O2):
define void @j_removeall(i32 %0) {
%2 = tail call i32 @japi_removeall(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ini_getint_id(int *, char *);
int ini_getint_id_def(char *param, int def) {
  int value;
  if (!ini_getint_id(&value, param))
    return def;
  return value;
}


x86 assembly (clang, -O0):
<ini_getint_id_def>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdi
call   1030 <ini_getint_id@plt>
cmp    $0x0,%eax
jne    1140 <ini_getint_id_def+0x30>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <ini_getint_id_def+0x36>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_getint_id_def>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xc(%rsp),%rdi
call   1030 <ini_getint_id@plt>
test   %eax,%eax
je     112c <ini_getint_id_def+0x1c>
mov    0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ini_getint_id_def(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @ini_getint_id(i32* %3, i8* %0)
%6 = icmp eq i32 %5, 0
%7 = load i32, i32* %3
%8 = select i1 %6, i32 %1, i32 %7
ret i32 %8
}