xunge/DecIR huggingface dataset:
int main(void) {
  MainM$hardwareInit();
  TOSH_sched_init();
  MainM$StdControl$init();
  MainM$StdControl$start();
  __nesc_enable_interrupt();
  for (;;) {
    TOSH_run_task();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <MainM$hardwareInit@plt>
mov    $0x0,%al
call   1060 <TOSH_sched_init@plt>
mov    $0x0,%al
call   1080 <MainM$StdControl$init@plt>
mov    $0x0,%al
call   1030 <MainM$StdControl$start@plt>
mov    $0x0,%al
call   1040 <__nesc_enable_interrupt@plt>
mov    $0x0,%al
call   1070 <TOSH_run_task@plt>
jmp    1192 <main+0x32>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <MainM$hardwareInit@plt>
xor    %eax,%eax
call   1060 <TOSH_sched_init@plt>
xor    %eax,%eax
call   1080 <MainM$StdControl$init@plt>
xor    %eax,%eax
call   1030 <MainM$StdControl$start@plt>
xor    %eax,%eax
call   1040 <__nesc_enable_interrupt@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1070 <TOSH_run_task@plt>
jmp    1190 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @"MainM$hardwareInit"()
%3 = call i32 (...) @TOSH_sched_init()
%4 = call i32 (...) @"MainM$StdControl$init"()
%5 = call i32 (...) @"MainM$StdControl$start"()
%6 = call i32 (...) @__nesc_enable_interrupt()
br label %7
7: ; preds = %7, %0
%8 = call i32 (...) @TOSH_run_task()
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @"MainM$hardwareInit"()
%2 = tail call i32 (...) @TOSH_sched_init()
%3 = tail call i32 (...) @"MainM$StdControl$init"()
%4 = tail call i32 (...) @"MainM$StdControl$start"()
%5 = tail call i32 (...) @__nesc_enable_interrupt()
br label %6
6: ; preds = %6, %0
%7 = tail call i32 (...) @TOSH_run_task()
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ hello_();
int main(void) {
  hello_();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello_()
ret i32 0
}
void cgisx11(void) {}


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

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

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

LLVM IR (-O2):
define void @cgisx11() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void __attribute__((destructor)) fini(void) { write(1, "8", 1); }


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
lea    0xee0(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"8\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"8\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
int main() {
  foo("i");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"i\00"
define i32 @main() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void pcie_set_ecrc_checking(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pcie_set_ecrc_checking(%struct.pci_dev* nocapture %0) {
ret void
}
void ASN1_seq_pack(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
bool WatchdogLockState(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x40000000) || (ui32Base == 0x40001000));
  return (((*((volatile uint32_t *)(ui32Base + 0x00000C00))) == 0x00000001)
              ? true
              : false);
}


x86 assembly (clang, -O0):
<WatchdogLockState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x40000000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <WatchdogLockState+0x2a>
cmpl   $0x40001000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0xc00,%eax
cltq
mov    (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogLockState>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40000000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0xc00(%rax),%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @WatchdogLockState(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 3072
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = icmp eq i32 %16, 1
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 %19
}

LLVM IR (-O2):
define i32 @WatchdogLockState(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 3072
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ hello();
int main() {
  hello();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_make_path_absolute() {
  printf("NOT IMPLEMENTED:"
         "pa_make_path_absolute"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_make_path_absolute\0A\00"
define i32 @pa_make_path_absolute() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_make_path_absolute\00"
define i32 @pa_make_path_absolute() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ xisinf(double);
scalar_t__ xisnan(double);
int checkfp(double x) {
  if (xisinf(x) || xisnan(x))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<checkfp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <xisinf@plt>
cmp    $0x0,%rax
jne    1155 <checkfp+0x35>
movsd  -0x10(%rbp),%xmm0
call   1030 <xisnan@plt>
cmp    $0x0,%rax
je     1161 <checkfp+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1168 <checkfp+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkfp>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <xisinf@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113a <checkfp+0x1a>
pop    %rcx
ret
movsd  (%rsp),%xmm0
call   1030 <xisnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @checkfp(double %0) {
%2 = tail call i64 @xisinf(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @xisnan(double %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
}
void TM17_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @TM17_intr() {
ret void
}
void gtk_text_buffer_delete() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_delete() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addscore(int, int);
void scoreoctave(int n) { addscore(n, 250); }


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

x86 assembly (clang, -O2):
<scoreoctave>:
mov    $0xfa,%esi
jmp    1030 <addscore@plt>

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

LLVM IR (-O2):
define void @scoreoctave(i32 %0) {
%2 = tail call i32 @addscore(i32 %0, i32 250)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tok_init(char *, char);
void gnu_parse_init(char *file) { tok_init(file, '#'); }


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

x86 assembly (clang, -O2):
<gnu_parse_init>:
mov    $0x23,%esi
jmp    1030 <tok_init@plt>

LLVM IR (-O0):
define void @gnu_parse_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @tok_init(i8* %3, i8 signext 35)
ret void
}

LLVM IR (-O2):
define void @gnu_parse_init(i8* %0) {
%2 = tail call i32 @tok_init(i8* %0, i8 signext 35)
ret void
}
void __attribute__((__warning__(
    "curl_easy_setopt expects a void* or char* argument for this option")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_setopt_err_postfields(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_postfields() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void *load_addr_ref(void) { return *(void **)(0x87654321); }


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

x86 assembly (clang, -O2):
<load_addr_ref>:
mov    $0x87654321,%eax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i8* @load_addr_ref() {
%1 = load i8*, i8** inttoptr (i64 2271560481 to i8**)
ret i8* %1
}

LLVM IR (-O2):
define i8* @load_addr_ref() {
%1 = load i8*, i8** inttoptr (i64 2271560481 to i8**)
ret i8* %1
}
void __assertion_checks() {}


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

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

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

LLVM IR (-O2):
define void @__assertion_checks() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m68ki_exception_illegal();
int /*<<< orphan*/ m68ki_exception_trap(int);
void m68k_op_trapt(void) {
  if (0) {
    m68ki_exception_trap(7);
    return;
  }
  m68ki_exception_illegal();
}


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

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

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

LLVM IR (-O2):
define void @m68k_op_trapt() {
%1 = tail call i32 (...) @m68ki_exception_illegal()
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ run();
int main() {
  run();
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @run()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
char getchar();
void getstr(char *s) {
  while ((*s = getchar()) != '\n')
    s++;
  *s = 0;
}


x86 assembly (clang, -O0):
<getstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0xa,%eax
je     1146 <getstr+0x36>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <getstr+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstr>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
cmp    $0xa,%al
jne    1120 <getstr+0x10>
movb   $0x0,-0x1(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @getstr(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = tail call signext i8 (...) @getchar()
store i8 %4, i8* %3
%5 = icmp eq i8 %4, 10
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int main() { test1(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
ret i32 0
}
/* Variables and functions */
double floor(double);
double round(double v) { return floor(v + 0.5); }


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ web_set_str_param(char *, unsigned int *, char const *,
                                     char *);
void web_set_int_param(char *head, unsigned int *head_size, const char *param,
                       int value) {
  char buf[10];
  sprintf(buf, "%d", value);
  web_set_str_param(head, head_size, param, buf);
}


x86 assembly (clang, -O0):
<web_set_int_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x26(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xebb(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x26(%rbp),%rcx
call   1030 <web_set_str_param@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<web_set_int_param>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
lea    0xe(%rsp),%r12
mov    %r12,%rdi
mov    %ecx,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
call   1030 <web_set_str_param@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @web_set_int_param(i8* %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [10 x i8]
store i8* %0, i8** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %8
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %5
%14 = load i32*, i32** %6
%15 = load i8*, i8** %7
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%17 = call i32 @web_set_str_param(i8* %13, i32* %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @web_set_int_param(i8* %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca [10 x i8]
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%8 = call i32 @web_set_str_param(i8* %0, i32* %1, i8* %2, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xf8() {
  Assert_real((isupper(248) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1245, ("isupper should be 0 for 0xf8"));
}


x86 assembly (clang, -O0):
<t_isupper_0xf8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf8,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4dd,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xf8>:
push   %rax
mov    $0xf8,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4dd,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xf8\00"
define void @t_isupper_0xf8() {
%1 = call i64 @isupper(i32 248)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1245, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xf8\00"
define void @t_isupper_0xf8() {
%1 = tail call i64 @isupper(i32 248)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1245, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
long cyg_crc32_accumulate(long, void *, unsigned long);
unsigned long gpt_crc32(void *buf, unsigned long len) {
  return cyg_crc32_accumulate(~0L, buf, len) ^ ~0L;
}


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

x86 assembly (clang, -O2):
<gpt_crc32>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xffffffffffffffff,%rdi
call   1030 <cyg_crc32_accumulate@plt>
not    %rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @gpt_crc32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @cyg_crc32_accumulate(i64 -1, i8* %5, i64 %6)
%8 = xor i64 %7, -1
ret i64 %8
}

LLVM IR (-O2):
define i64 @gpt_crc32(i8* %0, i64 %1) {
%3 = tail call i64 @cyg_crc32_accumulate(i64 -1, i8* %0, i64 %1)
%4 = xor i64 %3, -1
ret i64 %4
}
/* Variables and functions */
int ce_cur_coroutine();
int ce_cur_task() { return ce_cur_coroutine(); }


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

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

LLVM IR (-O0):
define i32 @ce_cur_task() {
%1 = call i32 (...) @ce_cur_coroutine()
ret i32 %1
}

LLVM IR (-O2):
define i32 @ce_cur_task() {
%1 = tail call i32 (...) @ce_cur_coroutine()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ e_absy();
int /*<<< orphan*/ e_cmp();
void e_cmp_absy() {
  e_absy();
  e_cmp();
}


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

x86 assembly (clang, -O2):
<e_cmp_absy>:
push   %rax
xor    %eax,%eax
call   1030 <e_absy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_cmp@plt>

LLVM IR (-O0):
define void @e_cmp_absy() {
%1 = call i32 (...) @e_absy()
%2 = call i32 (...) @e_cmp()
ret void
}

LLVM IR (-O2):
define void @e_cmp_absy() {
%1 = tail call i32 (...) @e_absy()
%2 = tail call i32 (...) @e_cmp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _response(char const *);
void _stat_error3_501(void) {
  const char msg[] =
      "501 Arguments wrong,the file or directory does not exists!\r\n";
  _response(msg);
}


x86 assembly (clang, -O0):
<_stat_error3_501>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x3d,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <_response@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stat_error3_501>:
sub    $0x48,%rsp
movups 0xf12(%rip),%xmm0
movups %xmm0,0x2d(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <_response@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const._stat_error3_501.msg = [61 x i8] c"501 Arguments wrong,the file or directory does not exists!\0D\0A\00"
define void @_stat_error3_501() {
%1 = alloca [61 x i8]
%2 = bitcast [61 x i8]* %1 to i8*
%3 = getelementptr inbounds [61 x i8], [61 x i8]* %1, i64 0, i64 0
%4 = call i32 @_response(i8* %3)
ret void
}

LLVM IR (-O2):
@__const._stat_error3_501.msg = [61 x i8] c"501 Arguments wrong,the file or directory does not exists!\0D\0A\00"
define void @_stat_error3_501() {
%1 = alloca [61 x i8]
%2 = getelementptr inbounds [61 x i8], [61 x i8]* %1, i64 0, i64 0
%3 = call i32 @_response(i8* %2)
ret void
}
void clear_nvector(double *vec, long int n) {
  register long i;
  for (i = 0; i <= n; i++)
    vec[i] = 0;
}


x86 assembly (clang, -O0):
<clear_nvector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1143 <clear_nvector+0x43>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <clear_nvector+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_nvector>:
test   %rsi,%rsi
js     1129 <clear_nvector+0x19>
push   %rax
lea    0x8(,%rsi,8),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @clear_nvector(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %14, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp sle i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds double, double* %11, i64 %12
store double 0.000000e+00, double* %13
br label %14
14: ; preds = %10
%15 = load i64, i64* %5
%16 = add nsw i64 %15, 1
store i64 %16, i64* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @clear_nvector(double* nocapture writeonly %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = shl i64 %1, 3
%7 = add i64 %6, 8
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int recv(int, void *, unsigned int, int);
int receive_message_from_variable_server(int socket, void *server_reply,
                                         unsigned int lenght, int flags) {
  return recv(socket, server_reply, lenght, flags);
}


x86 assembly (clang, -O0):
<receive_message_from_variable_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_message_from_variable_server>:
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @receive_message_from_variable_server(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @recv(i32 %9, i8* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @receive_message_from_variable_server(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
size_t strxfrm(char *dest, const char *src, size_t n) {
  strncpy(dest, src, n);
  return n;
}


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

x86 assembly (clang, -O2):
<strxfrm>:
push   %rbx
mov    %rdx,%rbx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @strxfrm(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i64, i64* %6
ret i64 %11
}

LLVM IR (-O2):
define i64 @strxfrm(i8* %0, i8* %1, i64 returned %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ gmx_sorient(int, char **);
int main(int argc, char *argv[]) {
  gmx_sorient(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_sorient@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_sorient(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ isalnum(int);
scalar_t__ strchr(char const *, int);
int isSymbolChar(int ch) {
  static const char *valid = "!#$%&*+-./:<=>?@^_~";
  return isalnum(ch) || strchr(valid, ch);
}


x86 assembly (clang, -O0):
<isSymbolChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    115e <isSymbolChar+0x3e>
mov    0x2ee4(%rip),%rdi
mov    -0x4(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSymbolChar>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isSymbolChar+0x17>
pop    %rbx
ret
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@isSymbolChar.valid = internal global i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i32 0, i32 0)
@.str = [20 x i8] c"!#$%&*+-./:<=>?@^_~\00"
define i32 @isSymbolChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8*, i8** @isSymbolChar.valid
%8 = load i32, i32* %2
%9 = call i64 @strchr(i8* %7, i32 %8)
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [20 x i8] c"!#$%&*+-./:<=>?@^_~\00"
define i32 @isSymbolChar(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strchr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %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
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sink(void *);
void malloc_int_memset(int n) {
  void *p = malloc(11 < n ? 11 : n);
  memset(p, 0, 12);
  sink(p);
  memset(p, 0, 11);
  sink(p);
}


x86 assembly (clang, -O0):
<malloc_int_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xb,%eax
cmp    -0x4(%rbp),%eax
jge    1156 <malloc_int_memset+0x26>
mov    $0xb,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <malloc_int_memset+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
call   1040 <sink@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
call   1040 <sink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_int_memset>:
push   %rbx
cmp    $0xb,%edi
mov    $0xb,%eax
cmovge %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
call   1040 <sink@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sink@plt>

LLVM IR (-O0):
define void @malloc_int_memset(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 11, %4
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %9
9: ; preds = %7, %6
%10 = phi i32 [ 11, %6 ], [ %8, %7 ]
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @memset(i8* %12, i32 0, i32 12)
%14 = load i8*, i8** %3
%15 = call i32 @sink(i8* %14)
%16 = load i8*, i8** %3
%17 = call i32 @memset(i8* %16, i32 0, i32 11)
%18 = load i8*, i8** %3
%19 = call i32 @sink(i8* %18)
ret void
}

LLVM IR (-O2):
define void @malloc_int_memset(i32 %0) {
%2 = icmp slt i32 %0, 11
%3 = select i1 %2, i32 %0, i32 11
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i32 12)
%6 = tail call i32 @sink(i8* %4)
%7 = tail call i32 @memset(i8* %4, i32 0, i32 11)
%8 = tail call i32 @sink(i8* %4)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t imin(int32_t a, int32_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<imin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <imin+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <imin+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @imin(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @imin(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int count_chars(char c, char *s) {
  int count = 0;
  while (*s && *s == c) {
    count++;
    s++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     113d <count_chars+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114d <count_chars+0x4d>
jmp    1167 <count_chars+0x67>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <count_chars+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_chars>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <count_chars+0x22>
cmp    %dil,%cl
jne    1122 <count_chars+0x22>
xor    %eax,%eax
nop
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1122 <count_chars+0x22>
cmp    %dil,%cl
je     1110 <count_chars+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_chars(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp ne i8 %3, 0
%5 = icmp eq i8 %3, %0
%6 = and i1 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ 0, %2 ]
%9 = phi i8* [ %11, %7 ], [ %1, %2 ]
%10 = add nuw nsw i32 %8, 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
%14 = icmp eq i8 %12, %0
%15 = and i1 %13, %14
br i1 %15, label %7, label %16
16: ; preds = %7, %2
%17 = phi i32 [ 0, %2 ], [ %10, %7 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
bool got_geometry(unsigned int width, unsigned int height, void *userdata) {
  printf("%ux%u\n", width, height);
  return false;
}


x86 assembly (clang, -O0):
<got_geometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%ux%u\0A\00"
define i32 @got_geometry(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 0
}
unsigned char __atomic_fetch_and_1(volatile void *atom, unsigned char value,
                                   int memorder) {
  unsigned char xchg;
  unsigned char cmp;
  __atomic_load((unsigned char *)atom, (unsigned char *)&cmp, 0);
  do {
    xchg = ((cmp & value));
  } while (
      !__atomic_compare_exchange((unsigned char *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_and_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x12(%rbp),%al
mov    -0x11(%rbp),%dl
lock cmpxchg %dl,(%rcx)
mov    %al,%cl
sete   %al
mov    %al,-0x15(%rbp)
mov    %cl,-0x14(%rbp)
test   $0x1,%al
jne    114e <__atomic_fetch_and_1+0x4e>
mov    -0x14(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111a <__atomic_fetch_and_1+0x1a>
movzbl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_and_1>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %eax,%edx
and    %sil,%dl
lock cmpxchg %dl,(%rdi)
jne    1110 <__atomic_fetch_and_1+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @__atomic_fetch_and_1(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = load atomic i8, i8* %10 monotonic
store i8 %11, i8* %8
br label %12
12: ; preds = %27, %3
%13 = load i8, i8* %8
%14 = zext i8 %13 to i32
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = and i32 %14, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
br label %19
19: ; preds = %12
%20 = load i8*, i8** %4
%21 = load i8, i8* %8
%22 = load i8, i8* %7
%23 = cmpxchg weak i8* %20, i8 %21, i8 %22 seq_cst seq_cst
%24 = extractvalue { i8, i1 } %23, 0
%25 = extractvalue { i8, i1 } %23, 1
br i1 %25, label %27, label %26
26: ; preds = %19
store i8 %24, i8* %8
br label %27
27: ; preds = %26, %19
%28 = zext i1 %25 to i8
store i8 %28, i8* %9
%29 = load i8, i8* %9
%30 = trunc i8 %29 to i1
%31 = xor i1 %30, true
br i1 %31, label %12, label %32
32: ; preds = %27
%33 = load i8, i8* %8
ret i8 %33
}

LLVM IR (-O2):
define zeroext i8 @__atomic_fetch_and_1(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = load atomic i8, i8* %0 monotonic
br label %5
5: ; preds = %5, %3
%6 = phi i8 [ %4, %3 ], [ %10, %5 ]
%7 = and i8 %6, %1
%8 = cmpxchg weak i8* %0, i8 %6, i8 %7 seq_cst seq_cst
%9 = extractvalue { i8, i1 } %8, 1
%10 = extractvalue { i8, i1 } %8, 0
br i1 %9, label %11, label %5
11: ; preds = %5
ret i8 %6
}
void lockdep_free_task(struct task_struct *task) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @lockdep_free_task(%struct.task_struct* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ unused;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ RAND_bytes(int /*<<< orphan*/ *, int);
void RAND_seed(const void *buf, int num) {
  uint8_t unused;
  RAND_bytes(&unused, sizeof(unused));
}


x86 assembly (clang, -O0):
<RAND_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <RAND_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAND_seed>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <RAND_bytes@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @RAND_seed(i8* nocapture readnone %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @RAND_bytes(i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(size_t);
int /*<<< orphan*/ oom();
void *realloc(void *, size_t);
void *lrealloc(void *ptr, size_t size) {
  assert(size);
  ptr = realloc(ptr, size);
  if (ptr == NULL)
    oom();
  return ptr;
}


x86 assembly (clang, -O0):
<lrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116c <lrealloc+0x3c>
mov    $0x0,%al
call   1030 <oom@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115c <lrealloc+0x2c>
xor    %eax,%eax
call   1030 <oom@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @lrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @assert(i64 %1)
%4 = tail call i8* @realloc(i8* %0, i64 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @oom()
br label %8
8: ; preds = %6, %2
ret i8* %4
}
void error_non_numeric_float(void *client_state) {}


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

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

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

LLVM IR (-O2):
define void @error_non_numeric_float(i8* nocapture %0) {
ret void
}