xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ ts_hex_dump_buf(char *, int, int /*<<< orphan*/ *, int, int);
char *ts_hex_dump(uint8_t *d, int size, int col) {
  char *buf = malloc(size * 6);
  if (!buf)
    return NULL;
  ts_hex_dump_buf(buf, size * 6, d, size, col);
  return buf;
}


x86 assembly (clang, -O0):
<ts_hex_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
imul   $0x6,-0x14(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1157 <ts_hex_dump+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1177 <ts_hex_dump+0x57>
mov    -0x20(%rbp),%rdi
imul   $0x6,-0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1040 <ts_hex_dump_buf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_hex_dump>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r12,%r12,1),%eax
lea    (%rax,%rax,2),%ebx
mov    %ebx,%edi
call   1030 <malloc@plt>
mov    %rax,%rbp
test   %rax,%rax
je     115a <ts_hex_dump+0x3a>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
mov    %r12d,%ecx
mov    %r14d,%r8d
call   1040 <ts_hex_dump_buf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ts_hex_dump(i32* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = mul nsw i32 %9, 6
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %8
%12 = load i8*, i8** %8
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %3
store i8* null, i8** %4
br label %24
15: ; preds = %3
%16 = load i8*, i8** %8
%17 = load i32, i32* %6
%18 = mul nsw i32 %17, 6
%19 = load i32*, i32** %5
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = call i32 @ts_hex_dump_buf(i8* %16, i32 %18, i32* %19, i32 %20, i32 %21)
%23 = load i8*, i8** %8
store i8* %23, i8** %4
br label %24
24: ; preds = %15, %14
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @ts_hex_dump(i32* %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, 6
%5 = tail call i8* @malloc(i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @ts_hex_dump_buf(i8* %5, i32 %4, i32* %0, i32 %1, i32 %2)
br label %9
9: ; preds = %3, %7
ret i8* %5
}
int __attribute__((regparm(1), no)) foo(int x) {
  x = 0;
  __asm__ __volatile__("call bar" : "=a"(x) : "a"(x));
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
call   1030 <bar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
call   1030 <bar@plt>
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 asm sideeffect "call bar", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 asm sideeffect "call bar", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret i32 undef
}
unsigned int irmo_string_hash(void *string) {
  unsigned int result = 5381;
  unsigned char *p;
  p = (unsigned char *)string;
  while (*p != '\0') {
    result = (result << 5) + result + *p;
    ++p;
  }
  return result;
}


x86 assembly (clang, -O0):
<irmo_string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     114d <irmo_string_hash+0x4d>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <irmo_string_hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irmo_string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <irmo_string_hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <irmo_string_hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @irmo_string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%8 = zext i8 %5 to i32
%9 = mul i32 %7, 33
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
int test_imm_ECuint32_mem(unsigned int *val) {
  return ((*val) & (0xEC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ECuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 236
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_74uint32_reg(unsigned int val) {
  return ((val) & (0x74 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_74uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x74,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_74uint32_reg>:
test   $0x74,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_74uint32_reg(i32 %0) {
%2 = and i32 %0, 116
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo_2_1_2_1_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_1_2_1_1_1() {
ret void
}
/* Variables and functions */
int recv(int, void *, int, int /*<<< orphan*/);
int su_tcp_recv(int fd, void *buf, int len) { return recv(fd, buf, len, 0); }


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

x86 assembly (clang, -O2):
<su_tcp_recv>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @su_tcp_recv(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
struct dma_buf_sync {
  int flags;
};

/* Variables and functions */
int /*<<< orphan*/ DMA_BUF_IOCTL_SYNC;
int DMA_BUF_SYNC_RW;
int ioctl(int, int /*<<< orphan*/, struct dma_buf_sync *);
int dmabuf_sync(int fd, int start_stop) {
  struct dma_buf_sync sync = {
      .flags = start_stop | DMA_BUF_SYNC_RW,
  };
  return ioctl(fd, DMA_BUF_IOCTL_SYNC, &sync);
}


x86 assembly (clang, -O0):
<dmabuf_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec8(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmabuf_sync>:
push   %rax
mov    0x2ed8(%rip),%rax
or     (%rax),%esi
mov    %esi,(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.dma_buf_sync = type { i32 }
@DMA_BUF_SYNC_RW = global i32 0
@DMA_BUF_IOCTL_SYNC = global i32 0
define i32 @dmabuf_sync(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.dma_buf_sync
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.dma_buf_sync, %struct.dma_buf_sync* %5, i32 0, i32 0
%7 = load i32, i32* %4
%8 = load i32, i32* @DMA_BUF_SYNC_RW
%9 = or i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* @DMA_BUF_IOCTL_SYNC
%12 = call i32 @ioctl(i32 %10, i32 %11, %struct.dma_buf_sync* %5)
ret i32 %12
}

LLVM IR (-O2):
%struct.dma_buf_sync = type { i32 }
@DMA_BUF_SYNC_RW = global i32 0
@DMA_BUF_IOCTL_SYNC = global i32 0
define i32 @dmabuf_sync(i32 %0, i32 %1) {
%3 = alloca %struct.dma_buf_sync
%4 = bitcast %struct.dma_buf_sync* %3 to i8*
%5 = getelementptr inbounds %struct.dma_buf_sync, %struct.dma_buf_sync* %3, i64 0, i32 0
%6 = load i32, i32* @DMA_BUF_SYNC_RW
%7 = or i32 %6, %1
store i32 %7, i32* %5
%8 = load i32, i32* @DMA_BUF_IOCTL_SYNC
%9 = call i32 @ioctl(i32 %0, i32 %8, %struct.dma_buf_sync* %3)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x18() {
  Assert_real((ispunct(24) == 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_ispunct.c",
              125, ("ispunct should be 0 for 0x18"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x18>:
push   %rax
mov    $0x18,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x7d,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x18\00"
define void @t_ispunct_0x18() {
%1 = call i64 @ispunct(i32 24)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x18\00"
define void @t_ispunct_0x18() {
%1 = tail call i64 @ispunct(i32 24)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __gmp_assert_header(char const *, int);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char const *, char const *);
void __gmp_assert_fail(char const *filename, int linenum, char const *expr) {
  {
    __gmp_assert_header(filename, linenum);
    printf((char const *__restrict)"GNU MP assertion failed: %s\n", expr);
    abort();
  }
}


x86 assembly (clang, -O0):
<__gmp_assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <__gmp_assert_header@plt>
mov    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__gmp_assert_fail>:
push   %rbx
mov    %rdx,%rbx
call   1050 <__gmp_assert_header@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"GNU MP assertion failed: %s\0A\00"
define void @__gmp_assert_fail(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @__gmp_assert_header(i8* %7, i32 %8)
%10 = load i8*, i8** %6
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"GNU MP assertion failed: %s\0A\00"
define void @__gmp_assert_fail(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @__gmp_assert_header(i8* %0, i32 %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = tail call i32 (...) @abort()
unreachable
}
void getgp_(x, y, z) float *x, *y, *z;
{ getgp(x, y, z); }


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

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

LLVM IR (-O0):
define void @getgp_(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float*, float** %5
%9 = load float*, float** %6
%10 = call i32 (float*, float*, float*, ...) bitcast (i32 (...)* @getgp to i32 (float*, float*, float*, ...)*)(float* %7, float* %8, float* %9)
ret void
}

LLVM IR (-O2):
define void @getgp_(float* %0, float* %1, float* %2) {
%4 = tail call i32 (float*, float*, float*, ...) bitcast (i32 (...)* @getgp to i32 (float*, float*, float*, ...)*)(float* %0, float* %1, float* %2)
ret void
}
long f(double x) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @f(double %0) {
ret i64 undef
}
char *str_stripspc_copy(dest, source)
char *dest, *source;
{
  char buffer[256], *bufptr;
  strcpy(buffer, source);
  bufptr = str_strip_lead_end_space(buffer);
  return strcpy(dest, bufptr);
}


x86 assembly (clang, -O0):
<str_stripspc_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
mov    $0x0,%al
call   1040 <str_strip_lead_end_space@plt>
cltq
mov    %rax,-0x118(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x118(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_stripspc_copy>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <str_strip_lead_end_space@plt>
movslq %eax,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_stripspc_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %4
%9 = call i8* @strcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @str_strip_lead_end_space to i32 (i8*, ...)*)(i8* %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %6
%14 = load i8*, i8** %3
%15 = load i8*, i8** %6
%16 = call i8* @strcpy(i8* %14, i8* %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @str_stripspc_copy(i8* returned %0, i8* nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i8* @strcpy(i8* %4, i8* dereferenceable(1) %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @str_strip_lead_end_space to i32 (i8*, ...)*)(i8* %4)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %8)
ret i8* %0
}
/* Type definitions */
struct seq_file {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ seq_puts(struct seq_file *, char *);
void pp_stats_pid_header(struct seq_file *m) {
  seq_puts(m, "idx iface acct_tag_hex uid_tag_int cnt_set "
              "rx_bytes rx_packets "
              "tx_bytes tx_packets "
              "pid comm "
              "rx_tcp_bytes rx_tcp_packets "
              "rx_udp_bytes rx_udp_packets "
              "rx_other_bytes rx_other_packets "
              "tx_tcp_bytes tx_tcp_packets "
              "tx_udp_bytes tx_udp_packets "
              "tx_other_bytes tx_other_packets\n");
}


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

x86 assembly (clang, -O2):
<pp_stats_pid_header>:
lea    0xee9(%rip),%rsi
jmp    1030 <seq_puts@plt>

LLVM IR (-O0):
%struct.seq_file = type { i32 }
@.str = [269 x i8] c"idx iface acct_tag_hex uid_tag_int cnt_set rx_bytes rx_packets tx_bytes tx_packets pid comm rx_tcp_bytes rx_tcp_packets rx_udp_bytes rx_udp_packets rx_other_bytes rx_other_packets tx_tcp_bytes tx_tcp_packets tx_udp_bytes tx_udp_packets tx_other_bytes tx_other_packets\0A\00"
define void @pp_stats_pid_header(%struct.seq_file* %0) {
%2 = alloca %struct.seq_file*
store %struct.seq_file* %0, %struct.seq_file** %2
%3 = load %struct.seq_file*, %struct.seq_file** %2
%4 = call i32 @seq_puts(%struct.seq_file* %3, i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.seq_file = type { i32 }
@.str = [269 x i8] c"idx iface acct_tag_hex uid_tag_int cnt_set rx_bytes rx_packets tx_bytes tx_packets pid comm rx_tcp_bytes rx_tcp_packets rx_udp_bytes rx_udp_packets rx_other_bytes rx_other_packets tx_tcp_bytes tx_tcp_packets tx_udp_bytes tx_udp_packets tx_other_bytes tx_other_packets\0A\00"
define void @pp_stats_pid_header(%struct.seq_file* %0) {
%2 = tail call i32 @seq_puts(%struct.seq_file* %0, i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fatfs_open(char const *, int);
int _open(const char *pathname, int flags) {
  int ret;
  ret = fatfs_open(pathname, flags);
  return ret;
}


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

x86 assembly (clang, -O2):
<_open>:
jmp    1030 <fatfs_open@plt>

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

LLVM IR (-O2):
define i32 @_open(i8* %0, i32 %1) {
%3 = tail call i32 @fatfs_open(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mensagemA();
int /*<<< orphan*/ mensagemB();
int main() {
  mensagemA();
  mensagemB();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mensagemA()
%2 = tail call i32 (...) @mensagemB()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
int /*<<< orphan*/ snprintf(char *, int /*<<< orphan*/, char *,
                            int /*<<< orphan*/, int, int);
char *get_sysinfo_version(char *version) {
  snprintf(version, BUFSIZ, "%i.%i.%i", 0, 2, 2);
  return version;
}


x86 assembly (clang, -O0):
<get_sysinfo_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdx
xor    %ecx,%ecx
mov    $0x2,%r9d
mov    %r9d,%r8d
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sysinfo_version>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdx
xor    %ecx,%ecx
mov    $0x2,%r8d
mov    $0x2,%r9d
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @get_sysinfo_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @BUFSIZ
%5 = call i32 @snprintf(i8* %3, i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0, i32 2, i32 2)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @get_sysinfo_version(i8* returned %0) {
%2 = load i32, i32* @BUFSIZ
%3 = tail call i32 @snprintf(i8* %0, i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0, i32 2, i32 2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void Usage(void) {
  printf("shptreedump [-maxdepth n] [-search xmin ymin xmax ymax]\n"
         "            [-v] shp_file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [83 x i8] c"shptreedump [-maxdepth n] [-search xmin ymin xmax ymax]\0A [-v] shp_file\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [82 x i8] c"shptreedump [-maxdepth n] [-search xmin ymin xmax ymax]\0A [-v] shp_file\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int _sys_toupper(int c) {
  if (c >= 'a' && c <= 'z') {
    return (c - 'a' + 'A');
  } else {
    return (c);
  }
}


x86 assembly (clang, -O0):
<_sys_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <_sys_toupper+0x2c>
cmpl   $0x7a,-0x8(%rbp)
jg     112c <_sys_toupper+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <_sys_toupper+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sys_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @_sys_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 97
%12 = add nsw i32 %11, 65
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @_sys_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_char(signed char n) { printf("%hhd", n); }


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%hhd\00"
define void @print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%hhd\00"
define void @print_char(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m5_exit(int /*<<< orphan*/);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ usage();
void do_exit(int argc, char *argv[]) {
  if (argc > 1)
    usage();
  m5_exit((argc > 0) ? strtoul(argv[0], NULL, 0) : 0);
}


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1150 <do_exit+0x20>
mov    $0x0,%al
call   1030 <usage@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1174 <do_exit+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,-0x14(%rbp)
jmp    117e <do_exit+0x4e>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    117e <do_exit+0x4e>
mov    -0x14(%rbp),%edi
call   1050 <m5_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_exit>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     1142 <do_exit+0x12>
xor    %eax,%eax
call   1030 <usage@plt>
jmp    114b <do_exit+0x1b>
mov    %edi,%eax
xor    %edi,%edi
cmp    $0x1,%eax
jne    1159 <do_exit+0x29>
mov    (%rbx),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <m5_exit@plt>

LLVM IR (-O0):
define void @do_exit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @usage()
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @strtoul(i8* %15, i32* null, i32 0)
br label %18
17: ; preds = %9
br label %18
18: ; preds = %17, %12
%19 = phi i32 [ %16, %12 ], [ 0, %17 ]
%20 = call i32 @m5_exit(i32 %19)
ret void
}

LLVM IR (-O2):
define void @do_exit(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %8
6: ; preds = %2
%7 = icmp eq i32 %0, 1
br i1 %7, label %8, label %11
8: ; preds = %4, %6
%9 = load i8*, i8** %1
%10 = tail call i32 @strtoul(i8* nocapture %9, i32* null, i32 0)
br label %11
11: ; preds = %6, %8
%12 = phi i32 [ %10, %8 ], [ 0, %6 ]
%13 = tail call i32 @m5_exit(i32 %12)
ret void
}
int a_to_i(char s[]) {
  int n = 0;
  for (; *s >= '0' && *s <= '9'; ++s)
    n = 10 * n + (*s - '0');
  return n;
}


x86 assembly (clang, -O0):
<a_to_i>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <a_to_i+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <a_to_i+0x44>
jmp    1168 <a_to_i+0x68>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <a_to_i+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_to_i>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <a_to_i+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <a_to_i+0x20>
ret

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

LLVM IR (-O2):
define i32 @a_to_i(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = phi i8* [ %13, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("Hello Linux!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello Linux!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcomplex32array(void *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 32));
}


x86 assembly (clang, -O0):
<popcomplex32array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x5,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcomplex32array>:
shl    $0x5,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popcomplex32array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 32
%8 = call i32 @popNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @popcomplex32array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
void *_Locale_time_create(const char *__DUMMY_PAR,
                          struct _Locale_name_hint *hint) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
define noalias i8* @_Locale_time_create(i8* nocapture readnone %0, %struct._Locale_name_hint* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
char *get_ident_path();
char *write_ident(char *buf) {
  FILE *f;
  char *p = get_ident_path();
  f = fopen(p, "w");
  free(p);
  if (f != NULL) {
    fputs(buf, f);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<write_ident>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <get_ident_path@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x18(%rbp)
je     11a5 <write_ident+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ident>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1060 <get_ident_path@plt>
mov    %rax,%rbx
lea    0xe97(%rip),%rsi
mov    %rax,%rdi
call   1070 <fopen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r15,%r15
je     1194 <write_ident+0x44>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <fputs@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i8* @write_ident(i8* nocapture %0) {
%2 = tail call i8* (...) @get_ident_path()
%3 = tail call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @free(i8* %2)
%5 = icmp eq i32* %3, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 @fputs(i8* %0, i32* %3)
%8 = tail call i32 @fclose(i32* %3)
br label %9
9: ; preds = %6, %1
ret i8* undef
}
float check5(float x, float y) { return __builtin_copysignf(-x, -y); }


x86 assembly (clang, -O0):
<check5>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movaps 0xec7(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xecc(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<check5>:
xorps  0xef9(%rip),%xmm1
movaps 0xf02(%rip),%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @check5(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 = fneg float %5
%7 = load float, float* %4
%8 = fneg float %7
%9 = call float @llvm.copysign.f32(float %6, float %8)
ret float %9
}

LLVM IR (-O2):
define float @check5(float %0, float %1) {
%3 = fneg float %1
%4 = tail call float @llvm.copysign.f32(float %0, float %3)
ret float %4
}
void halt(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <halt+0x9>
jmp    1109 <halt+0x9>

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

LLVM IR (-O0):
define void @halt() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @halt() {
br label %1
1: ; preds = %0, %1
br label %1
}
void mainMenuFunc(int menu) {}


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

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

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

LLVM IR (-O2):
define void @mainMenuFunc(i32 %0) {
ret void
}
void keep_around(volatile void *ptr) { asm("" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @keep_around(i8* nocapture readnone %0) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned char strcmpb(void *s1, void *s2, unsigned count) {
  unsigned char ret;
  __asm__ __volatile__(
      "cld;                               rep;                               "
      "cmpsb;                               je 1f;                             "
      "  movb $0,%%al;                                jmp 2f;                  "
      "             1: movb $1,%%al;                               2:"
      : "=aN"(ret)
      : "c"(count), "D"(s1), "S"(s2));
  return ret;
}


x86 assembly (clang, -O0):
<strcmpb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
cld
repz cmpsb %es:(%rdi),%ds:(%rsi)
je     112a <strcmpb+0x2a>
mov    $0x0,%al
jmp    112c <strcmpb+0x2c>
mov    $0x1,%al
mov    %al,-0x15(%rbp)
movzbl -0x15(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmpb>:
mov    %edx,%ecx
cld
repz cmpsb %es:(%rdi),%ds:(%rsi)
je     110b <strcmpb+0xb>
mov    $0x0,%al
jmp    110d <strcmpb+0xd>
mov    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @strcmpb(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i8 asm sideeffect "cld; rep; cmpsb; je 1f; movb $$0,%al; jmp 2f; 1: movb $$1,%al; 2:", "={ax}N,{cx},{di},{si},~{dirflag},~{fpsr},~{flags}"(i32 %8, i8* %9, i8* %10)
store i8 %11, i8* %7
%12 = load i8, i8* %7
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @strcmpb(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8 asm sideeffect "cld; rep; cmpsb; je 1f; movb $$0,%al; jmp 2f; 1: movb $$1,%al; 2:", "={ax}N,{cx},{di},{si},~{dirflag},~{fpsr},~{flags}"(i32 %2, i8* %0, i8* %1)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void dynstr_reset(char **this_ptr) {
  if ((*this_ptr)) {
    free((*this_ptr));
    (*this_ptr) = NULL;
  }
}


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

x86 assembly (clang, -O2):
<dynstr_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <dynstr_reset+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @dynstr_reset(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
double tosReal_add(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<tosReal_add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosReal_add>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @tosReal_add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ acc_present_or_copyin(int *, int);
int main(int argc, char *argv[]) {
  int i;
  acc_present_or_copyin(&i, sizeof i);
#pragma acc enter data create(i)
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1030 <acc_present_or_copyin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @acc_present_or_copyin(i32* %3, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoLoadReactionSmarts(int);
int indigoReadBuffer(char const *, int);
__attribute__((visibility("default"))) int
indigoLoadReactionSmartsFromBuffer(const char *buf, int size) {
  int source = indigoReadBuffer(buf, size);
  int result;
  if (source <= 0)
    return -1;
  result = indigoLoadReactionSmarts(source);
  indigoFree(source);
  return result;
}


x86 assembly (clang, -O0):
<indigoLoadReactionSmartsFromBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <indigoReadBuffer@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1164 <indigoLoadReactionSmartsFromBuffer+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <indigoLoadReactionSmartsFromBuffer+0x4d>
mov    -0x18(%rbp),%edi
call   1050 <indigoLoadReactionSmarts@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <indigoFree@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoLoadReactionSmartsFromBuffer>:
push   %rbp
push   %rbx
push   %rax
call   1040 <indigoReadBuffer@plt>
test   %eax,%eax
jle    1152 <indigoLoadReactionSmartsFromBuffer+0x22>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <indigoLoadReactionSmarts@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <indigoFree@plt>
mov    %ebp,%eax
jmp    1157 <indigoLoadReactionSmartsFromBuffer+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @indigoLoadReactionSmartsFromBuffer(i8* %0, i32 %1) {
%3 = tail call i32 @indigoReadBuffer(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @indigoLoadReactionSmarts(i32 %3)
%7 = tail call i32 @indigoFree(i32 %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %9
}
void TimerAutoReloadSet(unsigned long ulBase, unsigned long ulARRValue) {

  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) = ulARRValue;
}


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

x86 assembly (clang, -O2):
<TimerAutoReloadSet>:
mov    %rsi,0x2c(%rdi)
ret

LLVM IR (-O0):
define void @TimerAutoReloadSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 44
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerAutoReloadSet(i64 %0, i64 %1) {
%3 = add i64 %0, 44
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}