xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ m68040_fpu_op0();
int /*<<< orphan*/ m68ki_exception_1111();
void m68k_op_040fpu0_32(void) {
  if (0) {
    m68040_fpu_op0();
    return;
  }
  m68ki_exception_1111();
}


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

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

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

LLVM IR (-O2):
define void @m68k_op_040fpu0_32() {
%1 = tail call i32 (...) @m68ki_exception_1111()
ret void
}
/* Variables and functions */
int remove(char const *);
int remove_file(const char *path) { return remove(path); }


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

x86 assembly (clang, -O2):
<remove_file>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @remove_file(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ COND_VS();
int /*<<< orphan*/ EA_AY_DI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_svs_8_di(void) {
  m68ki_write_8(EA_AY_DI_8(), COND_VS() ? 0xff : 0);
}


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

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

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

LLVM IR (-O2):
define void @m68k_op_svs_8_di() {
%1 = tail call i32 (...) @EA_AY_DI_8()
%2 = tail call i64 (...) @COND_VS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
char square_parse(char a) {
  if (a >= '1' && a <= '9')
    return a - '0';
  return 0;
}


x86 assembly (clang, -O0):
<square_parse>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x31,%eax
jl     1133 <square_parse+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <square_parse+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1137 <square_parse+0x37>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_parse>:
lea    -0x31(%rdi),%eax
add    $0xd0,%dil
xor    %ecx,%ecx
cmp    $0x9,%al
movzbl %dil,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @square_parse(i8 signext %0) {
%2 = add i8 %0, -49
%3 = icmp ult i8 %2, 9
%4 = add i8 %0, -48
%5 = select i1 %3, i8 %4, i8 0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
int test_function_call(int p, int q, int r) {
  __emit_expression_range(0, test_function_call(p, q, r));
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @test_function_call(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @test_function_call(i32 %0, i32 %1, i32 %2)
%5 = tail call i32 @__emit_expression_range(i32 0, i32 0)
ret i32 0
}
void SHAREMIND_MAP_KEY_FREE_long(long *const dest) { (void)dest; }


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

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

LLVM IR (-O0):
define void @SHAREMIND_MAP_KEY_FREE_long(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
ret void
}

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_long(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("One arg, -v for verbose\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"One arg, -v for verbose\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"One arg, -v for verbose\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl(uint32_t value, int shift) {
  return (value << shift) | (value >> (32 - shift));
}


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char const **);
void ngf_proplist_free_keys(const char **keys) {
  if (keys == NULL)
    return;
  free(keys);
}


x86 assembly (clang, -O0):
<ngf_proplist_free_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ngf_proplist_free_keys+0x1c>
jmp    1135 <ngf_proplist_free_keys+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ngf_proplist_free_keys>:
test   %rdi,%rdi
je     111a <ngf_proplist_free_keys+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ngf_proplist_free_keys(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp eq i8** %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = call i32 @free(i8** %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @ngf_proplist_free_keys(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8** %0)
br label %5
5: ; preds = %1, %3
ret void
}
int db5500_prcmu_disable_dsipll(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @db5500_prcmu_disable_dsipll() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _exception_divide(void) {
  printf("divide error\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<_exception_divide>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <_exception_divide+0x10>

x86 assembly (clang, -O2):
<_exception_divide>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <_exception_divide+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c"divide error\0A\00"
define void @_exception_divide() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@str = [13 x i8] c"divide error\00"
define void @_exception_divide() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
const char *minimum_size_type(int N) {
  if (N <= 255) {
    return "unsigned char";
  } else if (N < 65535) {
    return "unsigned short int";
  } else {
    return "unsigned int";
  }
}


x86 assembly (clang, -O0):
<minimum_size_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jg     1124 <minimum_size_type+0x24>
lea    0xee5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <minimum_size_type+0x4c>
cmpl   $0xffff,-0xc(%rbp)
jge    1141 <minimum_size_type+0x41>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <minimum_size_type+0x4c>
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum_size_type>:
cmp    $0xffff,%edi
lea    0xf01(%rip),%rax
lea    0xf0d(%rip),%rcx
cmovl  %rax,%rcx
cmp    $0x100,%edi
lea    0xedb(%rip),%rax
cmovge %rcx,%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unsigned char\00"
@.str.1 = [19 x i8] c"unsigned short int\00"
@.str.2 = [13 x i8] c"unsigned int\00"
define i8* @minimum_size_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 65535
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"unsigned char\00"
@.str.1 = [19 x i8] c"unsigned short int\00"
@.str.2 = [13 x i8] c"unsigned int\00"
define i8* @minimum_size_type(i32 %0) {
%2 = icmp slt i32 %0, 256
%3 = icmp slt i32 %0, 65535
%4 = select i1 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cleanup(void *arg) { printf("Cleanup: %s\n", (char *)arg); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Cleanup: %s\0A\00"
define void @cleanup(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_6Euint8_reg(unsigned char val) {
  return ((val) & (-0x6E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Euint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff92,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_6Euint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -110
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ perror(char *);
void *umalloc(size_t l) {
  void *p = malloc(l);
  if (!p) {
    perror("malloc()");
    abort();
  }
  memset(p, 0, l);
  return p;
}


x86 assembly (clang, -O0):
<umalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <umalloc+0x37>
lea    0xe95(%rip),%rdi
call   1060 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
test   %rax,%rax
je     116c <umalloc+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe8d(%rip),%rdi
call   1060 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"malloc()\00"
define i8* @umalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i64, i64* %2
%14 = call i32 @memset(i8* %12, i32 0, i64 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [9 x i8] c"malloc()\00"
define i8* @umalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
short h_abs(short *);
short intr_wrap_100(short p1) { return h_abs(&p1); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
call   1030 <h_abs@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <h_abs@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_100(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call signext i16 @h_abs(i16* %2)
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @intr_wrap_100(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call signext i16 @h_abs(i16* %2)
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ ObjWrite8(unsigned long);
void ObjWrite32(unsigned long V) {
  ObjWrite8(V);
  ObjWrite8(V >> 8);
  ObjWrite8(V >> 16);
  ObjWrite8(V >> 24);
}


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

x86 assembly (clang, -O2):
<ObjWrite32>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ObjWrite8@plt>
mov    %rbx,%rdi
shr    $0x8,%rdi
call   1030 <ObjWrite8@plt>
mov    %rbx,%rdi
shr    $0x10,%rdi
call   1030 <ObjWrite8@plt>
shr    $0x18,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ObjWrite8@plt>

LLVM IR (-O0):
define void @ObjWrite32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @ObjWrite8(i64 %3)
%5 = load i64, i64* %2
%6 = lshr i64 %5, 8
%7 = call i32 @ObjWrite8(i64 %6)
%8 = load i64, i64* %2
%9 = lshr i64 %8, 16
%10 = call i32 @ObjWrite8(i64 %9)
%11 = load i64, i64* %2
%12 = lshr i64 %11, 24
%13 = call i32 @ObjWrite8(i64 %12)
ret void
}

LLVM IR (-O2):
define void @ObjWrite32(i64 %0) {
%2 = tail call i32 @ObjWrite8(i64 %0)
%3 = lshr i64 %0, 8
%4 = tail call i32 @ObjWrite8(i64 %3)
%5 = lshr i64 %0, 16
%6 = tail call i32 @ObjWrite8(i64 %5)
%7 = lshr i64 %0, 24
%8 = tail call i32 @ObjWrite8(i64 %7)
ret void
}
/* Type definitions */
struct nlmsghdr {
  int dummy;
};

/* Variables and functions */
int NLMSG_ALIGN(int);
int nlmsg_len(struct nlmsghdr const *);
int nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen) {
  return nlmsg_len(nlh) - NLMSG_ALIGN(hdrlen);
}


x86 assembly (clang, -O0):
<nlmsg_attrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nlmsg_len@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <NLMSG_ALIGN@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlmsg_attrlen>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <nlmsg_len@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <NLMSG_ALIGN@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
define i32 @nlmsg_attrlen(%struct.nlmsghdr* %0, i32 %1) {
%3 = alloca %struct.nlmsghdr*
%4 = alloca i32
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %3
store i32 %1, i32* %4
%5 = load %struct.nlmsghdr*, %struct.nlmsghdr** %3
%6 = call i32 @nlmsg_len(%struct.nlmsghdr* %5)
%7 = load i32, i32* %4
%8 = call i32 @NLMSG_ALIGN(i32 %7)
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
define i32 @nlmsg_attrlen(%struct.nlmsghdr* %0, i32 %1) {
%3 = tail call i32 @nlmsg_len(%struct.nlmsghdr* %0)
%4 = tail call i32 @NLMSG_ALIGN(i32 %1)
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int bitcount(int word) {
  assert(4 <= 4);
  word = ((word & 0xA) >> 1) + (word & 0x5);
  word = ((word & 0xC) >> 2) + (word & 0x3);
  return word;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
and    $0xa,%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x5,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xc,%eax
sar    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
shr    %eax
and    $0x5,%eax
and    $0x5,%ebx
add    %eax,%ebx
mov    %ebx,%eax
shr    $0x2,%eax
and    $0x3,%ebx
add    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bitcount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @assert(i32 1)
%4 = load i32, i32* %2
%5 = and i32 %4, 10
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = and i32 %7, 5
%9 = add nsw i32 %6, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, 12
%12 = ashr i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, 3
%15 = add nsw i32 %12, %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = tail call i32 @assert(i32 1)
%3 = lshr i32 %0, 1
%4 = and i32 %3, 5
%5 = and i32 %0, 5
%6 = add nuw nsw i32 %4, %5
%7 = lshr i32 %6, 2
%8 = and i32 %6, 3
%9 = add nuw nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ print_pointer(char const *);
void print_string2(const char *s) { print_pointer(s); }


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

x86 assembly (clang, -O2):
<print_string2>:
jmp    1030 <print_pointer@plt>

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

LLVM IR (-O2):
define void @print_string2(i8* %0) {
%2 = tail call i32 @print_pointer(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz();
int foo(int, int);
void bar(int x, int y) {
  y = foo(x, y);
  if (y != 0)
    baz();
}


x86 assembly (clang, -O0):
<bar>:
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   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114d <bar+0x2d>
mov    $0x0,%al
call   1030 <baz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
call   1040 <foo@plt>
test   %eax,%eax
je     1132 <bar+0x12>
xor    %eax,%eax
pop    %rcx
jmp    1030 <baz@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @bar(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 @foo(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @baz()
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0, i32 %1) {
%3 = tail call i32 @foo(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @baz()
br label %7
7: ; preds = %5, %2
ret void
}
void free_2D_array(double **matrix, unsigned n1) {
  unsigned i;
  for (i = 0; i < n1; i++)
    free(matrix[i]);
  free(matrix);
}


x86 assembly (clang, -O0):
<free_2D_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <free_2D_array+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_2D_array+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2D_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <free_2D_array+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2D_array+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_2D_array(double** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
unsigned char getUC() { return 0x80; }


x86 assembly (clang, -O0):
<getUC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUC>:
mov    $0x80,%al
ret

LLVM IR (-O0):
define zeroext i8 @getUC() {
ret i8 -128
}

LLVM IR (-O2):
define zeroext i8 @getUC() {
ret i8 -128
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void ADCIntDisable(uint32_t ui32Base, uint32_t ui32SequenceNum) {
  ASSERT((ui32Base == 0x40038000) || (ui32Base == 0x40039000));
  ASSERT(ui32SequenceNum < 4);
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) &= ~(1 << ui32SequenceNum);
}


x86 assembly (clang, -O0):
<ADCIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40038000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113d <ADCIntDisable+0x2d>
cmpl   $0x40039000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x4,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntDisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40038000,%eax
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%ebx
setl   %dil
call   1030 <ASSERT@plt>
mov    $0xfffffffe,%eax
mov    %ebx,%ecx
rol    %cl,%eax
movslq %ebp,%rcx
and    %eax,0x8(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ADCIntDisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1073971200
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073975296
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 4
%16 = zext i1 %15 to i32
%17 = call i32 @ASSERT(i32 %16)
%18 = load i32, i32* %4
%19 = shl i32 1, %18
%20 = xor i32 %19, -1
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 8
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = load volatile i32, i32* %24
%26 = and i32 %25, %20
store volatile i32 %26, i32* %24
ret void
}

LLVM IR (-O2):
define void @ADCIntDisable(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073971200
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp slt i32 %1, 4
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = shl nuw i32 1, %1
%11 = xor i32 %10, -1
%12 = add nsw i32 %0, 8
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = and i32 %15, %11
store volatile i32 %16, i32* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ factor();
int /*<<< orphan*/ termp();
void term() {
  factor();
  termp();
}


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

x86 assembly (clang, -O2):
<term>:
push   %rax
xor    %eax,%eax
call   1040 <factor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <termp@plt>

LLVM IR (-O0):
define void @term() {
%1 = call i32 (...) @factor()
%2 = call i32 (...) @termp()
ret void
}

LLVM IR (-O2):
define void @term() {
%1 = tail call i32 (...) @factor()
%2 = tail call i32 (...) @termp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage:\nnandlogical <mtd char device> READ|WRITE <start> "
                  "<length> <file>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [73 x i8] c"Usage:\0Anandlogical <mtd char device> READ|WRITE <start> <length> <file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [73 x i8] c"Usage:\0Anandlogical <mtd char device> READ|WRITE <start> <length> <file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int muspcm_pause(int slot) { return (-1); }


x86 assembly (clang, -O0):
<muspcm_pause>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @muspcm_pause(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ coco_error(char *, int const);
const char *suite_biobj_get_instances_by_year(const int year) {
  if (year == 2016) {
    return "1-10";
  } else {
    coco_error("suite_biobj_get_instances_by_year(): year %d not defined for "
               "suite_biobj",
               year);
    return 0;
  }
}


x86 assembly (clang, -O0):
<suite_biobj_get_instances_by_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x7e0,-0xc(%rbp)
jne    1138 <suite_biobj_get_instances_by_year+0x28>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <suite_biobj_get_instances_by_year+0x3f>
mov    -0xc(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <coco_error@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suite_biobj_get_instances_by_year>:
cmp    $0x7e0,%edi
jne    1120 <suite_biobj_get_instances_by_year+0x10>
lea    0xee1(%rip),%rax
ret
push   %rax
mov    %edi,%esi
lea    0xedb(%rip),%rdi
call   1030 <coco_error@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"1-10\00"
@.str.1 = [73 x i8] c"suite_biobj_get_instances_by_year(): year %d not defined for suite_biobj\00"
define i8* @suite_biobj_get_instances_by_year(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 2016
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @coco_error(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i8* null, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"1-10\00"
@.str.1 = [73 x i8] c"suite_biobj_get_instances_by_year(): year %d not defined for suite_biobj\00"
define i8* @suite_biobj_get_instances_by_year(i32 %0) {
%2 = icmp eq i32 %0, 2016
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @coco_error(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ null, %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/);
pid_t getsid(pid_t pid) { return syscall(147, pid); }


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

x86 assembly (clang, -O2):
<getsid>:
mov    %edi,%esi
mov    $0x93,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @getsid(i32 %0) {
%2 = tail call i32 @syscall(i32 147, i32 %0)
ret i32 %2
}
/* Variables and functions */
char *findenv(char const *, int *);
char *getenv(const char *name) {
  int offset;
  return (findenv(name, &offset));
}


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

x86 assembly (clang, -O2):
<getenv>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <findenv@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @getenv(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i8* @findenv(i8* %0, i32* %2)
ret i8* %4
}
__attribute__((always_)) void pgtable_cache_init(void) {}


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

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

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

LLVM IR (-O2):
define void @pgtable_cache_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Program started\n");
  printf("main2\n");
  printf("Program exited\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"Program started\0A\00"
@.str.1 = [7 x i8] c"main2\0A\00"
@.str.2 = [16 x i8] c"Program exited\0A\00"
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 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Program started\00"
@str.3 = [6 x i8] c"main2\00"
@str.4 = [15 x i8] c"Program exited\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SSLeay_add_all_algorithms();
void libcrypto_init(void) { SSLeay_add_all_algorithms(); }


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

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

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

LLVM IR (-O2):
define void @libcrypto_init() {
%1 = tail call i32 (...) @SSLeay_add_all_algorithms()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void abort(void) { _exit(255); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O0):
define void @abort() {
%1 = call i32 @_exit(i32 255)
unreachable
}

LLVM IR (-O2):
define void @abort() {
%1 = tail call i32 @_exit(i32 255)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void version(void) {
  fprintf(stderr, "ewfinfo version: %s\n", "20060505-1");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xeda(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xedd(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"ewfinfo version: %s\0A\00"
@.str.1 = [11 x i8] c"20060505-1\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"ewfinfo version: %s\0A\00"
@.str.1 = [11 x i8] c"20060505-1\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int GCD(int a, int b) {
  int c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  };
  return b;
}


x86 assembly (clang, -O0):
<GCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <GCD+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <GCD+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCD>:
mov    %esi,%eax
test   %edi,%edi
je     111d <GCD+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %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* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = srem i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %5
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @GCD(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
ret i32 %10
}
int hash(const char name[]) {
  register int h;
  register const char *cp;
  for (cp = name, h = 0; *cp; h = (h << 2) + *cp++)
    ;
  return ((h & 0x7fffffff) % 97);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <hash+0x4b>
jmp    1129 <hash+0x29>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <hash+0x17>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
mov    $0x61,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1142 <hash+0x42>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,4),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0x7fffffff,%eax
imul   $0x51d07eaf,%rax,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x61,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = shl i32 %7, 2
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = sext i8 %5 to i32
%11 = add nsw i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
%16 = urem i32 %15, 97
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 0, %1 ], [ %16, %14 ]
ret i32 %18
}
/* Type definitions */
struct record_header {
  int dummy;
};
struct file_header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_dbppc_restart(char *, char *, int, char,
                                       struct file_header *);
void print_ppc_restart(int *tab, int action, char *cur_date, char *cur_time,
                       int utc, struct file_header *file_hdr,
                       struct record_header *record_hdr) {
  if (action == 0x02) {
    print_dbppc_restart(cur_date, cur_time, utc, '\t', file_hdr);
  }
}


x86 assembly (clang, -O0):
<print_ppc_restart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1156 <print_ppc_restart+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%r8
mov    $0x9,%ecx
call   1030 <print_dbppc_restart@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ppc_restart>:
cmp    $0x2,%esi
jne    112b <print_ppc_restart+0x1b>
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
mov    $0x9,%ecx
mov    %r9,%r8
jmp    1030 <print_dbppc_restart@plt>
ret

LLVM IR (-O0):
%struct.file_header = type { i32 }
%struct.record_header = type { i32 }
define void @print_ppc_restart(i32* %0, i32 %1, i8* %2, i8* %3, i32 %4, %struct.file_header* %5, %struct.record_header* %6) {
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca %struct.file_header*
%14 = alloca %struct.record_header*
store i32* %0, i32** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store %struct.file_header* %5, %struct.file_header** %13
store %struct.record_header* %6, %struct.record_header** %14
%15 = load i32, i32* %9
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %23
17: ; preds = %7
%18 = load i8*, i8** %10
%19 = load i8*, i8** %11
%20 = load i32, i32* %12
%21 = load %struct.file_header*, %struct.file_header** %13
%22 = call i32 @print_dbppc_restart(i8* %18, i8* %19, i32 %20, i8 signext 9, %struct.file_header* %21)
br label %23
23: ; preds = %17, %7
ret void
}

LLVM IR (-O2):
%struct.file_header = type { i32 }
%struct.record_header = type { i32 }
define void @print_ppc_restart(i32* nocapture readnone %0, i32 %1, i8* %2, i8* %3, i32 %4, %struct.file_header* %5, %struct.record_header* nocapture readnone %6) {
%8 = icmp eq i32 %1, 2
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @print_dbppc_restart(i8* %2, i8* %3, i32 %4, i8 signext 9, %struct.file_header* %5)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
void appaserver_output_error_message(char *, char *, char *);
void output_error_message(char *message, char *login_name) {
  return appaserver_output_error_message((char *)0, message, login_name);
}


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

x86 assembly (clang, -O2):
<output_error_message>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <appaserver_output_error_message@plt>

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

LLVM IR (-O2):
define void @output_error_message(i8* %0, i8* %1) {
tail call void @appaserver_output_error_message(i8* null, i8* %0, i8* %1)
ret void
}