xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ fatal_error(char *);
void *new_object(size_t size) {
  void *p = calloc(1, size);
  if (p == NULL)
    fatal_error("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<new_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <new_object+0x35>
lea    0xeb0(%rip),%rdi
call   1040 <fatal_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_object>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <new_object+0x22>
lea    0xec3(%rip),%rdi
call   1040 <fatal_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @new_object(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @new_object(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ COND_CS();
int /*<<< orphan*/ EA_A7_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_scs_8_pd7(void) {
  m68ki_write_8(EA_A7_PD_8(), COND_CS() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_scs_8_pd7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_A7_PD_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_CS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_scs_8_pd7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_A7_PD_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_CS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_scs_8_pd7() {
%1 = call i32 (...) @EA_A7_PD_8()
%2 = call i64 (...) @COND_CS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_scs_8_pd7() {
%1 = tail call i32 (...) @EA_A7_PD_8()
%2 = tail call i64 (...) @COND_CS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ same_screen;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
int get_XKeyEvent_same_screen(void *_p) {
  return (int)((XKeyEvent *)_p)->same_screen;
}


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

x86 assembly (clang, -O2):
<get_XKeyEvent_same_screen>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XKeyEvent_same_screen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XKeyEvent_same_screen(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sockaddr_in *);
void tow_internet_socket_address_free(struct sockaddr_in *socket_address) {
  free(socket_address);
}


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

x86 assembly (clang, -O2):
<tow_internet_socket_address_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define void @tow_internet_socket_address_free(%struct.sockaddr_in* nocapture %0) {
%2 = tail call i32 @free(%struct.sockaddr_in* %0)
ret void
}
/* Variables and functions */
int size_bytes_to_code(size_t);
bool is_rom_size_valid(size_t size) { return size_bytes_to_code(size) != 0x8; }


x86 assembly (clang, -O0):
<is_rom_size_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <size_bytes_to_code@plt>
cmp    $0x8,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rom_size_valid>:
push   %rax
call   1030 <size_bytes_to_code@plt>
xor    %ecx,%ecx
cmp    $0x8,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_rom_size_valid(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @size_bytes_to_code(i64 %3)
%5 = icmp ne i32 %4, 8
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_rom_size_valid(i64 %0) {
%2 = tail call i32 @size_bytes_to_code(i64 %0)
%3 = icmp ne i32 %2, 8
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *rte_memcpy_func(void *dst, const void *src, size_t n) {
  return memcpy(dst, src, n);
}


x86 assembly (clang, -O0):
<rte_memcpy_func>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_memcpy_func>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @rte_memcpy_func(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int tirar(int);
int dPorcentaje() { return tirar(10) * 10; }


x86 assembly (clang, -O0):
<dPorcentaje>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <tirar@plt>
imul   $0xa,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dPorcentaje>:
push   %rax
mov    $0xa,%edi
call   1030 <tirar@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dPorcentaje() {
%1 = call i32 @tirar(i32 10)
%2 = mul nsw i32 %1, 10
ret i32 %2
}

LLVM IR (-O2):
define i32 @dPorcentaje() {
%1 = tail call i32 @tirar(i32 10)
%2 = mul nsw i32 %1, 10
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
void rewind(FILE *file) { fseek(file, 0L, SEEK_SET); }


x86 assembly (clang, -O0):
<rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @rewind(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fseek(i32* %3, i64 0, i32 %4)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @rewind(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int htxcmd_send_command(int socket_fd, char *command_string) {
  int result;
  result = send(socket_fd, command_string, strlen(command_string), 0);
  if (result == -1) {
    perror("ERROR: while sending command to SUT. Exiting...");
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<htxcmd_send_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1199 <htxcmd_send_command+0x59>
lea    0xe76(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htxcmd_send_command>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
je     116a <htxcmd_send_command+0x2a>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe8f(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"ERROR: while sending command to SUT. Exiting...\00"
define i32 @htxcmd_send_command(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @send(i32 %6, i8* %7, i32 %9, i32 0)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [48 x i8] c"ERROR: while sending command to SUT. Exiting...\00"
define i32 @htxcmd_send_command(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int foo_compare(uint32_t keyA, uint32_t keyB) { return keyA - keyB; }


x86 assembly (clang, -O0):
<foo_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_compare>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @foo_compare(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo_compare(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
char *strdup(char const *);
int /*<<< orphan*/ sys_errmsg(char *);
__attribute__((unused)) char *xstrdup(const char *s) {
  char *t;
  if (s == NULL)
    return NULL;
  t = strdup(s);
  if (t == NULL)
    sys_errmsg("out of memory");
  return t;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1170 <xstrdup+0x50>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <xstrdup+0x48>
lea    0xe9d(%rip),%rdi
call   1030 <sys_errmsg@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
test   %rdi,%rdi
je     113e <xstrdup+0x1e>
call   1040 <strdup@plt>
test   %rax,%rax
je     1132 <xstrdup+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1030 <sys_errmsg@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @sys_errmsg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ check_write(unsigned short, int /*<<< orphan*/, char *);
void outsl(unsigned short int port, const void *addr, unsigned long int count) {
  for (unsigned long int i = 0; i < count; i++) {
    check_write(port + i, 0, "insb");
  }
}


x86 assembly (clang, -O0):
<outsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1167 <outsl+0x57>
movzwl -0x2(%rbp),%eax
add    -0x20(%rbp),%rax
xor    %esi,%esi
lea    0xeb2(%rip),%rdx
movzwl %ax,%edi
call   1030 <check_write@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112f <outsl+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsl>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
je     1148 <outsl+0x38>
mov    %rdx,%rbx
mov    %edi,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movzwl %bp,%ebp
mov    %ebp,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <check_write@plt>
add    $0x1,%ebp
add    $0xffffffffffffffff,%rbx
jne    1130 <outsl+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"insb\00"
define void @outsl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %19, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i16, i16* %4
%14 = zext i16 %13 to i64
%15 = load i64, i64* %7
%16 = add i64 %14, %15
%17 = trunc i64 %16 to i16
%18 = call i32 @check_write(i16 zeroext %17, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %12
%20 = load i64, i64* %7
%21 = add i64 %20, 1
store i64 %21, i64* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"insb\00"
define void @outsl(i16 zeroext %0, i8* nocapture readnone %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = trunc i64 %7 to i16
%9 = add i16 %8, %0
%10 = tail call i32 @check_write(i16 zeroext %9, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %2
br i1 %12, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int int_div_ceil(int divident, int divisor) {
  assert(divident >= 0 && divisor > 0);
  return (divident + (divisor - 1)) / divisor;
}


x86 assembly (clang, -O0):
<int_div_ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1137 <int_div_ceil+0x27>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
cltd
idivl  -0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_div_ceil>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
test   %edi,%edi
setns  %al
test   %esi,%esi
setg   %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
lea    (%r14,%rbx,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %ebx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @int_div_ceil(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = add nsw i32 %14, %16
%18 = load i32, i32* %4
%19 = sdiv i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @int_div_ceil(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = add i32 %0, -1
%9 = add i32 %8, %1
%10 = sdiv i32 %9, %1
ret i32 %10
}
/* Variables and functions */
unsigned char _rotl8(unsigned char, unsigned char);
unsigned char test_rotl8(unsigned char value, unsigned char shift) {
  return _rotl8(value, shift);
}


x86 assembly (clang, -O0):
<test_rotl8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1030 <_rotl8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rotl8>:
jmp    1030 <_rotl8@plt>

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

LLVM IR (-O2):
define zeroext i8 @test_rotl8(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call zeroext i8 @_rotl8(i8 zeroext %0, i8 zeroext %1)
ret i8 %3
}
/* Variables and functions */
size_t toku_fs_get_blocksize(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @toku_fs_get_blocksize() {
ret i64 0
}

LLVM IR (-O2):
define i64 @toku_fs_get_blocksize() {
ret i64 0
}
/* Variables and functions */
int ccommand(char ***);
int tool_main(int, char **);
int main() {
  int argc;
  char **argv;
  argc = ccommand(&argv);
  return tool_main(argc, argv);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <ccommand@plt>
mov    (%rsp),%rsi
mov    %eax,%edi
call   1030 <tool_main@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8**
%2 = bitcast i8*** %1 to i8*
%3 = call i32 @ccommand(i8*** %1)
%4 = load i8**, i8*** %1
%5 = call i32 @tool_main(i32 %3, i8** %4)
ret i32 %5
}
void print_meminfo() {}


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

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

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

LLVM IR (-O2):
define void @print_meminfo() {
ret void
}
/* Variables and functions */
long long strtoll(char const *, char **, unsigned int);
long long asc2llong(const char *s, unsigned base, int ignore_errors) {
  char *endp;
  long long rc = strtoll(s, &endp, base);
  if (*endp && !ignore_errors) {
    return -1;
  }
  return rc;
}


x86 assembly (clang, -O0):
<asc2llong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rsi
call   1030 <strtoll@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <asc2llong+0x4d>
cmpl   $0x0,-0x18(%rbp)
jne    115d <asc2llong+0x4d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1165 <asc2llong+0x55>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asc2llong>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%edx
lea    0x8(%rsp),%rsi
call   1030 <strtoll@plt>
mov    0x8(%rsp),%rcx
xor    %edx,%edx
cmp    (%rcx),%dl
sbb    %rcx,%rcx
or     %rax,%rcx
test   %ebx,%ebx
cmove  %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @asc2llong(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i64 @strtoll(i8* %0, i8** %4, i32 %1)
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = icmp ne i32 %2, 0
%11 = or i1 %10, %9
%12 = select i1 %11, i64 %6, i64 -1
ret i64 %12
}
int test_imm_DAint32_mem(int *val) {
  return ((*val) & (0xDA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DAint32_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, 218
%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_DAint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 218
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ drand48();
double Random() { return (double)drand48(); }


x86 assembly (clang, -O0):
<Random>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <drand48@plt>
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Random>:
push   %rax
xor    %eax,%eax
call   1030 <drand48@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Random() {
%1 = call i64 (...) @drand48()
%2 = sitofp i64 %1 to double
ret double %2
}

LLVM IR (-O2):
define double @Random() {
%1 = tail call i64 (...) @drand48()
%2 = sitofp i64 %1 to double
ret double %2
}
/* Variables and functions */
int ls_cost_nm6_f0(double const **, double **, int *, double *, int);
int ls_cost_nm6(const double **arg, double **res, int *iw, double *w, int mem) {
  return ls_cost_nm6_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<ls_cost_nm6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <ls_cost_nm6_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm6>:
jmp    1030 <ls_cost_nm6_f0@plt>

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

LLVM IR (-O2):
define i32 @ls_cost_nm6(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @ls_cost_nm6_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
int fault(void) {
  char *s = "hello world";
  *s = 'H';
  return 0;
}


x86 assembly (clang, -O0):
<fault>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x48,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i32 @fault() {
%1 = alloca i8*
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
store i8 72, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @fault() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void scsi_register_module(void) { panic("scsi_register_module"); }


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"scsi_register_module\00"
define void @scsi_register_module() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int get_international(char *, double **, double **, int const *, int const,
                      double const, double const);
int spgat_get_international(char symbol[11], double lattice[3][3],
                            double position[][3], const int types[],
                            const int num_atom, const double symprec,
                            const double angle_tolerance) {
  return get_international(symbol, lattice, position, types, num_atom, symprec,
                           angle_tolerance);
}


x86 assembly (clang, -O0):
<spgat_get_international>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
call   1030 <get_international@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spgat_get_international>:
jmp    1030 <get_international@plt>

LLVM IR (-O0):
define i32 @spgat_get_international(i8* %0, [3 x double]* %1, [3 x double]* %2, i32* %3, i32 %4, double %5, double %6) {
%8 = alloca i8*
%9 = alloca [3 x double]*
%10 = alloca [3 x double]*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca double
%14 = alloca double
store i8* %0, i8** %8
store [3 x double]* %1, [3 x double]** %9
store [3 x double]* %2, [3 x double]** %10
store i32* %3, i32** %11
store i32 %4, i32* %12
store double %5, double* %13
store double %6, double* %14
%15 = load i8*, i8** %8
%16 = load [3 x double]*, [3 x double]** %9
%17 = bitcast [3 x double]* %16 to double**
%18 = load [3 x double]*, [3 x double]** %10
%19 = bitcast [3 x double]* %18 to double**
%20 = load i32*, i32** %11
%21 = load i32, i32* %12
%22 = load double, double* %13
%23 = load double, double* %14
%24 = call i32 @get_international(i8* %15, double** %17, double** %19, i32* %20, i32 %21, double %22, double %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @spgat_get_international(i8* %0, [3 x double]* %1, [3 x double]* %2, i32* %3, i32 %4, double %5, double %6) {
%8 = bitcast [3 x double]* %1 to double**
%9 = bitcast [3 x double]* %2 to double**
%10 = tail call i32 @get_international(i8* %0, double** %8, double** %9, i32* %3, i32 %4, double %5, double %6)
ret i32 %10
}
/* Type definitions */
struct ptrlist_struct {
  int dummy;
};
struct elasticarray {
  int dummy;
};

/* Variables and functions */
size_t elasticarray_getsize(struct elasticarray *, int);
size_t ptrlist_getsize(struct ptrlist_struct *EA) {
  return (elasticarray_getsize((struct elasticarray *)EA, sizeof(void *)));
}


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

x86 assembly (clang, -O2):
<ptrlist_getsize>:
mov    $0x8,%esi
jmp    1030 <elasticarray_getsize@plt>

LLVM IR (-O0):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i64 @ptrlist_getsize(%struct.ptrlist_struct* %0) {
%2 = alloca %struct.ptrlist_struct*
store %struct.ptrlist_struct* %0, %struct.ptrlist_struct** %2
%3 = load %struct.ptrlist_struct*, %struct.ptrlist_struct** %2
%4 = bitcast %struct.ptrlist_struct* %3 to %struct.elasticarray*
%5 = call i64 @elasticarray_getsize(%struct.elasticarray* %4, i32 8)
ret i64 %5
}

LLVM IR (-O2):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i64 @ptrlist_getsize(%struct.ptrlist_struct* %0) {
%2 = bitcast %struct.ptrlist_struct* %0 to %struct.elasticarray*
%3 = tail call i64 @elasticarray_getsize(%struct.elasticarray* %2, i32 8)
ret i64 %3
}
void NMEAAddCRLF(char *TransmitBuffer, int *TXBufferIndex) {
  char *TempPtr = TransmitBuffer + *TXBufferIndex;
  *TempPtr++ = 0x0D;
  *TempPtr++ = 0x0A;
  *TXBufferIndex += 2;
  *TempPtr++ = '\0';
}


x86 assembly (clang, -O0):
<NMEAAddCRLF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0xd,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0xa,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<NMEAAddCRLF>:
movslq (%rsi),%rax
movw   $0xa0d,(%rdi,%rax,1)
addl   $0x2,(%rsi)
movb   $0x0,0x2(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @NMEAAddCRLF(i8* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 13, i8* %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8 10, i8* %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 2
store i32 %9, i32* %1
store i8 0, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main() {
  foo();
#pragma omp taskwait
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
ret i32 0
}
int fun825() { return 825; }


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

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

LLVM IR (-O0):
define i32 @fun825() {
ret i32 825
}

LLVM IR (-O2):
define i32 @fun825() {
ret i32 825
}
int setup_iptables() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @setup_iptables() {
ret i32 1
}
int foo() { return 1 + 2; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 3
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Adrian() { printf("hola mundo xD\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hola mundo xD\00"
define i32 @Adrian() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct utsname {
  char const *sysname;
};

/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
int /*<<< orphan*/ uname(struct utsname *);
const char *detect_os(void) {
  static struct utsname buf;
  uname(&buf);
  if (!strcmp(buf.sysname, "OpenUNIX")) {
    return "SCO_SV";
  }
  return buf.sysname;
}


x86 assembly (clang, -O0):
<detect_os>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f09(%rip),%rdi
call   1030 <uname@plt>
mov    0x2efd(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1160 <detect_os+0x40>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <detect_os+0x4b>
mov    0x2ed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detect_os>:
push   %rbx
lea    0x2f10(%rip),%rdi
call   1030 <uname@plt>
mov    0x2f04(%rip),%rbx
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
lea    0xebd(%rip),%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.utsname = type { i8* }
@detect_os.buf = internal global %struct.utsname zeroinitializer
@.str = [9 x i8] c"OpenUNIX\00"
@.str.1 = [7 x i8] c"SCO_SV\00"
define i8* @detect_os() {
%1 = alloca i8*
%2 = call i32 @uname(%struct.utsname* @detect_os.buf)
%3 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @detect_os.buf, i32 0, i32 0)
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %9
7: ; preds = %0
%8 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @detect_os.buf, i32 0, i32 0)
store i8* %8, i8** %1
br label %9
9: ; preds = %7, %6
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
%struct.utsname = type { i8* }
@detect_os.buf = internal global %struct.utsname zeroinitializer
@.str = [9 x i8] c"OpenUNIX\00"
@.str.1 = [7 x i8] c"SCO_SV\00"
define i8* @detect_os() {
%1 = tail call i32 @uname(%struct.utsname* @detect_os.buf)
%2 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @detect_os.buf, i64 0, i32 0)
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int;
  printf("Hello universe!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Hello universe!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int isALetter(char c) {
  int letter = -1;
  if (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')))
    letter = 1;
  else
    letter = 0;
  return letter;
}


x86 assembly (clang, -O0):
<isALetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     112b <isALetter+0x2b>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jle    1145 <isALetter+0x45>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1151 <isALetter+0x51>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1151 <isALetter+0x51>
movl   $0x1,-0x8(%rbp)
jmp    1158 <isALetter+0x58>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isALetter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isALetter(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 -1, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %19, label %20
19: ; preds = %15, %7
store i32 1, i32* %3
br label %21
20: ; preds = %15, %11
store i32 0, i32* %3
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @isALetter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int state(const char *pname, const char *fname, int argc, const char **argv) {
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<state>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<state>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @state(i8* %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @state(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8** nocapture readnone %3) {
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
unsigned xrop3_169_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_169_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_169_1_1>:
mov    %esi,%eax
or     %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_169_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_169_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = or i32 %8, %4
%10 = xor i32 %9, -256
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ MD5_Binary(char const *, int, char *);
scalar_t__ strlen(char const *);
void MD5_String2binary(const char *string, char *output) {
  MD5_Binary(string, (int)strlen(string), output);
}


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

x86 assembly (clang, -O2):
<MD5_String2binary>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <MD5_Binary@plt>

LLVM IR (-O0):
define void @MD5_String2binary(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
%9 = load i8*, i8** %4
%10 = call i32 @MD5_Binary(i8* %5, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @MD5_String2binary(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @MD5_Binary(i8* %0, i32 %4, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_path();
int /*<<< orphan*/ print_set();
int main(int argc, const char *argv[]) {
  build_path();
  print_set();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @build_path()
%4 = tail call i32 (...) @print_set()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ aldl_finish();
int /*<<< orphan*/ consoleif_exit();
int /*<<< orphan*/ serial_close();
void main_exit() {
  consoleif_exit();
  serial_close();
  aldl_finish();
}


x86 assembly (clang, -O0):
<main_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <consoleif_exit@plt>
mov    $0x0,%al
call   1050 <serial_close@plt>
mov    $0x0,%al
call   1030 <aldl_finish@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_exit>:
push   %rax
xor    %eax,%eax
call   1040 <consoleif_exit@plt>
xor    %eax,%eax
call   1050 <serial_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <aldl_finish@plt>

LLVM IR (-O0):
define void @main_exit() {
%1 = call i32 (...) @consoleif_exit()
%2 = call i32 (...) @serial_close()
%3 = call i32 (...) @aldl_finish()
ret void
}

LLVM IR (-O2):
define void @main_exit() {
%1 = tail call i32 (...) @consoleif_exit()
%2 = tail call i32 (...) @serial_close()
%3 = tail call i32 (...) @aldl_finish()
ret void
}