xunge/DecIR huggingface dataset:
unsigned long calc_pow_2(unsigned long op) {
  unsigned long a = 1;
  while (op--)
    a *= 2;
  return a;
}


x86 assembly (clang, -O0):
<calc_pow_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     113a <calc_pow_2+0x3a>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <calc_pow_2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_pow_2>:
test   %rdi,%rdi
je     111b <calc_pow_2+0x1b>
lea    -0x1(%rdi),%rax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <calc_pow_2+0x21>
mov    $0x1,%eax
jmp    113a <calc_pow_2+0x3a>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rdi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
shl    $0x8,%rax
add    $0xfffffffffffffff8,%rdi
jne    1130 <calc_pow_2+0x30>
test   %rcx,%rcx
je     1149 <calc_pow_2+0x49>
nop
add    %rax,%rax
add    $0xffffffffffffffff,%rcx
jne    1140 <calc_pow_2+0x40>
ret

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

LLVM IR (-O2):
define i64 @calc_pow_2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %25, label %3
3: ; preds = %1
%4 = add i64 %0, -1
%5 = and i64 %0, 7
%6 = icmp ult i64 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i64 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i64 [ 1, %7 ], [ %12, %9 ]
%11 = phi i64 [ 0, %7 ], [ %13, %9 ]
%12 = shl i64 %10, 8
%13 = add i64 %11, 8
%14 = icmp eq i64 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i64 [ undef, %3 ], [ %12, %9 ]
%17 = phi i64 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i64 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i64 [ %22, %19 ], [ %17, %15 ]
%21 = phi i64 [ %23, %19 ], [ 0, %15 ]
%22 = shl i64 %20, 1
%23 = add i64 %21, 1
%24 = icmp eq i64 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i64 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i64 %26
}
unsigned int gcd(unsigned int num1, unsigned int num2) {
  if (num2 > 0) {
    return gcd(num2, num1 % num2);
  }
  return num1;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1142 <gcd+0x32>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1148 <gcd+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111e <gcd+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = urem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_pwm_set_range(unsigned int, unsigned int);
int pwm_setrange(unsigned int pwm_channel, unsigned int range) {
  bcm2835_pwm_set_range(pwm_channel, range);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @pwm_setrange(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 = call i32 @bcm2835_pwm_set_range(i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @pwm_setrange(i32 %0, i32 %1) {
%3 = tail call i32 @bcm2835_pwm_set_range(i32 %0, i32 %1)
ret i32 0
}
void swr_get_class() {}


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

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

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

LLVM IR (-O2):
define void @swr_get_class() {
ret void
}
/* Variables and functions */
double atof(char *);
double atof_woffset(char *ptr, int offset) { return atof(ptr + offset); }


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

x86 assembly (clang, -O2):
<atof_woffset>:
movslq %esi,%rax
add    %rax,%rdi
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @atof_woffset(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = call double @atof(i8* %8)
ret double %9
}

LLVM IR (-O2):
define double @atof_woffset(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call double @atof(i8* %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t stdlib_ndarray_set_ptr_uint64(uint8_t *idx, const uint64_t v) {
  *(uint64_t *)idx = v;
  return 0;
}


x86 assembly (clang, -O0):
<stdlib_ndarray_set_ptr_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @stdlib_ndarray_set_ptr_uint64(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 0
}
/* Type definitions */
typedef enum parsing_mode { ____Placeholder_parsing_mode } parsing_mode;

/* Variables and functions */
int bottom_up();
int top_down();
int syntax_rule() {
  enum parsing_mode { TOP_DOWN, BOTTOM_UP };
  static enum parsing_mode mode = TOP_DOWN;
  int rule;
  if (mode == TOP_DOWN) {
    if ((rule = top_down()) == -1) {
      mode = BOTTOM_UP;
    }
  } else {
    if ((rule = bottom_up()) == -1) {
      mode = TOP_DOWN;
    }
  }
  return rule;
}


x86 assembly (clang, -O0):
<syntax_rule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f05(%rip)
jne    1157 <syntax_rule+0x37>
mov    $0x0,%al
call   1030 <top_down@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
jne    1152 <syntax_rule+0x32>
movl   $0x1,0x2ee2(%rip)
jmp    1179 <syntax_rule+0x59>
mov    $0x0,%al
call   1040 <bottom_up@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
jne    1174 <syntax_rule+0x54>
movl   $0x0,0x2ec0(%rip)
jmp    1179 <syntax_rule+0x59>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syntax_rule>:
push   %rbx
mov    0x2f0d(%rip),%bl
xor    %eax,%eax
test   %bl,%bl
je     1139 <syntax_rule+0x19>
call   1040 <bottom_up@plt>
cmp    $0xffffffff,%eax
jne    1143 <syntax_rule+0x23>
jmp    1145 <syntax_rule+0x25>
call   1030 <top_down@plt>
cmp    $0xffffffff,%eax
je     1145 <syntax_rule+0x25>
pop    %rbx
ret
xor    $0x1,%bl
mov    %bl,0x2ee6(%rip)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@syntax_rule.mode = internal global i32 0
define i32 @syntax_rule() {
%1 = alloca i32
%2 = load i32, i32* @syntax_rule.mode
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = call i32 (...) @top_down()
store i32 %5, i32* %1
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %4
store i32 1, i32* @syntax_rule.mode
br label %8
8: ; preds = %7, %4
br label %14
9: ; preds = %0
%10 = call i32 (...) @bottom_up()
store i32 %10, i32* %1
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* @syntax_rule.mode
br label %13
13: ; preds = %12, %9
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@syntax_rule.mode = internal unnamed_addr global i1 false
define i32 @syntax_rule() {
%1 = load i1, i1* @syntax_rule.mode
br i1 %1, label %5, label %2
2: ; preds = %0
%3 = tail call i32 (...) @top_down()
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %10
5: ; preds = %0
%6 = tail call i32 (...) @bottom_up()
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = xor i1 %1, true
store i1 %9, i1* @syntax_rule.mode
br label %10
10: ; preds = %8, %5, %2
%11 = phi i32 [ %3, %2 ], [ %6, %5 ], [ -1, %8 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ side_effect(int /*<<< orphan*/ *);
uint32_t foo(uint32_t x) {
  uint32_t b = x;
  side_effect(&b);
  return side_effect(&b);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <side_effect@plt>
lea    -0x8(%rbp),%rdi
call   1030 <side_effect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <side_effect@plt>
mov    %rbx,%rdi
call   1030 <side_effect@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 %0, i32* %2
%4 = call i32 @side_effect(i32* %2)
%5 = call i32 @side_effect(i32* %2)
ret i32 %5
}
void *netsnmp_generic_remove_row(void *table, void *row) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @netsnmp_generic_remove_row(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t read32(uint32_t address) {
  return (*((volatile uint32_t *)(address)));
}


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

x86 assembly (clang, -O2):
<read32>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @read32(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @read32(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}
/* Variables and functions */
int drand48();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int random_between(int a, int b) {
  int i;
  if (b < a) {
    fprintf(stderr, "b < a!\n");
  }
  i = a + (int)(drand48() * (b - a));
  return i;
}


x86 assembly (clang, -O0):
<random_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114f <random_between+0x2f>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <drand48@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%edx
sub    -0x4(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_between>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
sub    %edi,%ebp
jge    1140 <random_between+0x20>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <drand48@plt>
imul   %ebp,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"b < a!\0A\00"
define i32 @random_between(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* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %2
%13 = load i32, i32* %3
%14 = call i32 (...) @drand48()
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
%18 = mul nsw i32 %14, %17
%19 = add nsw i32 %13, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"b < a!\0A\00"
define i32 @random_between(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %2
%8 = tail call i32 (...) @drand48()
%9 = sub nsw i32 %1, %0
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %10, %0
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_smalltalk_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("smalltalk", " \"comment\""),
                            "comment", "\"comment\"");
}


x86 assembly (clang, -O0):
<test_smalltalk_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xed5(%rip),%rsi
lea    0xec4(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_smalltalk_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xeda(%rip),%rsi
lea    0xec9(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"smalltalk\00"
@.str.1 = [11 x i8] c" \22comment\22\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [10 x i8] c"\22comment\22\00"
define void @test_smalltalk_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"smalltalk\00"
@.str.1 = [11 x i8] c" \22comment\22\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [10 x i8] c"\22comment\22\00"
define void @test_smalltalk_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int cmpInt(void *s1, void *s2) { return *((int *)s1) - *((int *)s2); }


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

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

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

LLVM IR (-O2):
define i32 @cmpInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ internal_tcp_raw_write(int, char const *, int);
int /*<<< orphan*/ tcp_flush();
void tcp_raw_write(int fd, const char *data, int len) {
  tcp_flush();
  internal_tcp_raw_write(fd, data, len);
}


x86 assembly (clang, -O0):
<tcp_raw_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <tcp_flush@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <internal_tcp_raw_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_raw_write>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <tcp_flush@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <internal_tcp_raw_write@plt>

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

LLVM IR (-O2):
define void @tcp_raw_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (...) @tcp_flush()
%5 = tail call i32 @internal_tcp_raw_write(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void test(char *str) { printf("Char: %c \n", *str + 3); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x3,%eax
lea    0xed3(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    (%rdi),%al
add    $0x3,%al
movsbl %al,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Char: %c \0A\00"
define void @test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 3
%7 = trunc i32 %6 to i8
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Char: %c \0A\00"
define void @test(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, 3
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int check_reg_index(int index) {
  assert(index >= 0 && index < 8);
  return index;
}


x86 assembly (clang, -O0):
<check_reg_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1134 <check_reg_index+0x24>
cmpl   $0x8,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_reg_index>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x8,%ebx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check_reg_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 8
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @check_reg_index(i32 returned %0) {
%2 = icmp ult i32 %0, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ __s32_cpy(void *, void *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void __s32_cpy_never_ever(void *a, void *b) {
  fprintf(stdout, "__s32_cpy_never_ever\n");
  __s32_cpy(a, b);
}


x86 assembly (clang, -O0):
<__s32_cpy_never_ever>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__s32_cpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__s32_cpy_never_ever>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__s32_cpy@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [22 x i8] c"__s32_cpy_never_ever\0A\00"
define void @__s32_cpy_never_ever(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @__s32_cpy(i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [22 x i8] c"__s32_cpy_never_ever\0A\00"
define void @__s32_cpy_never_ever(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @__s32_cpy(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_number_of_quaddobl_Laurentials(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(562, length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_quaddobl_Laurentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x232,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_quaddobl_Laurentials>:
mov    %rdi,%rsi
mov    $0x232,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_number_of_quaddobl_Laurentials(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 562, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_number_of_quaddobl_Laurentials(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 562, i32* %0, i32* undef, double* undef)
ret i32 %2
}
int f(int x) {
  int y = 0;
  if (x > 0)
    y = 1;
  else
    y = x;
  return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1124 <f+0x24>
movl   $0x1,-0x8(%rbp)
jmp    112a <f+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
mov    $0x1,%eax
cmovle %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %3
br label %9
7: ; preds = %1
%8 = load i32, i32* %2
store i32 %8, i32* %3
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = select i1 %2, i32 %0, i32 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void admin_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<admin_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @admin_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetFileSize_test();
int /*<<< orphan*/ GetFreeSpace_test();
int main(int argc, char **argv) {
  GetFileSize_test();
  GetFreeSpace_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @GetFileSize_test()
%4 = tail call i32 (...) @GetFreeSpace_test()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_destroy(pthread_mutex_t *mutex) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_destroy(i32* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
struct trie {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dump(struct trie *, int /*<<< orphan*/);
int trie_dump(struct trie *root) {
  dump(root, 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.trie = type { i32 }
define i32 @trie_dump(%struct.trie* %0) {
%2 = tail call i32 @dump(%struct.trie* %0, i32 0)
ret i32 0
}
/* Type definitions */
struct gdbwire_string {
  int dummy;
};

/* Variables and functions */
int gdbwire_string_append_data(struct gdbwire_string *, char *, int);
int gdbwire_string_append_char(struct gdbwire_string *string, char c) {
  return gdbwire_string_append_data(string, &c, 1);
}


x86 assembly (clang, -O0):
<gdbwire_string_append_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <gdbwire_string_append_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbwire_string_append_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <gdbwire_string_append_data@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.gdbwire_string = type { i32 }
define i32 @gdbwire_string_append_char(%struct.gdbwire_string* %0, i8 signext %1) {
%3 = alloca %struct.gdbwire_string*
%4 = alloca i8
store %struct.gdbwire_string* %0, %struct.gdbwire_string** %3
store i8 %1, i8* %4
%5 = load %struct.gdbwire_string*, %struct.gdbwire_string** %3
%6 = call i32 @gdbwire_string_append_data(%struct.gdbwire_string* %5, i8* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
%struct.gdbwire_string = type { i32 }
define i32 @gdbwire_string_append_char(%struct.gdbwire_string* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @gdbwire_string_append_data(%struct.gdbwire_string* %0, i8* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G133_f(char *s) {
  debug("G133_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G133_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G133_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"G133_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G133_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"G133_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G133_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int len = 0;
  char cadena[8] = "cadena";
  while (cadena[len] != '\0') {
    len++;
  }
  printf("La cadena mide %d\n", len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xc(%rbp)
movslq -0x4(%rbp),%rax
movsbl -0xc(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     114a <main+0x3a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112a <main+0x1a>
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.cadena = [8 x i8] c"cadena\00\00"
@.str = [19 x i8] c"La cadena mide %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = bitcast [8 x i8]* %2 to i8*
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %4
14: ; preds = %4
%15 = load i32, i32* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"La cadena mide %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
void *add(void *a, void *b) { return (void *)((int)a + (int)b); }


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

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

LLVM IR (-O0):
define i8* @add(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 = ptrtoint i8* %5 to i32
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @add(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = add i64 %4, %3
%6 = shl i64 %5, 32
%7 = ashr exact i64 %6, 32
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createAndExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x03, expression1, expression2);
}


x86 assembly (clang, -O0):
<createAndExpression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x3,%edi
call   1030 <createExpression@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createAndExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x3,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createAndExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 3, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createAndExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 3, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hashfn_uint8_djb(int /*<<< orphan*/ *, int);
int strlen(char *);
uint32_t hashtable_hashfn_char(void *k) {
  char *s = (char *)k;
  int len = strlen((char *)s);
  return hashfn_uint8_djb((uint8_t *)s, len);
}


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

x86 assembly (clang, -O2):
<hashtable_hashfn_char>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <hashfn_uint8_djb@plt>

LLVM IR (-O0):
define i32 @hashtable_hashfn_char(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %4
%11 = call i32 @hashfn_uint8_djb(i32* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @hashtable_hashfn_char(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @hashfn_uint8_djb(i32* %3, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, scalar_t__);
scalar_t__ square_of_sums(int);
scalar_t__ sum_of_squares(int);
int main(void) {
  printf("%ld\n", square_of_sums(100) - sum_of_squares(100));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1030 <square_of_sums@plt>
mov    %rax,-0x10(%rbp)
mov    $0x64,%edi
call   1050 <sum_of_squares@plt>
mov    -0x10(%rbp),%rsi
sub    %rax,%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1030 <square_of_sums@plt>
mov    %rax,%rbx
mov    $0x64,%edi
call   1050 <sum_of_squares@plt>
sub    %rax,%rbx
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @square_of_sums(i32 100)
%3 = call i64 @sum_of_squares(i32 100)
%4 = sub nsw i64 %2, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i64 @square_of_sums(i32 100)
%2 = tail call i64 @sum_of_squares(i32 100)
%3 = sub nsw i64 %1, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}
/* Variables and functions */
int __real__xlsmpSyncRegionItemL2Fence(long, long, long);
int /*<<< orphan*/ idle_metric_blame_shift_idle();
int /*<<< orphan*/ idle_metric_blame_shift_work();
int __wrap__xlsmpSyncRegionItemL2Fence(long x, long y, long z) {
  int ret;
  ;
  idle_metric_blame_shift_idle();
  ret = __real__xlsmpSyncRegionItemL2Fence(x, y, z);
  idle_metric_blame_shift_work();
  ;
  return ret;
}


x86 assembly (clang, -O0):
<__wrap__xlsmpSyncRegionItemL2Fence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <idle_metric_blame_shift_idle@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <__real__xlsmpSyncRegionItemL2Fence@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <idle_metric_blame_shift_work@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap__xlsmpSyncRegionItemL2Fence>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <idle_metric_blame_shift_idle@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <__real__xlsmpSyncRegionItemL2Fence@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <idle_metric_blame_shift_work@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @__wrap__xlsmpSyncRegionItemL2Fence(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = call i32 (...) @idle_metric_blame_shift_idle()
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = call i32 @__real__xlsmpSyncRegionItemL2Fence(i64 %9, i64 %10, i64 %11)
store i32 %12, i32* %7
%13 = call i32 (...) @idle_metric_blame_shift_work()
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @__wrap__xlsmpSyncRegionItemL2Fence(i64 %0, i64 %1, i64 %2) {
%4 = tail call i32 (...) @idle_metric_blame_shift_idle()
%5 = tail call i32 @__real__xlsmpSyncRegionItemL2Fence(i64 %0, i64 %1, i64 %2)
%6 = tail call i32 (...) @idle_metric_blame_shift_work()
ret i32 %5
}
void nand_init_ll(void) {
  (*((volatile unsigned long *)0x4E000000)) = (0 << 12) | (1 << 8) | (0 << 4);
  (*((volatile unsigned long *)0x4E000004)) = (1 << 4) | (1 << 1) | (1 << 0);
}


x86 assembly (clang, -O0):
<nand_init_ll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000000,%eax
movq   $0x100,(%rax)
mov    $0x4e000004,%eax
movq   $0x13,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init_ll>:
movq   $0x100,0x4e000000
movq   $0x13,0x4e000004
ret

LLVM IR (-O0):
define void @nand_init_ll() {
store volatile i64 256, i64* inttoptr (i64 1308622848 to i64*)
store volatile i64 19, i64* inttoptr (i64 1308622852 to i64*)
ret void
}

LLVM IR (-O2):
define void @nand_init_ll() {
store volatile i64 256, i64* inttoptr (i64 1308622848 to i64*)
store volatile i64 19, i64* inttoptr (i64 1308622852 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ initialize_interface();
void main(int argc, char *agrv[]) {
  initialize_interface();
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @initialize_interface()
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initialize_interface()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void AmiSetQword40ToLe(void *pAddr_p, long long int qwQwordVal_p) {
  ((unsigned long int *)pAddr_p)[0] = ((unsigned long int *)&qwQwordVal_p)[0];
  ((unsigned char *)pAddr_p)[4] = ((unsigned char *)&qwQwordVal_p)[4];
}


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

x86 assembly (clang, -O2):
<AmiSetQword40ToLe>:
mov    %rsi,(%rdi)
shr    $0x20,%rsi
mov    %sil,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @AmiSetQword40ToLe(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 32
%4 = trunc i64 %3 to i8
%5 = bitcast i8* %0 to i64*
store i64 %1, i64* %5
%6 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %4, i8* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int _chmod(const char *path, mode_t mode) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_chmod>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @_chmod(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @_chmod(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int mysnprintf(char *, size_t, char *, size_t);
int sizet2str(size_t value, char *buf, size_t len) {
  return mysnprintf(buf, len, "%zd", value);
}


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

x86 assembly (clang, -O2):
<sizet2str>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <mysnprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%zd\00"
define i32 @sizet2str(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i64, i64* %4
%10 = call i32 @mysnprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%zd\00"
define i32 @sizet2str(i64 %0, i8* %1, i64 %2) {
%4 = tail call i32 @mysnprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 %4
}
/* Variables and functions */
scalar_t__ bar();
scalar_t__ foo();
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (foo() == bar())
    printf("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <foo@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jne    116d <main+0x3d>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <foo@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <bar@plt>
cmp    %rax,%rbx
jne    1153 <main+0x23>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = call i64 (...) @bar()
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = tail call i64 (...) @bar()
%3 = icmp eq i64 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}