xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ leaf_function();
void non_leaf_function(int i) {
  int j = 0;
  while (j < i)
    j++;
  leaf_function();
}


x86 assembly (clang, -O0):
<non_leaf_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113c <non_leaf_function+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <non_leaf_function+0x12>
mov    $0x0,%al
call   1030 <leaf_function@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @non_leaf_function(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = call i32 (...) @leaf_function()
ret void
}

LLVM IR (-O2):
define void @non_leaf_function(i32 %0) {
%2 = tail call i32 (...) @leaf_function()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rsp_load_code(void *, unsigned long, int /*<<< orphan*/);
__attribute__((deprecated("use rsp_load_code instead"))) void
load_ucode(void *start, unsigned long size) {
  rsp_load_code(start, size, 0);
}


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

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

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

LLVM IR (-O2):
define void @load_ucode(i8* %0, i64 %1) {
%3 = tail call i32 @rsp_load_code(i8* %0, i64 %1, i32 0)
ret void
}
char *translate_rfxmeter(unsigned char *buf, unsigned char *sunchanged,
                         int *launchp) {
  static char outbuf[160];
  return outbuf;
}


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

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

LLVM IR (-O0):
@translate_rfxmeter.outbuf = internal global [160 x i8] zeroinitializer
define i8* @translate_rfxmeter(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
ret i8* getelementptr inbounds ([160 x i8], [160 x i8]* @translate_rfxmeter.outbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@translate_rfxmeter.outbuf = internal global [160 x i8] zeroinitializer
define i8* @translate_rfxmeter(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
ret i8* getelementptr inbounds ([160 x i8], [160 x i8]* @translate_rfxmeter.outbuf, i64 0, i64 0)
}
int __attribute__((no)) foo(int i, int j) { return (i + j) - (i | j); }


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

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

LLVM IR (-O0):
define i32 @foo(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 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = or i32 %8, %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double log(int);
double func10(double x) { return log(2 + x * x); }


x86 assembly (clang, -O0):
<func10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func10>:
mulsd  %xmm0,%xmm0
addsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @func10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double 2.000000e+00)
%6 = fptosi double %5 to i32
%7 = call double @log(i32 %6)
ret double %7
}

LLVM IR (-O2):
define double @func10(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 2.000000e+00)
%3 = fptosi double %2 to i32
%4 = tail call double @log(i32 %3)
ret double %4
}
/* Variables and functions */
char **stb_getopt_param(int *, char **, char *);
char **stb_getopt(int *argc, char **argv) {
  return stb_getopt_param(argc, argv, (char *)"");
}


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

x86 assembly (clang, -O2):
<stb_getopt>:
lea    0xee9(%rip),%rdx
jmp    1030 <stb_getopt_param@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8** @stb_getopt(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i8** @stb_getopt_param(i32* %5, i8** %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8** %7
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8** @stb_getopt(i32* %0, i8** %1) {
%3 = tail call i8** @stb_getopt_param(i32* %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8** %3
}
int platform_b() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @platform_b() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t next_card_id() {
  static uint32_t next = 223344;
  uint32_t retval = next;
  next++;
  return retval;
}


x86 assembly (clang, -O0):
<next_card_id>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0x2f0d(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f04(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_card_id>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@next_card_id.next = internal global i32 223344
define i32 @next_card_id() {
%1 = alloca i32
%2 = load i32, i32* @next_card_id.next
store i32 %2, i32* %1
%3 = load i32, i32* @next_card_id.next
%4 = add nsw i32 %3, 1
store i32 %4, i32* @next_card_id.next
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@next_card_id.next = internal unnamed_addr global i32 223344
define i32 @next_card_id() {
%1 = load i32, i32* @next_card_id.next
%2 = add nsw i32 %1, 1
store i32 %2, i32* @next_card_id.next
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ emsRlse();
void ems_rlse_(void) {
  emsRlse();
  return;
}


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

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

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

LLVM IR (-O2):
define void @ems_rlse_() {
%1 = tail call i32 (...) @emsRlse()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void swap(uint8_t *a, uint8_t *b) {
  if (NULL == a || NULL == b) {
    return;
  }
  uint8_t tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1124 <swap+0x24>
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1129 <swap+0x29>
jmp    1147 <swap+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
test   %rdi,%rdi
je     1112 <swap+0x12>
test   %rsi,%rsi
je     1112 <swap+0x12>
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, null
%4 = icmp eq i32* %1, null
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %0
%8 = load i32, i32* %1
store i32 %8, i32* %0
store i32 %7, i32* %1
br label %9
9: ; preds = %2, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int CBoolChars(char *Sorc) {
  if (!strcmp(Sorc, "true"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<CBoolChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <CBoolChars+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <CBoolChars+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CBoolChars>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
define i32 @CBoolChars(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *ZSTDv05_getErrorName(size_t code) { return ERR_getErrorName(code); }


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

x86 assembly (clang, -O2):
<ZSTDv05_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

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

LLVM IR (-O2):
define i8* @ZSTDv05_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int /*<<< orphan*/, char const *);
void test_assert_null(const void *ptr, const char *msg) {
  test_assert(ptr != NULL, msg);
}


x86 assembly (clang, -O0):
<test_assert_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_null>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
jmp    1030 <test_assert@plt>

LLVM IR (-O0):
define void @test_assert_null(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 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = load i8*, i8** %4
%9 = call i32 @test_assert(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @test_assert_null(i8* readnone %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @test_assert(i32 %4, i8* %1)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int64_t L_print_char(int64_t n) {
  printf("%c", n);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @L_print_char(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lcd_hd44780_busy_wait_4bit();
int /*<<< orphan*/ lcd_hd44780_write_data_to_CG_or_DD_RAM_4bit(char);
void lcd_putc(char znak) {
  lcd_hd44780_busy_wait_4bit();
  lcd_hd44780_write_data_to_CG_or_DD_RAM_4bit(znak);
}


x86 assembly (clang, -O0):
<lcd_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <lcd_hd44780_busy_wait_4bit@plt>
movsbl -0x1(%rbp),%edi
call   1040 <lcd_hd44780_write_data_to_CG_or_DD_RAM_4bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_putc>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <lcd_hd44780_busy_wait_4bit@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <lcd_hd44780_write_data_to_CG_or_DD_RAM_4bit@plt>

LLVM IR (-O0):
define void @lcd_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @lcd_hd44780_busy_wait_4bit()
%4 = load i8, i8* %2
%5 = call i32 @lcd_hd44780_write_data_to_CG_or_DD_RAM_4bit(i8 signext %4)
ret void
}

LLVM IR (-O2):
define void @lcd_putc(i8 signext %0) {
%2 = tail call i32 (...) @lcd_hd44780_busy_wait_4bit()
%3 = tail call i32 @lcd_hd44780_write_data_to_CG_or_DD_RAM_4bit(i8 signext %0)
ret void
}
/* Type definitions */
struct pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pool_new_str(struct pool *, char const *);
int xml_make_node(int /*<<< orphan*/, int, int, struct pool *);
int xml_new(const char *name, struct pool *p) {
  return xml_make_node(pool_new_str(p, name), (-1), (-1), p);
}


x86 assembly (clang, -O0):
<xml_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <pool_new_str@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1040 <xml_make_node@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_new>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <pool_new_str@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <xml_make_node@plt>

LLVM IR (-O0):
%struct.pool = type { i32 }
define i32 @xml_new(i8* %0, %struct.pool* %1) {
%3 = alloca i8*
%4 = alloca %struct.pool*
store i8* %0, i8** %3
store %struct.pool* %1, %struct.pool** %4
%5 = load %struct.pool*, %struct.pool** %4
%6 = load i8*, i8** %3
%7 = call i32 @pool_new_str(%struct.pool* %5, i8* %6)
%8 = load %struct.pool*, %struct.pool** %4
%9 = call i32 @xml_make_node(i32 %7, i32 -1, i32 -1, %struct.pool* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.pool = type { i32 }
define i32 @xml_new(i8* %0, %struct.pool* %1) {
%3 = tail call i32 @pool_new_str(%struct.pool* %1, i8* %0)
%4 = tail call i32 @xml_make_node(i32 %3, i32 -1, i32 -1, %struct.pool* %1)
ret i32 %4
}
int valid_character(char c) {
  char badchar[] = {10, 13, '\r'};
  int i;
  for (i = 0; i < 3; i++) {
    if (c == badchar[i])
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<valid_character>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xeef(%rip),%ax
mov    %ax,-0x8(%rbp)
mov    0xee7(%rip),%al
mov    %al,-0x6(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1163 <valid_character+0x63>
movsbl -0x5(%rbp),%eax
movslq -0xc(%rbp),%rcx
movsbl -0x8(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    1150 <valid_character+0x50>
movl   $0x1,-0x4(%rbp)
jmp    116a <valid_character+0x6a>
jmp    1155 <valid_character+0x55>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <valid_character+0x25>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_character>:
cmp    $0xa,%dil
sete   %al
cmp    $0xd,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@__const.valid_character.badchar = [3 x i8] c"\0A\0D\0D"
define i32 @valid_character(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [3 x i8]
%5 = alloca i32
store i8 %0, i8* %3
%6 = bitcast [3 x i8]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %12, %17
br i1 %18, label %19, label %20
19: ; preds = %10
store i32 1, i32* %2
br label %25
20: ; preds = %10
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @valid_character(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = icmp eq i8 %0, 13
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int rand();
int roll_die(void) {
  int die_face = 0;
  die_face = rand() % 6 + 1;
  return die_face;
}


x86 assembly (clang, -O0):
<roll_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll_die>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @roll_die() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 6
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @roll_die() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}
void acpi_memory_hotplug_init(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_memory_hotplug_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void bzero(void *dst, size_t count) { memset(dst, 0, count); }


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

x86 assembly (clang, -O2):
<bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
int isPrime(int n) {
  if (n < 2)
    return 0;
  if ((n % 2) == 0)
    return 0;
  for (int i = 3; i * i <= n; i += 2) {
    if ((n % i) == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    111d <isPrime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    118a <isPrime+0x8a>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113d <isPrime+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    118a <isPrime+0x8a>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1183 <isPrime+0x83>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1170 <isPrime+0x70>
movl   $0x0,-0x4(%rbp)
jmp    118a <isPrime+0x8a>
jmp    1175 <isPrime+0x75>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <isPrime+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     113c <isPrime+0x3c>
mov    %edi,%ecx
and    $0x1,%ecx
je     113c <isPrime+0x3c>
mov    $0x1,%eax
cmp    $0x9,%edi
jb     113c <isPrime+0x3c>
mov    $0x3,%ecx
nopl   (%rax)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1135 <isPrime+0x35>
add    $0x2,%ecx
mov    %ecx,%eax
imul   %ecx,%eax
cmp    %edi,%eax
jle    1120 <isPrime+0x20>
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp slt i32 %0, 2
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
%5 = or i1 %2, %4
br i1 %5, label %19, label %6
6: ; preds = %1
%7 = icmp ult i32 %0, 9
br i1 %7, label %19, label %8
8: ; preds = %6, %8
%9 = phi i32 [ %12, %8 ], [ 3, %6 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %9, 2
%13 = mul nsw i32 %12, %12
%14 = icmp sgt i32 %13, %0
%15 = select i1 %11, i1 true, i1 %14
br i1 %15, label %16, label %8
16: ; preds = %8
%17 = xor i1 %11, true
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %6, %16, %1
%20 = phi i32 [ 0, %1 ], [ 1, %6 ], [ %18, %16 ]
ret i32 %20
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl(char const *s) {
  (void)write(0x01, s, ft_strlen(s));
  (void)write(0x01, "\n", 0x01);
  return;
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xea7(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ft_strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
%7 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void check_negative_sized_VLA_6() {
  unsigned char x = -1;
  int vla[x];
}


x86 assembly (clang, -O0):
<check_negative_sized_VLA_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @check_negative_sized_VLA_6() {
%1 = alloca i8
%2 = alloca i8*
%3 = alloca i64
store i8 -1, i8* %1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i32, i64 %5
store i64 %5, i64* %3
%8 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @check_negative_sized_VLA_6() {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
scalar_t__ strncmp(char *, char const *, int);
int64_t match_c_multiline_comment_end(const char *str) {
  if (strncmp("*/", str, 2) == 0)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<match_c_multiline_comment_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1147 <match_c_multiline_comment_end+0x37>
movl   $0x2,-0x4(%rbp)
jmp    114e <match_c_multiline_comment_end+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_c_multiline_comment_end>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"*/\00"
define i32 @match_c_multiline_comment_end(i8* %0) {
%2 = tail call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i32 2)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 2, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ init_platform();
int /*<<< orphan*/ print(char *);
int main() {
  init_platform();
  print("Hello World\n\r");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World\0A\0D\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_platform()
%3 = call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World\0A\0D\00"
define i32 @main() {
%1 = tail call i32 (...) @init_platform()
%2 = tail call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void avcodec_find_best_pix_fmt_of_list() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_find_best_pix_fmt_of_list() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_index_url(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char domain[] = "linux.org";
  char index_url[200];
  build_index_url(domain, index_url);
  printf("%s\n", index_url);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <build_index_url@plt>
lea    -0xe0(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
movabs $0x726f2e78756e696c,%rax
2e 6f 72
mov    %rax,(%rsp)
movw   $0x67,0x8(%rsp)
mov    %rsp,%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <build_index_url@plt>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.domain = [10 x i8] c"linux.org\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [200 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%7 = call i32 @build_index_url(i8* %5, i8* %6)
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.domain = [10 x i8] c"linux.org\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i32 @build_index_url(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
struct buffer_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ buffer_dirty(struct buffer_head *);
void mark_buffer_unify_non(struct buffer_head *buffer) {
  assert(buffer_dirty(buffer));
}


x86 assembly (clang, -O0):
<mark_buffer_unify_non>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <buffer_dirty@plt>
mov    %eax,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_buffer_unify_non>:
push   %rax
call   1040 <buffer_dirty@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.buffer_head = type { i32 }
define void @mark_buffer_unify_non(%struct.buffer_head* %0) {
%2 = alloca %struct.buffer_head*
store %struct.buffer_head* %0, %struct.buffer_head** %2
%3 = load %struct.buffer_head*, %struct.buffer_head** %2
%4 = call i32 @buffer_dirty(%struct.buffer_head* %3)
%5 = call i32 @assert(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.buffer_head = type { i32 }
define void @mark_buffer_unify_non(%struct.buffer_head* %0) {
%2 = tail call i32 @buffer_dirty(%struct.buffer_head* %0)
%3 = tail call i32 @assert(i32 %2)
ret void
}
void intToByteShort(char *bytefield, int number) {
  *(bytefield + 1) = (number >> 8) & 0xFF;
  *(bytefield + 0) = number & 0xFF;
}


x86 assembly (clang, -O0):
<intToByteShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToByteShort>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @intToByteShort(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @intToByteShort(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
%6 = trunc i32 %1 to i8
store i8 %6, i8* %0
ret void
}
int test_imm_81int64_lowword_reg(long long val) {
  return ((val) & (0x81 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_81int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 129
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned long roundUpToNextPowerOfTwo(unsigned long n) {
  long nOfBits = 0;
  if (((n - 1) & n) == 0)
    return n;
  while (n > 0) {
    n = n >> 1;
    nOfBits++;
  }
  return (1 << nOfBits);
}


x86 assembly (clang, -O0):
<roundUpToNextPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
jne    1133 <roundUpToNextPowerOfTwo+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <roundUpToNextPowerOfTwo+0x73>
jmp    1138 <roundUpToNextPowerOfTwo+0x38>
cmpq   $0x0,-0x10(%rbp)
jbe    1160 <roundUpToNextPowerOfTwo+0x60>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <roundUpToNextPowerOfTwo+0x38>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundUpToNextPowerOfTwo>:
mov    %rdi,%rax
lea    -0x1(%rdi),%rcx
test   %rcx,%rdi
je     1138 <roundUpToNextPowerOfTwo+0x38>
xor    %ecx,%ecx
test   %rax,%rax
je     112f <roundUpToNextPowerOfTwo+0x2f>
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
shr    %rdx
add    $0x1,%ecx
cmp    $0x1,%rax
mov    %rdx,%rax
ja     1120 <roundUpToNextPowerOfTwo+0x20>
mov    $0x1,%eax
shl    %cl,%eax
cltq
ret

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

LLVM IR (-O2):
define i64 @roundUpToNextPowerOfTwo(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = icmp ult i64 %2, 2
br i1 %3, label %18, label %4
4: ; preds = %1
%5 = icmp eq i64 %0, 0
br i1 %5, label %14, label %6
6: ; preds = %4, %6
%7 = phi i64 [ %10, %6 ], [ 0, %4 ]
%8 = phi i64 [ %9, %6 ], [ %0, %4 ]
%9 = lshr i64 %8, 1
%10 = add nuw nsw i64 %7, 1
%11 = icmp ult i64 %8, 2
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = trunc i64 %10 to i32
br label %14
14: ; preds = %12, %4
%15 = phi i32 [ 0, %4 ], [ %13, %12 ]
%16 = shl nuw i32 1, %15
%17 = sext i32 %16 to i64
br label %18
18: ; preds = %1, %14
%19 = phi i64 [ %17, %14 ], [ %0, %1 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ quicksort(int *const, int *const, int *const,
                             int /*<<< orphan*/, int const, int const);
void my_sort(int *const arr, int *const weight, int *const value,
             int const length) {
  quicksort(arr, weight, value, 0, length - 1, length);
}


x86 assembly (clang, -O0):
<my_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x1c(%rbp),%r9d
xor    %ecx,%ecx
call   1030 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sort>:
mov    %ecx,%r9d
lea    -0x1(%r9),%r8d
xor    %ecx,%ecx
jmp    1030 <quicksort@plt>

LLVM IR (-O0):
define void @my_sort(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %8
%15 = call i32 @quicksort(i32* %9, i32* %10, i32* %11, i32 0, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @my_sort(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = add nsw i32 %3, -1
%6 = tail call i32 @quicksort(i32* %0, i32* %1, i32* %2, i32 0, i32 %5, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void destroy0(double *vx, double *vy, double *vz) {
  free(vx);
  free(vy);
  free(vz);
}


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

x86 assembly (clang, -O2):
<destroy0>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @destroy0(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 = call i32 @free(double* %7)
%9 = load double*, double** %5
%10 = call i32 @free(double* %9)
%11 = load double*, double** %6
%12 = call i32 @free(double* %11)
ret void
}

LLVM IR (-O2):
define void @destroy0(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = tail call i32 @free(double* %0)
%5 = tail call i32 @free(double* %1)
%6 = tail call i32 @free(double* %2)
ret void
}
float quadratic_out(float step, float max_steps, float max_val) {
  float ratio = step / max_steps;
  return -max_val * ratio * (ratio - 2.0);
}


x86 assembly (clang, -O0):
<quadratic_out>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb2(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic_out>:
divss  %xmm1,%xmm0
xorps  0xef5(%rip),%xmm2
mulss  %xmm0,%xmm2
cvtss2sd %xmm0,%xmm0
addsd  0xef5(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @quadratic_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fdiv float %8, %9
store float %10, float* %7
%11 = load float, float* %6
%12 = fneg float %11
%13 = load float, float* %7
%14 = fmul float %12, %13
%15 = fpext float %14 to double
%16 = load float, float* %7
%17 = fpext float %16 to double
%18 = fsub double %17, 2.000000e+00
%19 = fmul double %15, %18
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @quadratic_out(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = fneg float %2
%6 = fmul float %4, %5
%7 = fpext float %6 to double
%8 = fpext float %4 to double
%9 = fadd double %8, -2.000000e+00
%10 = fmul double %9, %7
%11 = fptrunc double %10 to float
ret float %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
int main(void) {
  FILE *fp;
  fp = fopen("test.txt", "r");
  if (fp == NULL) {
    perror("fopen error!");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <main+0x49>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <main+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1140 <main+0x20>
pop    %rcx
ret
lea    0xec4(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [13 x i8] c"fopen error!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [13 x i8] c"fopen error!\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void arg_error(char *msg) {
  printf("%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<arg_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @arg_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}