xunge/DecIR huggingface dataset:
int nbl_get_data_pos(char *pstrBuffer) {
  int ret;
  ret = (*((int *)(pstrBuffer + 0x08)));
  while ((*((int *)(pstrBuffer + ret))) == 0)
    ret += 16;
  return ret;
}


x86 assembly (clang, -O0):
<nbl_get_data_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,1)
jne    1132 <nbl_get_data_pos+0x32>
mov    -0xc(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0xc(%rbp)
jmp    1112 <nbl_get_data_pos+0x12>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbl_get_data_pos>:
movslq 0x8(%rdi),%rcx
lea    -0x10(%rcx),%eax
add    %rcx,%rdi
nopw   0x0(%rax,%rax,1)
add    $0x10,%eax
cmpl   $0x0,(%rdi)
lea    0x10(%rdi),%rdi
je     1110 <nbl_get_data_pos+0x10>
ret

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

LLVM IR (-O2):
define i32 @nbl_get_data_pos(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
br label %6
6: ; preds = %6, %1
%7 = phi i64 [ %12, %6 ], [ %5, %1 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
%12 = add i64 %7, 16
br i1 %11, label %6, label %13
13: ; preds = %6
%14 = trunc i64 %7 to i32
ret i32 %14
}
/* Variables and functions */
int pow(int, int);
int S(int n) { return 2 * (pow(2, n) - 1) - n; }


x86 assembly (clang, -O0):
<S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
sub    $0x1,%eax
shl    $0x1,%eax
sub    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
add    %eax,%eax
sub    %ebx,%eax
add    $0xfffffffe,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @S(i32 %0) {
%2 = tail call i32 @pow(i32 2, i32 %0)
%3 = shl i32 %2, 1
%4 = sub i32 -2, %0
%5 = add i32 %4, %3
ret i32 %5
}
int test_imm_DFint64_highword_reg(long long val) {
  return ((val >> 32) & (0xDF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DFint64_highword_reg>:
movabs $0xdf00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DFint64_highword_reg(i64 %0) {
%2 = and i64 %0, 957777707008
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void SVC_Handler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @SVC_Handler() {
%1 = call i32 (...) @default_handler()
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int, int, int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
uint32_t bytecode_pop(uint8_t r0, uint8_t r1) {
  assert(r1 > 0 && r1 <= 4);
  return _bytecode_write(2, 0, 0, r0, r1, 0);
}


x86 assembly (clang, -O0):
<bytecode_pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jle    1147 <bytecode_pop+0x27>
cmpl   $0x4,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x2,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
call   1030 <_bytecode_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_pop>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    -0x1(%rbx),%eax
xor    %edi,%edi
cmp    $0x4,%eax
setb   %dil
call   1040 <assert@plt>
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
xor    %r9d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_bytecode_write@plt>

LLVM IR (-O0):
define i32 @bytecode_pop(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 4
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @_bytecode_write(i32 2, i32 0, i32 0, i32 %14, i32 %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
define i32 @bytecode_pop(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 4
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @_bytecode_write(i32 2, i32 0, i32 0, i32 %0, i32 %1, i32 0)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_shuffle_pd(int /*<<< orphan*/, int /*<<< orphan*/, int);
__m128d test_mm_shuffle_pd(__m128d A, __m128d B) {
  return _mm_shuffle_pd(A, B, 1);
}


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

x86 assembly (clang, -O2):
<test_mm_shuffle_pd>:
mov    $0x1,%edx
jmp    1030 <_mm_shuffle_pd@plt>

LLVM IR (-O0):
define i32 @test_mm_shuffle_pd(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 @_mm_shuffle_pd(i32 %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_shuffle_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_shuffle_pd(i32 %0, i32 %1, i32 1)
ret i32 %3
}
/* Type definitions */
struct cnfresult {
  int dummy;
};
struct cnfnode {
  int dummy;
};

/* Variables and functions */
struct cnfresult *cnf_find_entry_f(struct cnfnode *, char const *,
                                   int /*<<< orphan*/);
struct cnfresult *cnf_find_entry(struct cnfnode *cn_root, const char *path) {
  return cnf_find_entry_f(cn_root, path, 0);
}


x86 assembly (clang, -O0):
<cnf_find_entry>:
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 <cnf_find_entry_f@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cnfresult = type { i32 }
%struct.cnfnode = type { i32 }
define %struct.cnfresult* @cnf_find_entry(%struct.cnfnode* %0, i8* %1) {
%3 = alloca %struct.cnfnode*
%4 = alloca i8*
store %struct.cnfnode* %0, %struct.cnfnode** %3
store i8* %1, i8** %4
%5 = load %struct.cnfnode*, %struct.cnfnode** %3
%6 = load i8*, i8** %4
%7 = call %struct.cnfresult* @cnf_find_entry_f(%struct.cnfnode* %5, i8* %6, i32 0)
ret %struct.cnfresult* %7
}

LLVM IR (-O2):
%struct.cnfresult = type { i32 }
%struct.cnfnode = type { i32 }
define %struct.cnfresult* @cnf_find_entry(%struct.cnfnode* %0, i8* %1) {
%3 = tail call %struct.cnfresult* @cnf_find_entry_f(%struct.cnfnode* %0, i8* %1, i32 0)
ret %struct.cnfresult* %3
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
void *xmalloc(size_t);
void *xcalloc(size_t size) {
  void *mem;
  mem = xmalloc(size);
  bzero(mem, size);
  return (mem);
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xcalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @xmalloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @bzero(i8* %6, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0) {
%2 = tail call i8* @xmalloc(i64 %0)
%3 = tail call i32 @bzero(i8* %2, i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ gpio_write_and_close(int, int /*<<< orphan*/);
int /*<<< orphan*/ spi_byte_send_8(int, int /*<<< orphan*/);
int spi_init(int /*<<< orphan*/, int, int);
void screen_ssd1306_send_command(uint8_t command) {
  int dev = spi_init(0, 8, 25000);
  gpio_write_and_close(19, 0);
  spi_byte_send_8(dev, command);
}


x86 assembly (clang, -O0):
<screen_ssd1306_send_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x8,%esi
mov    $0x61a8,%edx
call   1040 <spi_init@plt>
mov    %eax,-0x8(%rbp)
mov    $0x13,%edi
xor    %esi,%esi
call   1030 <gpio_write_and_close@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <spi_byte_send_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_ssd1306_send_command>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x8,%esi
mov    $0x61a8,%edx
call   1040 <spi_init@plt>
mov    %eax,%ebp
mov    $0x13,%edi
xor    %esi,%esi
call   1030 <gpio_write_and_close@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <spi_byte_send_8@plt>

LLVM IR (-O0):
define void @screen_ssd1306_send_command(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @spi_init(i32 0, i32 8, i32 25000)
store i32 %4, i32* %3
%5 = call i32 @gpio_write_and_close(i32 19, i32 0)
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @spi_byte_send_8(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @screen_ssd1306_send_command(i32 %0) {
%2 = tail call i32 @spi_init(i32 0, i32 8, i32 25000)
%3 = tail call i32 @gpio_write_and_close(i32 19, i32 0)
%4 = tail call i32 @spi_byte_send_8(i32 %2, i32 %0)
ret void
}
int do_659() { return 659; }


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

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

LLVM IR (-O0):
define i32 @do_659() {
ret i32 659
}

LLVM IR (-O2):
define i32 @do_659() {
ret i32 659
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_or_si128(int /*<<< orphan*/ const,
                                int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_subs_epu8(int /*<<< orphan*/ const,
                                 int /*<<< orphan*/ const);
__m128i abs_sub_epu8(const __m128i a, const __m128i b) {
  const __m128i ab = _mm_subs_epu8(a, b);
  const __m128i ba = _mm_subs_epu8(b, a);
  return _mm_or_si128(ab, ba);
}


x86 assembly (clang, -O0):
<abs_sub_epu8>:
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 <_mm_subs_epu8@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <_mm_subs_epu8@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <_mm_or_si128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_sub_epu8>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_mm_subs_epu8@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <_mm_subs_epu8@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_mm_or_si128@plt>

LLVM IR (-O0):
define i32 @abs_sub_epu8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @_mm_subs_epu8(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = call i32 @_mm_subs_epu8(i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @_mm_or_si128(i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @abs_sub_epu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_epu8(i32 %0, i32 %1)
%4 = tail call i32 @_mm_subs_epu8(i32 %1, i32 %0)
%5 = tail call i32 @_mm_or_si128(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
char const *longname();
const char *wrap_longname(void) { return longname(); }


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

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

LLVM IR (-O0):
define i8* @wrap_longname() {
%1 = call i8* (...) @longname()
ret i8* %1
}

LLVM IR (-O2):
define i8* @wrap_longname() {
%1 = tail call i8* (...) @longname()
ret i8* %1
}
int __ch2o_len_core(int n, unsigned long long i, int w) {
  if (i == 0) {
    n = 1;
  }
  while (0 < i) {
    n++;
    i /= 10;
  }
  return n < w ? w : n;
}


x86 assembly (clang, -O0):
<__ch2o_len_core>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <__ch2o_len_core+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1125 <__ch2o_len_core+0x25>
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jae    1151 <__ch2o_len_core+0x51>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
jmp    1125 <__ch2o_len_core+0x25>
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1168 <__ch2o_len_core+0x68>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    116e <__ch2o_len_core+0x6e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ch2o_len_core>:
mov    %edx,%r8d
test   %rsi,%rsi
je     1138 <__ch2o_len_core+0x38>
movabs $0xcccccccccccccccd,%rcx
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%edi
mov    %rsi,%rax
mul    %rcx
shr    $0x3,%rdx
cmp    $0x9,%rsi
mov    %rdx,%rsi
ja     1120 <__ch2o_len_core+0x20>
jmp    113d <__ch2o_len_core+0x3d>
mov    $0x1,%edi
cmp    %r8d,%edi
cmovl  %r8d,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @__ch2o_len_core(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
store i32 1, i32* %4
br label %10
10: ; preds = %9, %3
br label %11
11: ; preds = %14, %10
%12 = load i64, i64* %5
%13 = icmp ult i64 0, %12
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i64, i64* %5
%18 = udiv i64 %17, 10
store i64 %18, i64* %5
br label %11
19: ; preds = %11
%20 = load i32, i32* %4
%21 = load i32, i32* %6
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32, i32* %6
br label %27
25: ; preds = %19
%26 = load i32, i32* %4
br label %27
27: ; preds = %25, %23
%28 = phi i32 [ %24, %23 ], [ %26, %25 ]
ret i32 %28
}

LLVM IR (-O2):
define i32 @__ch2o_len_core(i32 %0, i64 %1, i32 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %0, %3 ]
%7 = phi i64 [ %9, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, 1
%9 = udiv i64 %7, 10
%10 = icmp ult i64 %7, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %3
%12 = phi i32 [ 1, %3 ], [ %8, %5 ]
%13 = icmp slt i32 %12, %2
%14 = select i1 %13, i32 %2, i32 %12
ret i32 %14
}
int mpegver(int headervalue) {
  if (headervalue == 3)
    return 0;
  if (headervalue == 2)
    return 1;
  if (headervalue == 0)
    return 2;
  return 3;
}


x86 assembly (clang, -O0):
<mpegver>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    111d <mpegver+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1150 <mpegver+0x50>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <mpegver+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1150 <mpegver+0x50>
cmpl   $0x0,-0x8(%rbp)
jne    1149 <mpegver+0x49>
movl   $0x2,-0x4(%rbp)
jmp    1150 <mpegver+0x50>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpegver>:
mov    $0x3,%eax
cmp    $0x3,%edi
ja     1117 <mpegver+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.mpegver = [4 x i32] [i32 2, i32 3, i32 1, i32 0]
define i32 @mpegver(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.mpegver, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 3, %1 ]
ret i32 %8
}
int test03(const char *s1, int n) { return __builtin_strncmp(s1, "abcde", n); }


x86 assembly (clang, -O0):
<test03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rdx
lea    0xed2(%rip),%rsi
call   1030 <strncmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test03>:
movslq %esi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
define i32 @test03(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 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
define i32 @test03(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 %4
}
/* Type definitions */
struct List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_insertNext_byValue(struct List *, int);
void lifo_push(struct List *list, int x) { list_insertNext_byValue(list, x); }


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

x86 assembly (clang, -O2):
<lifo_push>:
jmp    1030 <list_insertNext_byValue@plt>

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

LLVM IR (-O2):
%struct.List = type { i32 }
define void @lifo_push(%struct.List* %0, i32 %1) {
%3 = tail call i32 @list_insertNext_byValue(%struct.List* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ G_SayCensor_Init();
__attribute__((visibility("default"))) __attribute__((cdecl)) int OnInit() {
  G_SayCensor_Init();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @OnInit() {
%1 = tail call i32 (...) @G_SayCensor_Init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(size_t);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ secure_memset(void *, char, size_t);
void secure_free(void *ptr, size_t len) {
  assert(len);
  if (ptr) {
    secure_memset(ptr, '\0', len);
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<secure_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
cmpq   $0x0,-0x8(%rbp)
je     116c <secure_free+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1050 <secure_memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <assert@plt>
test   %rbx,%rbx
je     1163 <secure_free+0x33>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <secure_memset@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @secure_free(i8* %0, i64 %1) {
%3 = tail call i32 @assert(i64 %1)
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @secure_memset(i8* %0, i8 signext 0, i64 %1)
%7 = tail call i32 @free(i8* %0)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char c;
  printf("Enter a character: ");
  c = getchar();
  fflush(stdin);
  printf("%c = %d", c, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
movsbl %bl,%edx
lea    0xeb4(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter a character: \00"
@stdin = global i32 0
@.str.1 = [8 x i8] c"%c = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter a character: \00"
@stdin = global i32 0
@.str.1 = [8 x i8] c"%c = %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = load i32, i32* @stdin
%4 = tail call i32 @fflush(i32 %3)
%5 = sext i8 %2 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %5)
ret i32 0
}
void multidim_arr6_Good_FP() {
  int a[3][2];
  int b[10];
  int *p = a;
  *p = 5;
  b[a[0][0]] = 1;
}


x86 assembly (clang, -O0):
<multidim_arr6_Good_FP>:
push   %rbp
mov    %rsp,%rbp
lea    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movl   $0x5,(%rax)
movslq -0x20(%rbp),%rax
movl   $0x1,-0x50(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @multidim_arr6_Good_FP() {
%1 = alloca [3 x [2 x i32]]
%2 = alloca [10 x i32]
%3 = alloca i32*
%4 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 0
%5 = bitcast [2 x i32]* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 5, i32* %6
%7 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %10
store i32 1, i32* %11
ret void
}

LLVM IR (-O2):
define void @multidim_arr6_Good_FP() {
ret void
}
int fooInit() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fooInit() {
ret i32 1
}
int getLargeIndex() { return 1000; }


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

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

LLVM IR (-O0):
define i32 @getLargeIndex() {
ret i32 1000
}

LLVM IR (-O2):
define i32 @getLargeIndex() {
ret i32 1000
}
int fchar_cmp(const char a, const char b) { return (int)a - (int)b; }


x86 assembly (clang, -O0):
<fchar_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fchar_cmp(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @fchar_cmp(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ lgamma_r(double, int *);
double tgamma(double x) {
  int sign;
  double y;
  y = exp(lgamma_r(x, &sign));
  if (sign < 0)
    y = -y;
  return y;
}


x86 assembly (clang, -O0):
<tgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
call   1030 <lgamma_r@plt>
mov    %eax,%edi
call   1040 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1172 <tgamma+0x52>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgamma>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <lgamma_r@plt>
mov    %eax,%edi
call   1040 <exp@plt>
cmpl   $0x0,0x4(%rsp)
jns    1140 <tgamma+0x20>
xorps  0xec0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tgamma(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call i32 @lgamma_r(double %5, i32* %3)
%7 = call double @exp(i32 %6)
store double %7, double* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %4
%12 = fneg double %11
store double %12, double* %4
br label %13
13: ; preds = %10, %1
%14 = load double, double* %4
ret double %14
}

LLVM IR (-O2):
define double @tgamma(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @lgamma_r(double %0, i32* %2)
%5 = call double @exp(i32 %4)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
%8 = fneg double %5
%9 = select i1 %7, double %8, double %5
ret double %9
}
/* Variables and functions */
scalar_t__ isdigit(int);
int toi(int x) { return isdigit(x) ? x - '0' : x - 'W'; }


x86 assembly (clang, -O0):
<toi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     113b <toi+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <toi+0x34>
mov    -0x4(%rbp),%eax
sub    $0x57,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toi>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
lea    -0x30(%rbx),%ecx
add    $0xffffffa9,%ebx
test   %rax,%rax
cmovne %ecx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 48
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 87
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @toi(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -87, i32 -48
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int wspace(char *, int);
char next_tok(char *str, int *pos) {
  int nows = wspace(str, *pos);
  *pos = nows;
  *pos += 1;
  return str[nows];
}


x86 assembly (clang, -O0):
<next_tok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <wspace@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_tok>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%esi
call   1030 <wspace@plt>
lea    0x1(%rax),%ecx
mov    %ecx,(%rbx)
cltq
mov    (%r14,%rax,1),%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define signext i8 @next_tok(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @wspace(i8* %0, i32 %3)
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}
float rampf(float x) {
  if (x >= 0.0f) {
    return x;
  }
  return 0.0f;
}


x86 assembly (clang, -O0):
<rampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <rampf+0x29>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1131 <rampf+0x31>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rampf>:
xorps  %xmm1,%xmm1
cmpless %xmm0,%xmm1
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @rampf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %3
store float %7, float* %2
br label %9
8: ; preds = %1
store float 0.000000e+00, float* %2
br label %9
9: ; preds = %8, %6
%10 = load float, float* %2
ret float %10
}

LLVM IR (-O2):
define float @rampf(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float %0, float 0.000000e+00
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lcd(char *text) { printf(text); }


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

x86 assembly (clang, -O2):
<lcd>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @lcd(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
int f2(int *p) {
  int r = 0;
  r += p == (void *)0;
  r += p != (void *)0;
  r += (void *)0 == p;
  r += (void *)0 != p;
  r += p == 0;
  r += p != 0;
  r += 0 == p;
  r += 0 != p;
  return r;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f2(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 eq i32* %4, null
%6 = zext i1 %5 to i32
%7 = load i32, i32* %3
%8 = add nsw i32 %7, %6
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32*, i32** %2
%15 = icmp eq i32* null, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %3
%18 = add nsw i32 %17, %16
store i32 %18, i32* %3
%19 = load i32*, i32** %2
%20 = icmp ne i32* null, %19
%21 = zext i1 %20 to i32
%22 = load i32, i32* %3
%23 = add nsw i32 %22, %21
store i32 %23, i32* %3
%24 = load i32*, i32** %2
%25 = icmp eq i32* %24, null
%26 = zext i1 %25 to i32
%27 = load i32, i32* %3
%28 = add nsw i32 %27, %26
store i32 %28, i32* %3
%29 = load i32*, i32** %2
%30 = icmp ne i32* %29, null
%31 = zext i1 %30 to i32
%32 = load i32, i32* %3
%33 = add nsw i32 %32, %31
store i32 %33, i32* %3
%34 = load i32*, i32** %2
%35 = icmp eq i32* null, %34
%36 = zext i1 %35 to i32
%37 = load i32, i32* %3
%38 = add nsw i32 %37, %36
store i32 %38, i32* %3
%39 = load i32*, i32** %2
%40 = icmp ne i32* null, %39
%41 = zext i1 %40 to i32
%42 = load i32, i32* %3
%43 = add nsw i32 %42, %41
store i32 %43, i32* %3
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
define i32 @f2(i32* readnone %0) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test(int a) {
  printf("hmm. %d\n", a);
  return -1;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"hmm. %d\0A\00"
define i32 @test(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void curses_flush(void *ui) {
  WINDOW *win = ui;
  wrefresh(win);
}


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

x86 assembly (clang, -O2):
<curses_flush>:
jmp    1030 <wrefresh@plt>

LLVM IR (-O0):
define void @curses_flush(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @wrefresh(i32* %6)
ret void
}

LLVM IR (-O2):
define void @curses_flush(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @wrefresh(i32* %2)
ret void
}
int numa_move_pages(int pid, unsigned long count, void **pages,
                    const int *nodes, int *status, int flags) {
  *status = 0;
  return 0;
}


x86 assembly (clang, -O0):
<numa_move_pages>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numa_move_pages>:
movl   $0x0,(%r8)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @numa_move_pages(i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8**
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
store i32 %0, i32* %7
store i64 %1, i64* %8
store i8** %2, i8*** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32*, i32** %11
store i32 0, i32* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @numa_move_pages(i32 %0, i64 %1, i8** nocapture readnone %2, i32* nocapture readnone %3, i32* nocapture writeonly %4, i32 %5) {
store i32 0, i32* %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xba() {
  Assert_real((isdigit(186) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              935, ("isdigit should be 0 for 0xba"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xba>:
push   %rax
mov    $0xba,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3a7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xba\00"
define void @t_isdigit_0xba() {
%1 = call i64 @isdigit(i32 186)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 935, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xba\00"
define void @t_isdigit_0xba() {
%1 = tail call i64 @isdigit(i32 186)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 935, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void glGetError(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetError() {
ret void
}
/* Variables and functions */
char *addColor(char *, char *);
char *magenta(char *str) { return addColor("35", str); }


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

x86 assembly (clang, -O2):
<magenta>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <addColor@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"35\00"
define i8* @magenta(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int bmp_test();
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ start_file(int /*<<< orphan*/ *);
int stbi_bmp_test_file(FILE *f) {
  int r, n = ftell(f);
  start_file(f);
  r = bmp_test();
  fseek(f, n, SEEK_SET);
  return r;
}


x86 assembly (clang, -O0):
<stbi_bmp_test_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <start_file@plt>
mov    $0x0,%al
call   1060 <bmp_test@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    0x2e67(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi_bmp_test_file>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <ftell@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <start_file@plt>
xor    %eax,%eax
call   1060 <bmp_test@plt>
mov    %eax,%ebp
mov    0x2e79(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1050 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @stbi_bmp_test_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @ftell(i32* %5)
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = call i32 @start_file(i32* %7)
%9 = call i32 (...) @bmp_test()
store i32 %9, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* %4
%12 = load i32, i32* @SEEK_SET
%13 = call i32 @fseek(i32* %10, i32 %11, i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @stbi_bmp_test_file(i32* %0) {
%2 = tail call i32 @ftell(i32* %0)
%3 = tail call i32 @start_file(i32* %0)
%4 = tail call i32 (...) @bmp_test()
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 %2, i32 %5)
ret i32 %4
}
const char *Slice_Definition(void) {
  return "struct Slice {\n"
         "  var iter;\n"
         "  var range;\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"struct Slice {\0A var iter;\0A var range;\0A};\0A\00"
define i8* @Slice_Definition() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [44 x i8] c"struct Slice {\0A var iter;\0A var range;\0A};\0A\00"
define i8* @Slice_Definition() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}