xunge/DecIR huggingface dataset:
char *ft_strcpy(char *dst, const char *src) {
  int i;
  i = -1;
  while (*(src + ++i))
    *(dst + i) = *(src + i);
  *(dst + i) = '\0';
  return (dst);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1148 <ft_strcpy+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1113 <ft_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <ft_strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <ft_strcpy+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int ns_name_compress(char const *, int /*<<< orphan*/ *, size_t,
                     int /*<<< orphan*/ const **, int /*<<< orphan*/ const **);
int dn_comp(const char *src, u_char *dst, int dstsiz, u_char **dnptrs,
            u_char **lastdnptr) {
  return ns_name_compress(src, dst, (size_t)dstsiz, (const u_char **)dnptrs,
                          (const u_char **)lastdnptr);
}


x86 assembly (clang, -O0):
<dn_comp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <ns_name_compress@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dn_comp>:
movslq %edx,%rdx
jmp    1030 <ns_name_compress@plt>

LLVM IR (-O0):
define i32 @dn_comp(i8* %0, i32* %1, i32 %2, i32** %3, i32** %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32**
%10 = alloca i32**
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32** %3, i32*** %9
store i32** %4, i32*** %10
%11 = load i8*, i8** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = sext i32 %13 to i64
%15 = load i32**, i32*** %9
%16 = load i32**, i32*** %10
%17 = call i32 @ns_name_compress(i8* %11, i32* %12, i64 %14, i32** %15, i32** %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @dn_comp(i8* %0, i32* %1, i32 %2, i32** %3, i32** %4) {
%6 = sext i32 %2 to i64
%7 = tail call i32 @ns_name_compress(i8* %0, i32* %1, i64 %6, i32** %3, i32** %4)
ret i32 %7
}
char test7(void) { return '\b'; }


x86 assembly (clang, -O0):
<test7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7>:
mov    $0x8,%al
ret

LLVM IR (-O0):
define signext i8 @test7() {
ret i8 8
}

LLVM IR (-O2):
define signext i8 @test7() {
ret i8 8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void wi8(uint8_t a[1], uint8_t x) { a[0] = x >> 0; }


x86 assembly (clang, -O0):
<wi8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wi8>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @wi8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 0
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @wi8(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t decode_gray(uint32_t gray) {
  uint32_t i;
  for (i = gray >> 1; i != 0; i >>= 1)
    gray ^= i;
  return gray;
}


x86 assembly (clang, -O0):
<decode_gray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1131 <decode_gray+0x31>
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1110 <decode_gray+0x10>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_gray>:
mov    %edi,%edx
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%eax
sar    %ecx
mov    %ecx,%edi
xor    %eax,%edi
cmp    $0x1,%edx
mov    %ecx,%edx
ja     1110 <decode_gray+0x10>
ret

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

LLVM IR (-O2):
define i32 @decode_gray(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %7, %2 ]
%4 = phi i32 [ %0, %1 ], [ %5, %2 ]
%5 = ashr i32 %4, 1
%6 = icmp ult i32 %4, 2
%7 = xor i32 %5, %3
br i1 %6, label %8, label %2
8: ; preds = %2
ret i32 %3
}
int msg_sizeof(int msg) {
  int size = -1;
  switch (msg) {
  case 2:
    size = (sizeof(int));
    break;
  case 3:
    size = 2;
    break;
  case 4:
    size = (((12 + 7) / 8) * 20);
    break;
  case 5:
    size = 0;
    break;
  case 6:
    size = 0;
    break;
  case 7:
    size = 0;
    break;
  }
  return size;
}


x86 assembly (clang, -O0):
<msg_sizeof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     117a <msg_sizeof+0x7a>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x4,-0x8(%rbp)
jmp    117a <msg_sizeof+0x7a>
movl   $0x2,-0x8(%rbp)
jmp    117a <msg_sizeof+0x7a>
movl   $0x28,-0x8(%rbp)
jmp    117a <msg_sizeof+0x7a>
movl   $0x0,-0x8(%rbp)
jmp    117a <msg_sizeof+0x7a>
movl   $0x0,-0x8(%rbp)
jmp    117a <msg_sizeof+0x7a>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_sizeof>:
add    $0xfffffffe,%edi
mov    $0xffffffff,%eax
cmp    $0x5,%edi
ja     111a <msg_sizeof+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.msg_sizeof = [6 x i32] [i32 4, i32 2, i32 40, i32 0, i32 0, i32 0]
define i32 @msg_sizeof(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.msg_sizeof, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xac() {
  Assert_real((isbdigit(172) == 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_isbdigit.c",
              865, ("isbdigit should be 0 for 0xac"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xac>:
push   %rax
mov    $0xac,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x361,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xac\00"
define void @t_isbdigit_0xac() {
%1 = call i64 @isbdigit(i32 172)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 865, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xac\00"
define void @t_isbdigit_0xac() {
%1 = tail call i64 @isbdigit(i32 172)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 865, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printbits(int);
main() { printbits(15); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printbits(i32 15)
ret i32 0
}
/* Variables and functions */
size_t min_s(size_t a, size_t b) {
  if (a < b) {
    return a;
  }
  return b;
}


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

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

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

LLVM IR (-O2):
define i64 @min_s(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
bool lose() { return false; }


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

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

LLVM IR (-O0):
define i32 @lose() {
ret i32 0
}

LLVM IR (-O2):
define i32 @lose() {
ret i32 0
}
void psector_EraseUpdate(void) {
  void (*p_psector_EraseUpdate)(void);
  p_psector_EraseUpdate = (void (*)(void))0x03004d59U;
  p_psector_EraseUpdate();
}


x86 assembly (clang, -O0):
<psector_EraseUpdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3004d59,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psector_EraseUpdate>:
mov    $0x3004d59,%eax
jmp    *%rax

LLVM IR (-O0):
define void @psector_EraseUpdate() {
%1 = alloca void ()*
store void ()* inttoptr (i64 50351449 to void ()*), void ()** %1
%2 = load void ()*, void ()** %1
ret void
}

LLVM IR (-O2):
define void @psector_EraseUpdate() {
tail call void inttoptr (i64 50351449 to void ()*)()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ strnlen;
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  (void)strnlen;
  exit(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)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
@strnlen = global i32 0
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 = load i32, i32* @strnlen
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@strnlen = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void deletedtar_new_data_cb(const char *data, size_t len, void *userdata) {}


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

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

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

LLVM IR (-O2):
define void @deletedtar_new_data_cb(i8* nocapture %0, i64 %1, i8* nocapture %2) {
ret void
}
void f1() {
  int k, y;
  int abc = 1;
  long idx = abc + 3 * 5;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xf,%eax
cltq
mov    %rax,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 1, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 15
%7 = sext i32 %6 to i64
store i64 %7, i64* %4
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
void default_rte_instr_callback(void) {}


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

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

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

LLVM IR (-O2):
define void @default_rte_instr_callback() {
ret void
}
void create_pci_dev(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @create_pci_dev() {
ret void
}
/* Variables and functions */
double HUGE_VAL;
bool stdlib_base_is_positive_zero(const double x) {
  return (x == 0.0 && 1.0 / x == HUGE_VAL);
}


x86 assembly (clang, -O0):
<stdlib_base_is_positive_zero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jne    1149 <stdlib_base_is_positive_zero+0x49>
jp     1149 <stdlib_base_is_positive_zero+0x49>
movsd  0xed2(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
mov    0x2eae(%rip),%rax
ucomisd (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_is_positive_zero>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112d <stdlib_base_is_positive_zero+0x2d>
jp     112d <stdlib_base_is_positive_zero+0x2d>
movsd  0xeec(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    0x2ec9(%rip),%rax
cmpeqsd (%rax),%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@HUGE_VAL = global double 0.000000e+00
define i32 @stdlib_base_is_positive_zero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load double, double* %2
%7 = fdiv double 1.000000e+00, %6
%8 = load double, double* @HUGE_VAL
%9 = fcmp oeq double %7, %8
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@HUGE_VAL = global double 0.000000e+00
define i32 @stdlib_base_is_positive_zero(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fdiv double 1.000000e+00, %0
%5 = load double, double* @HUGE_VAL
%6 = fcmp oeq double %4, %5
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ logit(int, char *);
void handle_pipe(int sig) {
  logit(2, "catch a SIGPIPE signal");
  return;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"catch a SIGPIPE signal\00"
define void @handle_pipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @logit(i32 2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"catch a SIGPIPE signal\00"
define void @handle_pipe(i32 %0) {
%2 = tail call i32 @logit(i32 2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ss2txh(int);
void ss2txh_(int *enabledisable) { ss2txh(*enabledisable); }


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

x86 assembly (clang, -O2):
<ss2txh_>:
mov    (%rdi),%edi
jmp    1030 <ss2txh@plt>

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

LLVM IR (-O2):
define void @ss2txh_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ss2txh(i32 %2)
ret void
}
long bsr(unsigned long val) {
  long ret = -1;
  if (val != 0)
    asm("bsrq %1, %0" : "=r"(ret) : "r"(val));
  return ret;
}


x86 assembly (clang, -O0):
<bsr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
cmpq   $0x0,-0x8(%rbp)
je     1127 <bsr+0x27>
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsr>:
test   %rdi,%rdi
je     110a <bsr+0xa>
bsr    %rdi,%rax
ret
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @bsr(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 -1, i64* %3
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i64 asm "bsrq $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %7)
store i64 %8, i64* %3
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
define i64 @bsr(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 asm "bsrq $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
br label %5
5: ; preds = %3, %1
%6 = phi i64 [ %4, %3 ], [ -1, %1 ]
ret i64 %6
}
void gdk_colormap_query_color() {}


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

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

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

LLVM IR (-O2):
define void @gdk_colormap_query_color() {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmpstringp(const void *arg1, const void *arg2) {
  const char *const *ptr1 = (const char **)arg1;
  const char *const *ptr2 = (const char **)arg2;
  const char *str1 = *ptr1;
  const char *str2 = *ptr2;
  return strcmp(str1, str2);
}


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

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

LLVM IR (-O0):
define i32 @cmpstringp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i8**
store i8** %12, i8*** %6
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
store i8* %14, i8** %7
%15 = load i8**, i8*** %6
%16 = load i8*, i8** %15
store i8* %16, i8** %8
%17 = load i8*, i8** %7
%18 = load i8*, i8** %8
%19 = call i32 @strcmp(i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @cmpstringp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_usage(void) {
  fprintf(stdout, "Author: Incarnation P. Lee\n"
                  "        incarnation.p.lee@gmail.com\n\n"
                  "Usage: cbfi [OPTION]... [NUMERIC]\n\n"
                  "       -d, --detail\n"
                  "              show details of each field of float point.\n"
                  "       -f frac_num, --fixed\n"
                  "              specific fixed point format\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [247 x i8] c"Author: Incarnation P. Lee\0A incarnation.p.lee@gmail.com\0A\0AUsage: cbfi [OPTION]... [NUMERIC]\0A\0A -d, --detail\0A show details of each field of float point.\0A -f frac_num, --fixed\0A specific fixed point format\0A\00"
@EXIT_SUCCESS = global i32 0
define void @print_usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [247 x i8] c"Author: Incarnation P. Lee\0A incarnation.p.lee@gmail.com\0A\0AUsage: cbfi [OPTION]... [NUMERIC]\0A\0A -d, --detail\0A show details of each field of float point.\0A -f frac_num, --fixed\0A specific fixed point format\0A\00"
@EXIT_SUCCESS = global i32 0
define void @print_usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int y, *p, x;
  y = 0;
  p = &y;
  x = *p;
  x = 4;
  (*p)++;
  x--;
  (*p) += x;
  printf("y = %d\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"y = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_array();
void init() { init_array(); }


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

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

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

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @init_array()
ret void
}
int test_imm_18int16_mem(short *val) {
  return ((*val) & (-0x18 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_18int16_mem>:
movzwl (%rdi),%eax
test   $0xffe8,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_18int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -24
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void rdr2s_(dx, dy) short *dx, *dy;
{ rdr2((float)*dx, (float)*dy); }


x86 assembly (clang, -O0):
<rdr2s_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <rdr2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdr2s_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
mov    $0x2,%al
jmp    1030 <rdr2@plt>

LLVM IR (-O0):
define void @rdr2s_(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = fpext float %7 to double
%9 = load i16*, i16** %4
%10 = load i16, i16* %9
%11 = sitofp i16 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, ...) bitcast (i32 (...)* @rdr2 to i32 (double, double, ...)*)(double %8, double %12)
ret void
}

LLVM IR (-O2):
define void @rdr2s_(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = sitofp i16 %3 to double
%5 = load i16, i16* %1
%6 = sitofp i16 %5 to double
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @rdr2 to i32 (double, double, ...)*)(double %4, double %6)
ret void
}
void em_shutdown(sc) void *sc;
{}


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

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

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

LLVM IR (-O2):
define void @em_shutdown(i8* nocapture %0) {
ret void
}
int am_dumpallconfigs(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @am_dumpallconfigs() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @am_dumpallconfigs() {
ret i32 -1
}
float fsign(const float x) { return x >= 0 ? 1.0f : -1.0f; }


x86 assembly (clang, -O0):
<fsign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xeea(%rip),%xmm3
movss  0xee6(%rip),%xmm2
xorps  %xmm0,%xmm0
cmpless %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsign>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @fsign(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, float 1.000000e+00, float -1.000000e+00
ret float %6
}

LLVM IR (-O2):
define float @fsign(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float 1.000000e+00, float -1.000000e+00
ret float %3
}
/* Variables and functions */
float powf(float, float);
float gb_pow(float x, float y) { return powf(x, y); }


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

x86 assembly (clang, -O2):
<gb_pow>:
jmp    1030 <powf@plt>

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

LLVM IR (-O2):
define float @gb_pow(float %0, float %1) {
%3 = tail call float @powf(float %0, float %1)
ret float %3
}
void getHairCut() {}


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

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

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

LLVM IR (-O2):
define void @getHairCut() {
ret void
}
void g_string_append_printf() {}


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

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

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

LLVM IR (-O2):
define void @g_string_append_printf() {
ret void
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __mark_inode_dirty(struct inode *, int);
void mark_inode_dirty_sync(struct inode *inode) {
  __mark_inode_dirty(inode, 1);
}


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

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

LLVM IR (-O0):
%struct.inode = type { i32 }
define void @mark_inode_dirty_sync(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
%3 = load %struct.inode*, %struct.inode** %2
%4 = call i32 @__mark_inode_dirty(%struct.inode* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.inode = type { i32 }
define void @mark_inode_dirty_sync(%struct.inode* %0) {
%2 = tail call i32 @__mark_inode_dirty(%struct.inode* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_stack_free_strings();
int /*<<< orphan*/ test_stack_one();
void test_stack(void) {
  test_stack_one();
  test_stack_free_strings();
}


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

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

LLVM IR (-O0):
define void @test_stack() {
%1 = call i32 (...) @test_stack_one()
%2 = call i32 (...) @test_stack_free_strings()
ret void
}

LLVM IR (-O2):
define void @test_stack() {
%1 = tail call i32 (...) @test_stack_one()
%2 = tail call i32 (...) @test_stack_free_strings()
ret void
}
void g5_close() { return; }


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

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

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

LLVM IR (-O2):
define void @g5_close() {
ret void
}
void VMR3GetVM(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3GetVM() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ swapStr(char *);
int main() {
  char str[100];
  scanf("%s", str);
  int n;
  scanf("%d", &n);
  swapStr(str);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea8(%rip),%rdi
lea    -0x74(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <swapStr@plt>
lea    -0x70(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0xec2(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeac(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <swapStr@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @swapStr(i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = bitcast i32* %2 to i8*
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 @swapStr(i8* %3)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int errno;
int pipe(int *);
int __sulong_posix_pipe(int pipefd[2]) {
  {
    int native_errno = errno;
    int result = pipe(pipefd);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    114e <__sulong_posix_pipe+0x3e>
xor    %eax,%eax
mov    0x2e99(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2e88(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_pipe>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <pipe@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_pipe(i32* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @pipe(i32* %0)
%4 = icmp eq i32 %3, -1
%5 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
%7 = select i1 %4, i32 %6, i32 %3
store i32 %2, i32* @errno
ret i32 %7
}
int *csr_fd() {
  static int csrsafe = 0;
  return &csrsafe;
}


x86 assembly (clang, -O0):
<csr_fd>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f19(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<csr_fd>:
lea    0x2f1d(%rip),%rax
ret

LLVM IR (-O0):
@csr_fd.csrsafe = internal global i32 0
define i32* @csr_fd() {
ret i32* @csr_fd.csrsafe
}

LLVM IR (-O2):
@csr_fd.csrsafe = internal global i32 0
define i32* @csr_fd() {
ret i32* @csr_fd.csrsafe
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void read_Half_array(int *A) {
  int i, j = 0, x;
  for (i = 0; i < 524288 / 2; ++i) {
    x = A[i];
  }
  ++j;
  printf("i %d j %d", i, j);
}


x86 assembly (clang, -O0):
<read_Half_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40000,-0xc(%rbp)
jge    1153 <read_Half_array+0x43>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <read_Half_array+0x1a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_Half_array>:
lea    0xee9(%rip),%rdi
mov    $0x40000,%esi
mov    $0x1,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"i %d j %d\00"
define void @read_Half_array(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 262144
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %5
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %6
18: ; preds = %6
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"i %d j %d\00"
define void @read_Half_array(i32* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 262144, i32 1)
ret void
}
int HelpItem55(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem55() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem55() {
ret i32 0
}
/* Variables and functions */
int ENODEV;
int gt_bw_setbw(unsigned int bw) { return -ENODEV; }


x86 assembly (clang, -O0):
<gt_bw_setbw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed0(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @gt_bw_setbw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @gt_bw_setbw(i32 %0) {
%2 = load i32, i32* @ENODEV
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int cache_line_size();
size_t optimal_alignment(const size_t stride) {
  return (sizeof(void *) * cache_line_size() * stride);
}


x86 assembly (clang, -O0):
<optimal_alignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <cache_line_size@plt>
cltq
shl    $0x3,%rax
imul   -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optimal_alignment>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <cache_line_size@plt>
cltq
imul   %rbx,%rax
shl    $0x3,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @optimal_alignment(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @cache_line_size()
%4 = sext i32 %3 to i64
%5 = mul i64 8, %4
%6 = load i64, i64* %2
%7 = mul i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @optimal_alignment(i64 %0) {
%2 = tail call i32 (...) @cache_line_size()
%3 = sext i32 %2 to i64
%4 = shl i64 %0, 3
%5 = mul i64 %4, %3
ret i64 %5
}
int cairo_code_draw_casSLabel_get_height() { return 10; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casSLabel_get_height() {
ret i32 10
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casSLabel_get_height() {
ret i32 10
}
/* Variables and functions */
scalar_t__ isspace(char);
char *strip_pre_ws(char *str) {
  char *p;
  p = str;
  while (*p && isspace(*p))
    p++;
  return (p);
}


x86 assembly (clang, -O0):
<strip_pre_ws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114f <strip_pre_ws+0x3f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115f <strip_pre_ws+0x4f>
jmp    1170 <strip_pre_ws+0x60>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strip_pre_ws+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_pre_ws>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <strip_pre_ws+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <strip_pre_ws+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strip_pre_ws+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strip_pre_ws(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}