xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ basic_uart_tx_str(char const *);
void abort(const char *reason) { basic_uart_tx_str(reason); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <basic_uart_tx_str@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
call   1030 <basic_uart_tx_str@plt>

LLVM IR (-O0):
define void @abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @basic_uart_tx_str(i8* %3)
unreachable
}

LLVM IR (-O2):
define void @abort(i8* %0) {
%2 = tail call i32 @basic_uart_tx_str(i8* %0)
unreachable
}
void copy2(char *s1, const char *s2) {
  for (; (*s1 = *s2) != '\0'; s1++, s2++) {
    ;
  }
}


x86 assembly (clang, -O0):
<copy2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1146 <copy2+0x46>
jmp    1129 <copy2+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <copy2+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy2>:
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     111f <copy2+0x1f>
mov    $0x1,%eax
nopl   (%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy2+0x10>
ret

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

LLVM IR (-O2):
define void @copy2(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %1, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cglognot();
int /*<<< orphan*/ gentext();
void genlognot(void) {
  gentext();
  cglognot();
}


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

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

LLVM IR (-O0):
define void @genlognot() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @cglognot()
ret void
}

LLVM IR (-O2):
define void @genlognot() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @cglognot()
ret void
}
void led_status_card_ejected(void) {}


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

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

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

LLVM IR (-O2):
define void @led_status_card_ejected() {
ret void
}
void TIM1_UP_TIM10_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @TIM1_UP_TIM10_IRQHandler() {
ret void
}
int g_setlogin(const char *name) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @g_setlogin(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ENGINE_load_rdrand();
int OPENSSL_init_crypto(unsigned long long opts, const void *settings) {
  ENGINE_load_rdrand();
  return 1;
}


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

x86 assembly (clang, -O2):
<OPENSSL_init_crypto>:
push   %rax
xor    %eax,%eax
call   1030 <ENGINE_load_rdrand@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @OPENSSL_init_crypto(i64 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @ENGINE_load_rdrand()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ twoTwoCpp();
void twoTwoC() { twoTwoCpp(); }


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

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

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

LLVM IR (-O2):
define void @twoTwoC() {
%1 = tail call i32 (...) @twoTwoCpp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, char const *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *p) {
  (void)fprintf(stderr,
                "Usage: %s system_var\n\t%s -a\n"
                "\t%s path_var pathname\n\t%s -a pathname\n",
                p, p, p, p);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rcx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
mov    %rcx,%r9
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: %s system_var\0A\09%s -a\0A\09%s path_var pathname\0A\09%s -a pathname\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, i8* %6, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: %s system_var\0A\09%s -a\0A\09%s path_var pathname\0A\09%s -a pathname\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0, i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/);
void bmeipc_eclose(int32_t sd) { close(sd); }


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

x86 assembly (clang, -O2):
<bmeipc_eclose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @bmeipc_eclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_error(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
void test_msg_end(int pass) {
  if (pass == 0) {
    printf("PASSED\n");
  } else {
    printf("FAILED\n");
    exit_error(0, "UNIT TESTING FAILED");
  }
}


x86 assembly (clang, -O0):
<test_msg_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1146 <test_msg_end+0x26>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1160 <test_msg_end+0x40>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
lea    0xeb5(%rip),%rsi
call   1040 <exit_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_msg_end>:
test   %edi,%edi
je     1140 <test_msg_end+0x20>
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rsi
xor    %edi,%edi
pop    %rax
jmp    1040 <exit_error@plt>
lea    0xecd(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"PASSED\0A\00"
@.str.1 = [8 x i8] c"FAILED\0A\00"
@.str.2 = [20 x i8] c"UNIT TESTING FAILED\00"
define void @test_msg_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit_error(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.2 = [20 x i8] c"UNIT TESTING FAILED\00"
@str = [7 x i8] c"FAILED\00"
@str.3 = [7 x i8] c"PASSED\00"
define void @test_msg_end(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
br label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit_error(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ESRCH;
int /*<<< orphan*/ SYS_shutdown;
int /*<<< orphan*/ errno;
scalar_t__ syscall_0(int /*<<< orphan*/);
void shutdown() {
  int ret;
  ret = (int)syscall_0(SYS_shutdown);
  if (ret < 0)
    errno = ESRCH;
}


x86 assembly (clang, -O0):
<shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall_0@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1145 <shutdown+0x35>
mov    0x2e8e(%rip),%rax
mov    (%rax),%ecx
mov    0x2e95(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutdown>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall_0@plt>
test   $0x80000000,%eax
je     1138 <shutdown+0x28>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    0x2ea2(%rip),%rcx
mov    %eax,(%rcx)
pop    %rax
ret

LLVM IR (-O0):
@SYS_shutdown = global i32 0
@ESRCH = global i32 0
@errno = global i32 0
define void @shutdown() {
%1 = alloca i32
%2 = load i32, i32* @SYS_shutdown
%3 = call i64 @syscall_0(i32 %2)
%4 = trunc i64 %3 to i32
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* @ESRCH
store i32 %8, i32* @errno
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@SYS_shutdown = global i32 0
@ESRCH = global i32 0
@errno = global i32 0
define void @shutdown() {
%1 = load i32, i32* @SYS_shutdown
%2 = tail call i64 @syscall_0(i32 %1)
%3 = and i64 %2, 2147483648
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = load i32, i32* @ESRCH
store i32 %6, i32* @errno
br label %7
7: ; preds = %5, %0
ret void
}
OP(ed, c4) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ t1;
typedef int /*<<< orphan*/ h1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  struct haha {
    char c;
    int i;
    int j;
  };
  union Test {
    char c;
    int i;
    long double j;
  };
  union Test t1;
  struct haha h1;
  printf("%ld\n", sizeof(t1));
  printf("%ld\n", sizeof(h1));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%union.Test = type { x86_fp80 }
%struct.haha = type { i8, i32, i32 }
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.Test
%3 = alloca %struct.haha
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 16)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}

LLVM IR (-O2):
%union.Test = type { x86_fp80 }
%struct.haha = type { i8, i32, i32 }
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 16)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
int nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf,
                          unsigned char *read_ecc, unsigned char *calc_ecc) {
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.mtd_info = type opaque
define i32 @nand_bch_correct_data(%struct.mtd_info* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 -1
}
/* Variables and functions */
void *memmove(char *, void *, int);
void *memmove_ABd(void *A, const void *B, size_t d) {
  return memmove(((char *)A) + d, A, ((char *)B) - ((char *)A));
}


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

x86 assembly (clang, -O2):
<memmove_ABd>:
mov    %rsi,%rax
mov    %rdi,%rsi
add    %rdx,%rdi
sub    %esi,%eax
mov    %eax,%edx
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define i8* @memmove_ABd(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 i64, i64* %6
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
%17 = call i8* @memmove(i8* %9, i8* %10, i32 %16)
ret i8* %17
}

LLVM IR (-O2):
define i8* @memmove_ABd(i8* %0, i8* %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = tail call i8* @memmove(i8* %4, i8* %0, i32 %8)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int /*<<< orphan*/);
int BNC_0() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(0);
  return (stat);
}


x86 assembly (clang, -O0):
<BNC_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
xor    %edi,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNC_0>:
push   %rax
xor    %edi,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNC_0() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNC_0() {
%1 = tail call i32 @BNCIO(i32 0)
ret i32 99
}
void on_write(struct bufferevent *bev, void *info) {}


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

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

LLVM IR (-O0):
%struct.bufferevent = type opaque
define void @on_write(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type opaque
define void @on_write(%struct.bufferevent* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() { printf("hi %d\n", 5); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hi %d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hi %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
extern int JKMarray_dim(const int Jmax) {
  return (((4 * Jmax * Jmax + 11) * Jmax) / 3 + (4 * Jmax * Jmax) + 1);
}


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

x86 assembly (clang, -O2):
<JKMarray_dim>:
mov    %edi,%eax
imul   %eax,%eax
lea    0xb(,%rax,4),%ecx
imul   %edi,%ecx
movslq %ecx,%rcx
imul   $0x55555556,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rax,4),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @JKMarray_dim(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 4, %3
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = add nsw i32 %6, 11
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
%10 = sdiv i32 %9, 3
%11 = load i32, i32* %2
%12 = mul nsw i32 4, %11
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = add nsw i32 %10, %14
%16 = add nsw i32 %15, 1
ret i32 %16
}

LLVM IR (-O2):
define i32 @JKMarray_dim(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = mul nsw i32 %2, %0
%4 = add nsw i32 %3, 11
%5 = mul nsw i32 %4, %0
%6 = sdiv i32 %5, 3
%7 = or i32 %3, 1
%8 = add i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x50() {
  Assert_real((isalnum(80)),
              "/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_isalnum.c",
              405, ("isalnum should be 1 for P"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x50>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x195,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x50>:
push   %rax
mov    $0x50,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x195,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for P\00"
define void @t_isalnum_0x50() {
%1 = call i32 @isalnum(i32 80)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for P\00"
define void @t_isalnum_0x50() {
%1 = tail call i32 @isalnum(i32 80)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int ustrlen(int /*<<< orphan*/ *);
wchar_t *uadv(wchar_t *s) { return s + 1 + ustrlen(s); }


x86 assembly (clang, -O0):
<uadv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ustrlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uadv>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ustrlen@plt>
cltq
lea    (%rbx,%rax,4),%rax
add    $0x4,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @uadv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32*, i32** %2
%6 = call i32 @ustrlen(i32* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
ret i32* %8
}

LLVM IR (-O2):
define i32* @uadv(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = tail call i32 @ustrlen(i32* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
ret i32* %5
}
/* Type definitions */
struct dlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_DLIST_HEAD(struct dlist_node *);
int /*<<< orphan*/ dlist_replace(struct dlist_node *, struct dlist_node *);
void dlist_replace_init(struct dlist_node *old, struct dlist_node *new) {
  dlist_replace(old, new);
  INIT_DLIST_HEAD(old);
}


x86 assembly (clang, -O0):
<dlist_replace_init>:
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   1040 <dlist_replace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <INIT_DLIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlist_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <dlist_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_DLIST_HEAD@plt>

LLVM IR (-O0):
%struct.dlist_node = type { i32 }
define void @dlist_replace_init(%struct.dlist_node* %0, %struct.dlist_node* %1) {
%3 = alloca %struct.dlist_node*
%4 = alloca %struct.dlist_node*
store %struct.dlist_node* %0, %struct.dlist_node** %3
store %struct.dlist_node* %1, %struct.dlist_node** %4
%5 = load %struct.dlist_node*, %struct.dlist_node** %3
%6 = load %struct.dlist_node*, %struct.dlist_node** %4
%7 = call i32 @dlist_replace(%struct.dlist_node* %5, %struct.dlist_node* %6)
%8 = load %struct.dlist_node*, %struct.dlist_node** %3
%9 = call i32 @INIT_DLIST_HEAD(%struct.dlist_node* %8)
ret void
}

LLVM IR (-O2):
%struct.dlist_node = type { i32 }
define void @dlist_replace_init(%struct.dlist_node* %0, %struct.dlist_node* %1) {
%3 = tail call i32 @dlist_replace(%struct.dlist_node* %0, %struct.dlist_node* %1)
%4 = tail call i32 @INIT_DLIST_HEAD(%struct.dlist_node* %0)
ret void
}
int TestWrite(link_fd)
int link_fd;
{
  printf("BRS Information : TestWrite() not implemented yet.\r\n");
  return (1);
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"BRS Information : TestWrite() not implemented yet.\0D\0A\00"
define i32 @TestWrite(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [52 x i8] c"BRS Information : TestWrite() not implemented yet.\0D\00"
define i32 @TestWrite(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
                           struct snd_soc_jack_gpio *gpios) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.snd_soc_jack = type opaque
%struct.snd_soc_jack_gpio = type opaque
define i32 @snd_soc_jack_add_gpios(%struct.snd_soc_jack* %0, i32 %1, %struct.snd_soc_jack_gpio* %2) {
%4 = alloca %struct.snd_soc_jack*
%5 = alloca i32
%6 = alloca %struct.snd_soc_jack_gpio*
store %struct.snd_soc_jack* %0, %struct.snd_soc_jack** %4
store i32 %1, i32* %5
store %struct.snd_soc_jack_gpio* %2, %struct.snd_soc_jack_gpio** %6
ret i32 0
}

LLVM IR (-O2):
%struct.snd_soc_jack = type opaque
%struct.snd_soc_jack_gpio = type opaque
define i32 @snd_soc_jack_add_gpios(%struct.snd_soc_jack* nocapture readnone %0, i32 %1, %struct.snd_soc_jack_gpio* nocapture readnone %2) {
ret i32 0
}
int os_isdir(fd)
int fd;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @os_isdir(i32 %0) {
ret i32 0
}
void fa96(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
p0B:
  goto p0B;
  goto a;
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
a:
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa96>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa96+0x4>

x86 assembly (clang, -O2):
<fa96>:
jmp    1100 <fa96>

LLVM IR (-O0):
define void @fa96() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; No predecessors!
br label %21
21: ; preds = %21, %20
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; No predecessors!
br label %27
27: ; preds = %27, %26
br label %27
}

LLVM IR (-O2):
define void @fa96() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void progress(void) { printf("."); }


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

x86 assembly (clang, -O2):
<progress>:
mov    $0x2e,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @progress() {
%1 = tail call i32 @putchar(i32 46)
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn6() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn6");
  return result;
}


x86 assembly (clang, -O0):
<fn6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn6>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"fn6\00"
define i8* @fn6() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"fn6\00"
define i8* @fn6() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int main() {
  int a, b, c, d, e;
  b = a + 1;
  b = a + 2;
  a = b;
  a = b;
  a = b++;
  a = c++;
  a = b;
  a = d++;
  a = b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 2
store i32 %9, i32* %2
%10 = load i32, i32* %2
store i32 %10, i32* %1
%11 = load i32, i32* %2
store i32 %11, i32* %1
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
store i32 %12, i32* %1
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
store i32 %14, i32* %1
%16 = load i32, i32* %2
store i32 %16, i32* %1
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
store i32 %17, i32* %1
%19 = load i32, i32* %2
store i32 %19, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int qsort_cmp_SVEC_VAL2(const void *x, const void *y) {
  if (*((double *)x) < *((double *)y))
    return (-1);
  else
    return (*((double *)x) > *((double *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_SVEC_VAL2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <qsort_cmp_SVEC_VAL2+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <qsort_cmp_SVEC_VAL2+0x4d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @qsort_cmp_SVEC_VAL2(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void System_sleep_MINUS_micros(int t) { usleep(t); }


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

x86 assembly (clang, -O2):
<System_sleep_MINUS_micros>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @System_sleep_MINUS_micros(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
int isEscapePrefixChar(char charToCheck) { return charToCheck == '}'; }


x86 assembly (clang, -O0):
<isEscapePrefixChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x7d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEscapePrefixChar>:
xor    %eax,%eax
cmp    $0x7d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isEscapePrefixChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 125
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isEscapePrefixChar(i8 signext %0) {
%2 = icmp eq i8 %0, 125
%3 = zext i1 %2 to i32
ret i32 %3
}
int dblCmp(const void *f1, const void *f2) {
  return (*((double *)f1) < *((double *)f2)   ? -1
          : *((double *)f1) > *((double *)f2) ? 1
                                              : 0);
}


x86 assembly (clang, -O0):
<dblCmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1133 <dblCmp+0x33>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <dblCmp+0x54>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dblCmp(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp olt double %7, %10
br i1 %11, label %12, label %13
12: ; preds = %2
br label %23
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = bitcast i8* %14 to double*
%16 = load double, double* %15
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to double*
%19 = load double, double* %18
%20 = fcmp ogt double %16, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %13, %12
%24 = phi i32 [ -1, %12 ], [ %22, %13 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @dblCmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void _Unwind_GetLanguageSpecificData() { _unsupported(); }


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

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

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

LLVM IR (-O2):
define void @_Unwind_GetLanguageSpecificData() {
%1 = tail call i32 (...) @_unsupported()
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
void sincos(double r, double *restrict sr, double *restrict cr) {
  *sr = sin(r);
  *cr = cos(r);
}


x86 assembly (clang, -O0):
<sincos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sincos(double %0, double* noalias %1, double* noalias %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = call double @sin(double %7)
%9 = load double*, double** %5
store double %8, double* %9
%10 = load double, double* %4
%11 = call double @cos(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @sincos(double %0, double* noalias nocapture writeonly %1, double* noalias nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void stop_log() { closelog(); }


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

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

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

LLVM IR (-O2):
define void @stop_log() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void handler(int i) { write(2, "handler\n", 8); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
lea    0xed9(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"handler\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"handler\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_append_array_memfd(void *m, char type, int memfd) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_append_array_memfd>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ec6(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_append_array_memfd>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_array_memfd(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_array_memfd(i8* nocapture readnone %0, i8 signext %1, i32 %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_length_squared(int /*<<< orphan*/ *);
__attribute__((always_)) int32_t psvec2i_length_squared(struct vec2i *a) {
  return vec2i_length_squared((int32_t *)a);
}


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

x86 assembly (clang, -O2):
<psvec2i_length_squared>:
jmp    1030 <vec2i_length_squared@plt>

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define i32 @psvec2i_length_squared(%struct.vec2i* %0) {
%2 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %2
%3 = load %struct.vec2i*, %struct.vec2i** %2
%4 = bitcast %struct.vec2i* %3 to i32*
%5 = call i32 @vec2i_length_squared(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define i32 @psvec2i_length_squared(%struct.vec2i* %0) {
%2 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%3 = tail call i32 @vec2i_length_squared(i32* %2)
ret i32 %3
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
double sancus_time_ts_to_fp(const struct timespec *t) {
  double d = (double)t->tv_nsec;
  d /= 1000000000.;
  d += (double)t->tv_sec;
  return d;
}


x86 assembly (clang, -O0):
<sancus_time_ts_to_fp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_time_ts_to_fp>:
cvtsi2sdq 0x8(%rdi),%xmm1
divsd  0xef2(%rip),%xmm1
cvtsi2sdq (%rdi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @sancus_time_ts_to_fp(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca double
store %struct.timespec* %0, %struct.timespec** %2
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
store double %7, double* %3
%8 = load double, double* %3
%9 = fdiv double %8, 1.000000e+09
store double %9, double* %3
%10 = load %struct.timespec*, %struct.timespec** %2
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = load double, double* %3
%15 = fadd double %14, %13
store double %15, double* %3
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define double @sancus_time_ts_to_fp(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = fdiv double %4, 1.000000e+09
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fadd double %5, %8
ret double %9
}