xunge/DecIR huggingface dataset:
extern unsigned long virt_to_phys(volatile void *address) {
  return (unsigned long)address;
}


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

x86 assembly (clang, -O2):
<virt_to_phys>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @virt_to_phys(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
/* Type definitions */
struct route_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ route_table_free(struct route_table *);
void route_table_finish(struct route_table *rt) { route_table_free(rt); }


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

x86 assembly (clang, -O2):
<route_table_finish>:
jmp    1030 <route_table_free@plt>

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

LLVM IR (-O2):
%struct.route_table = type { i32 }
define void @route_table_finish(%struct.route_table* %0) {
%2 = tail call i32 @route_table_free(%struct.route_table* %0)
ret void
}
/* Variables and functions */
bool higher_than_max_altitude(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @higher_than_max_altitude() {
ret i32 0
}
/* Type definitions */
struct intel_vgpu_mm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ intel_vgpu_mm_put(struct intel_vgpu_mm *);
void intel_vgpu_destroy_mm(struct intel_vgpu_mm *mm) { intel_vgpu_mm_put(mm); }


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

x86 assembly (clang, -O2):
<intel_vgpu_destroy_mm>:
jmp    1030 <intel_vgpu_mm_put@plt>

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

LLVM IR (-O2):
%struct.intel_vgpu_mm = type { i32 }
define void @intel_vgpu_destroy_mm(%struct.intel_vgpu_mm* %0) {
%2 = tail call i32 @intel_vgpu_mm_put(%struct.intel_vgpu_mm* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void StackUnderflow() {
  printf("\n\nERR: Stack Underflow\nCannot Pop From Empty Stack\n\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"\0A\0AERR: Stack Underflow\0ACannot Pop From Empty Stack\0A\0A\00"
define void @StackUnderflow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"\0A\0AERR: Stack Underflow\0ACannot Pop From Empty Stack\0A\00"
define void @StackUnderflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret void
}
char get_char(int x) {
  if (x < 10) {
    return ('0' + x);
  } else {
    return ('A' + (x - 10));
  }
}


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <get_char+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <get_char+0x2b>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @get_char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 10
%13 = add nsw i32 65, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @get_char(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
int process_disk_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @process_disk_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void termination_handler(int signum) {
  endwin();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<termination_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<termination_handler>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @termination_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @termination_handler(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_set_text_size() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_set_text_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_set_text_size>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_set_text_size() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_set_text_size() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rl(uint8_t val) { return val << 1 | ((val & 0x80) >> 7); }


x86 assembly (clang, -O0):
<rl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x80,%ecx
sar    $0x7,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl>:
mov    %edi,%eax
shr    $0x7,%eax
and    $0x1,%eax
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @rl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, 128
%7 = ashr i32 %6, 7
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @rl(i32 %0) {
%2 = shl i32 %0, 1
%3 = lshr i32 %0, 7
%4 = and i32 %3, 1
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
unsigned short crcitt_string_ex(char *, int, int /*<<< orphan*/);
unsigned short crcitt_string(char *s, int len) {
  return crcitt_string_ex(s, len, 0);
}


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

x86 assembly (clang, -O2):
<crcitt_string>:
xor    %edx,%edx
jmp    1030 <crcitt_string_ex@plt>

LLVM IR (-O0):
define zeroext i16 @crcitt_string(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 = call zeroext i16 @crcitt_string_ex(i8* %5, i32 %6, i32 0)
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @crcitt_string(i8* %0, i32 %1) {
%3 = tail call zeroext i16 @crcitt_string_ex(i8* %0, i32 %1, i32 0)
ret i16 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_it;
X509 *d2i_X509(X509 **a, const unsigned char **in, long len) {
  return (X509 *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_it);
}


x86 assembly (clang, -O0):
<d2i_X509>:
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    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_X509>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

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

LLVM IR (-O2):
@X509_it = global i32 0
define i32* @d2i_X509(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @X509_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
size_t min(const int a, const int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
cmp    %esi,%edi
cmovl  %edi,%esi
movslq %esi,%rax
ret

LLVM IR (-O0):
define i64 @min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = sext i32 %13 to i64
ret i64 %14
}

LLVM IR (-O2):
define i64 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
char *inet_ntop(int, void const *, char *, int /*<<< orphan*/);
const char *Inet_ntop(int af, const void *src, char *dst, socklen_t size) {
  const char *p;
  if ((p = inet_ntop(af, src, dst, size)) == NULL) {
    err_sys("close error");
  }
  return p;
}


x86 assembly (clang, -O0):
<Inet_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <inet_ntop@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1163 <Inet_ntop+0x43>
lea    0xea2(%rip),%rdi
call   1040 <err_sys@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inet_ntop>:
push   %rbx
call   1030 <inet_ntop@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Inet_ntop+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <err_sys@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"close error\00"
define i8* @Inet_ntop(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @inet_ntop(i32 %0, i8* %1, i8* %2, i32 %3)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @err_sys(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret i8* %5
}
void g_node_insert_before() {}


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

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

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

LLVM IR (-O2):
define void @g_node_insert_before() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void quack2() { foo(4); }


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

x86 assembly (clang, -O2):
<quack2>:
mov    $0x4,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @quack2() {
%1 = call i32 @foo(i32 4)
ret void
}

LLVM IR (-O2):
define void @quack2() {
%1 = tail call i32 @foo(i32 4)
ret void
}
int picolcd_init_backlight(struct picolcd_data *data,
                           struct hid_report *report) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.picolcd_data = type opaque
%struct.hid_report = type opaque
define i32 @picolcd_init_backlight(%struct.picolcd_data* %0, %struct.hid_report* %1) {
%3 = alloca %struct.picolcd_data*
%4 = alloca %struct.hid_report*
store %struct.picolcd_data* %0, %struct.picolcd_data** %3
store %struct.hid_report* %1, %struct.hid_report** %4
ret i32 0
}

LLVM IR (-O2):
%struct.picolcd_data = type opaque
%struct.hid_report = type opaque
define i32 @picolcd_init_backlight(%struct.picolcd_data* nocapture readnone %0, %struct.hid_report* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct party {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mapif_party_info(int, struct party const *);
int /*<<< orphan*/ mapif_party_noinfo(int, int);
struct party *partydb_sql_load_num(int);
int mapif_parse_PartyInfo(int fd, int party_id) {
  const struct party *p = partydb_sql_load_num(party_id);
  if (p != NULL)
    mapif_party_info(fd, p);
  else
    mapif_party_noinfo(fd, party_id);
  return 0;
}


x86 assembly (clang, -O0):
<mapif_parse_PartyInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <partydb_sql_load_num@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <mapif_parse_PartyInfo+0x36>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <mapif_party_info@plt>
jmp    1171 <mapif_parse_PartyInfo+0x41>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mapif_party_noinfo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_parse_PartyInfo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    %esi,%edi
call   1050 <partydb_sql_load_num@plt>
mov    %ebx,%edi
test   %rax,%rax
je     114f <mapif_parse_PartyInfo+0x1f>
mov    %rax,%rsi
call   1040 <mapif_party_info@plt>
jmp    1156 <mapif_parse_PartyInfo+0x26>
mov    %ebp,%esi
call   1030 <mapif_party_noinfo@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.party = type { i32 }
define i32 @mapif_parse_PartyInfo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.party*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call %struct.party* @partydb_sql_load_num(i32 %6)
store %struct.party* %7, %struct.party** %5
%8 = load %struct.party*, %struct.party** %5
%9 = icmp ne %struct.party* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load %struct.party*, %struct.party** %5
%13 = call i32 @mapif_party_info(i32 %11, %struct.party* %12)
br label %18
14: ; preds = %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 @mapif_party_noinfo(i32 %15, i32 %16)
br label %18
18: ; preds = %14, %10
ret i32 0
}

LLVM IR (-O2):
%struct.party = type { i32 }
define i32 @mapif_parse_PartyInfo(i32 %0, i32 %1) {
%3 = tail call %struct.party* @partydb_sql_load_num(i32 %1)
%4 = icmp eq %struct.party* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @mapif_party_info(i32 %0, %struct.party* %3)
br label %9
7: ; preds = %2
%8 = tail call i32 @mapif_party_noinfo(i32 %0, i32 %1)
br label %9
9: ; preds = %7, %5
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned dns_nonrandom_32(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_usec;
}


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

x86 assembly (clang, -O2):
<dns_nonrandom_32>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @dns_nonrandom_32() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @dns_nonrandom_32() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cyl(double, double, double, int /*<<< orphan*/);
void cylinder(double h, double r1, double r2) { cyl(h, r1, r2, 0); }


x86 assembly (clang, -O0):
<cylinder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
xor    %edi,%edi
call   1030 <cyl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cylinder>:
xor    %edi,%edi
jmp    1030 <cyl@plt>

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

LLVM IR (-O2):
define void @cylinder(double %0, double %1, double %2) {
%4 = tail call i32 @cyl(double %0, double %1, double %2, i32 0)
ret void
}
void noflow(void) {}


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

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

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

LLVM IR (-O2):
define void @noflow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pwm_init();
__attribute__((OS_main)) int main(int argc, char *argv[]) {
  pwm_init();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <pwm_init@plt>
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <pwm_init@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @pwm_init()
br label %7
7: ; preds = %2, %7
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @pwm_init()
br label %4
4: ; preds = %2, %4
br label %4
}
int IsChIn(char *str, char c) {
  int i;
  for (i = 0; str[i]; i++)
    if (str[i] == c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<IsChIn>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115e <IsChIn+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114b <IsChIn+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1165 <IsChIn+0x65>
jmp    1150 <IsChIn+0x50>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <IsChIn+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsChIn>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <IsChIn+0x20>
add    $0x1,%rdi
nopl   0x0(%rax)
cmp    %sil,%cl
je     1121 <IsChIn+0x21>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <IsChIn+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @IsChIn(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %13, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = icmp eq i8 %11, %1
%13 = add nuw i64 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void move_motor(int dir) {
  if (dir == 0) {
    printf("Stop motor\n");
  } else {
    printf("Move X to %s\n", (dir > 0) ? "++" : "--");
  }
}


x86 assembly (clang, -O0):
<move_motor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1138 <move_motor+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <move_motor+0x4e>
mov    -0x4(%rbp),%ecx
lea    0xedb(%rip),%rsi
lea    0xed1(%rip),%rax
cmp    $0x0,%ecx
cmovg  %rax,%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_motor>:
test   %edi,%edi
je     1144 <move_motor+0x24>
lea    0xee3(%rip),%rax
lea    0xedf(%rip),%rsi
cmovg  %rax,%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Stop motor\0A\00"
@.str.1 = [14 x i8] c"Move X to %s\0A\00"
@.str.2 = [3 x i8] c"++\00"
@.str.3 = [3 x i8] c"--\00"
define void @move_motor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Move X to %s\0A\00"
@.str.2 = [3 x i8] c"++\00"
@.str.3 = [3 x i8] c"--\00"
@str = [11 x i8] c"Stop motor\00"
define void @move_motor(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = icmp sgt i32 %0, 0
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bad_if_alias(int, int);
void call_bad_if_alias_Bad_AlreadyReported() {
  int x;
  bad_if_alias(x, x);
}


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

x86 assembly (clang, -O2):
<call_bad_if_alias_Bad_AlreadyReported>:
jmp    1030 <bad_if_alias@plt>

LLVM IR (-O0):
define void @call_bad_if_alias_Bad_AlreadyReported() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @bad_if_alias(i32 %2, i32 %3)
ret void
}

LLVM IR (-O2):
define void @call_bad_if_alias_Bad_AlreadyReported() {
%1 = tail call i32 @bad_if_alias(i32 undef, i32 undef)
ret void
}
int str_total_characters(char *src, char ch) {
  int i = 0;
  while (*src) {
    if (*src == ch)
      i++;
    src++;
  }
  return i;
}


x86 assembly (clang, -O0):
<str_total_characters>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <str_total_characters+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <str_total_characters+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <str_total_characters+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_total_characters>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <str_total_characters+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_total_characters+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_total_characters(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, n, p;
  scanf("%d", &n);
  p = 1;
  for (i = 1; i <= n; i++) {
    printf("%02d ", p);
    p = p + 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     117f <main+0x5f>
mov    -0x10(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1166 <main+0x46>
mov    $0x1,%ebx
xor    %ebp,%ebp
lea    0xeb5(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x2,%ebx
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%02d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %14, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ 1, %0 ]
%8 = phi i32 [ %11, %6 ], [ 1, %0 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%10 = add nuw nsw i32 %7, 2
%11 = add nuw nsw i32 %8, 1
%12 = load i32, i32* %1
%13 = icmp slt i32 %8, %12
br i1 %13, label %6, label %14
14: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _swap(int *, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("3 && 4 : %d", 3 && 4);
  printf("\n 3 || 4 : %d", 3 && 4 || 0);
  printf("\n 3 && 4 &&5 : %d", 3 && 4 && 0);
  int a = 10, b = 20;
  _swap(&a, &b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <_swap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movl   $0xa,0x4(%rsp)
movl   $0x14,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <_swap@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"3 && 4 : %d\00"
@.str.1 = [14 x i8] c"\0A 3 || 4 : %d\00"
@.str.2 = [18 x i8] c"\0A 3 && 4 &&5 : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 0)
store i32 10, i32* %2
store i32 20, i32* %3
%7 = call i32 @_swap(i32* %2, i32* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"3 && 4 : %d\00"
@.str.1 = [14 x i8] c"\0A 3 || 4 : %d\00"
@.str.2 = [18 x i8] c"\0A 3 && 4 &&5 : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 0)
%6 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%7 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%8 = call i32 @_swap(i32* %1, i32* %2)
ret i32 0
}
void print(char *text) {
  char *video = (char *)0xB8000;
  while (*text != 0) {
    *video++ = *text++;
    *video++ = 0x0f;
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <print+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0xf,(%rax)
jmp    1111 <print+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    (%rdi),%al
test   %al,%al
je     112c <print+0x2c>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,0xb8000(%rcx,%rcx,1)
movb   $0xf,0xb8001(%rcx,%rcx,1)
0f
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <print+0x10>
ret

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ inttoptr (i64 753664 to i8*), %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %5, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 2
store i8 15, i8* %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
void outbyte(int ch) { write(1, &ch, 1); }


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

x86 assembly (clang, -O2):
<outbyte>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @outbyte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i32* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @outbyte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i32* %2, i32 1)
ret void
}
char *getTempDir() {
  char *dir = "/tmp/";
  return dir;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"/tmp/\00"
define i8* @getTempDir() {
%1 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"/tmp/\00"
define i8* @getTempDir() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void vcmosFinal() {}


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

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

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

LLVM IR (-O2):
define void @vcmosFinal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int /*<<< orphan*/);
int /*<<< orphan*/ ppuSetNameTblVertical();
int /*<<< orphan*/ prg16setBank0(int);
int /*<<< orphan*/ prg16setBank1(int);
void m225reset() {
  prg16setBank0(0 << 14);
  prg16setBank1(1 << 14);
  chr8setBank0(0);
  ppuSetNameTblVertical();
}


x86 assembly (clang, -O0):
<m225reset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <prg16setBank0@plt>
mov    $0x4000,%edi
call   1060 <prg16setBank1@plt>
xor    %edi,%edi
call   1040 <chr8setBank0@plt>
mov    $0x0,%al
call   1050 <ppuSetNameTblVertical@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m225reset>:
push   %rax
xor    %edi,%edi
call   1030 <prg16setBank0@plt>
mov    $0x4000,%edi
call   1060 <prg16setBank1@plt>
xor    %edi,%edi
call   1040 <chr8setBank0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ppuSetNameTblVertical@plt>

LLVM IR (-O0):
define void @m225reset() {
%1 = call i32 @prg16setBank0(i32 0)
%2 = call i32 @prg16setBank1(i32 16384)
%3 = call i32 @chr8setBank0(i32 0)
%4 = call i32 (...) @ppuSetNameTblVertical()
ret void
}

LLVM IR (-O2):
define void @m225reset() {
%1 = tail call i32 @prg16setBank0(i32 0)
%2 = tail call i32 @prg16setBank1(i32 16384)
%3 = tail call i32 @chr8setBank0(i32 0)
%4 = tail call i32 (...) @ppuSetNameTblVertical()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VpuWriteReg(int, int);
void BitIssueCommand(int instIdx, int cdcMode, int cmd) {
  VpuWriteReg(0x168, instIdx);
  VpuWriteReg(0x16C, cdcMode);
  VpuWriteReg(0x164, cmd);
}


x86 assembly (clang, -O0):
<BitIssueCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x168,%edi
call   1030 <VpuWriteReg@plt>
mov    -0x8(%rbp),%esi
mov    $0x16c,%edi
call   1030 <VpuWriteReg@plt>
mov    -0xc(%rbp),%esi
mov    $0x164,%edi
call   1030 <VpuWriteReg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitIssueCommand>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%esi
mov    $0x168,%edi
call   1030 <VpuWriteReg@plt>
mov    $0x16c,%edi
mov    %ebp,%esi
call   1030 <VpuWriteReg@plt>
mov    $0x164,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <VpuWriteReg@plt>

LLVM IR (-O0):
define void @BitIssueCommand(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @VpuWriteReg(i32 360, i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @VpuWriteReg(i32 364, i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @VpuWriteReg(i32 356, i32 %11)
ret void
}

LLVM IR (-O2):
define void @BitIssueCommand(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @VpuWriteReg(i32 360, i32 %0)
%5 = tail call i32 @VpuWriteReg(i32 364, i32 %1)
%6 = tail call i32 @VpuWriteReg(i32 356, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _dgr(double, double);
int _dgeq(double a, double b) { return !_dgr(b, a); }


x86 assembly (clang, -O0):
<_dgeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1030 <_dgr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dgeq>:
push   %rax
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <_dgr@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_dgeq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call i32 @_dgr(double %5, double %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_dgeq(double %0, double %1) {
%3 = tail call i32 @_dgr(double %1, double %0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void fa56(void) {
a:
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        p013A:
          goto p013A;
          goto a;
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


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

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

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

LLVM IR (-O2):
define void @fa56() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
long sumas(int, int);
long suma_coins(int n) { return sumas(n, 7); }


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

x86 assembly (clang, -O2):
<suma_coins>:
mov    $0x7,%esi
jmp    1030 <sumas@plt>

LLVM IR (-O0):
define i64 @suma_coins(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @sumas(i32 %3, i32 7)
ret i64 %4
}

LLVM IR (-O2):
define i64 @suma_coins(i32 %0) {
%2 = tail call i64 @sumas(i32 %0, i32 7)
ret i64 %2
}
/* Variables and functions */
char MungeHexDigit(char *);
char GetCharFromHex(char *two_hexdigits) {
  char c1 = MungeHexDigit(two_hexdigits);
  char c2 = MungeHexDigit(two_hexdigits + 1);
  char result = 0;
  if (c1 != -1 && c2 != -1) {
    result = (c1 << 4) + c2;
  }
  return result;
}


x86 assembly (clang, -O0):
<GetCharFromHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <MungeHexDigit@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <MungeHexDigit@plt>
mov    %al,-0xa(%rbp)
movb   $0x0,-0xb(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xffffffff,%eax
je     1166 <GetCharFromHex+0x56>
movsbl -0xa(%rbp),%eax
cmp    $0xffffffff,%eax
je     1166 <GetCharFromHex+0x56>
movsbl -0x9(%rbp),%eax
shl    $0x4,%eax
movsbl -0xa(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0xb(%rbp)
movsbl -0xb(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCharFromHex>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <MungeHexDigit@plt>
mov    %eax,%ebp
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <MungeHexDigit@plt>
mov    %ebp,%ecx
shl    $0x4,%cl
add    %al,%cl
xor    %edx,%edx
cmp    $0xff,%al
movzbl %cl,%eax
cmove  %edx,%eax
cmp    $0xff,%bpl
cmove  %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @GetCharFromHex(i8* %0) {
%2 = tail call signext i8 @MungeHexDigit(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = tail call signext i8 @MungeHexDigit(i8* %3)
%5 = icmp ne i8 %2, -1
%6 = icmp ne i8 %4, -1
%7 = select i1 %5, i1 %6, i1 false
%8 = shl i8 %2, 4
%9 = add i8 %8, %4
%10 = select i1 %7, i8 %9, i8 0
ret i8 %10
}