xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *read_defect_data_12_data(uint8_t *data) { return data + 8; }


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

x86 assembly (clang, -O2):
<read_defect_data_12_data>:
lea    0x20(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @read_defect_data_12_data(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
ret i32* %4
}

LLVM IR (-O2):
define i32* @read_defect_data_12_data(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
ret i32* %2
}
int foo(int a) {
  int b = a != 0;
  unsigned char c = b;
  if (c)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
cmpb   $0x0,-0xd(%rbp)
je     1132 <foo+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <foo+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int descending(int a, int b) { return b > a; }


x86 assembly (clang, -O0):
<descending>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<descending>:
xor    %eax,%eax
cmp    %edi,%esi
setg   %al
ret

LLVM IR (-O0):
define i32 @descending(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @descending(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int f292(int *);
int f293(int *p) { return f292(p); }


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

x86 assembly (clang, -O2):
<f293>:
jmp    1030 <f292@plt>

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

LLVM IR (-O2):
define i32 @f293(i32* %0) {
%2 = tail call i32 @f292(i32* %0)
ret i32 %2
}
int do_124() { return 124; }


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

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

LLVM IR (-O0):
define i32 @do_124() {
ret i32 124
}

LLVM IR (-O2):
define i32 @do_124() {
ret i32 124
}
int test_imm_00uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x00 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_00uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 0
%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_00uint64_midword_reg(i64 %0) {
ret i32 -40
}
__attribute__((no_sanitize("implicit-integer-sign-change"))) signed char
unsigned_int_to_signed_char__no_sign_change_sanitizer(unsigned int src) {
  return src;
}


x86 assembly (clang, -O0):
<unsigned_int_to_signed_char__no_sign_change_sanitizer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @unsigned_int_to_signed_char__no_sign_change_sanitizer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @unsigned_int_to_signed_char__no_sign_change_sanitizer(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_racket_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("racket", " ;comment"),
                            "comment", ";comment");
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"racket\00"
@.str.1 = [10 x i8] c" ;comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c";comment\00"
define void @test_racket_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void production_memory_test(void) {}


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

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

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

LLVM IR (-O2):
define void @production_memory_test() {
ret void
}
void ARGBToUVJRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToUVJRow_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void POP_DS() {
  ;
  _c_setbyte(0x1f);
  ;
}


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

x86 assembly (clang, -O2):
<POP_DS>:
mov    $0x1f,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @POP_DS() {
%1 = call i32 @_c_setbyte(i32 31)
ret void
}

LLVM IR (-O2):
define void @POP_DS() {
%1 = tail call i32 @_c_setbyte(i32 31)
ret void
}
int test_imm_16uint16_mem(unsigned short *val) {
  return ((*val) & (0x16 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_16uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x16,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_16uint16_mem>:
testb  $0x16,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_16uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 22
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ key;

/* Variables and functions */
scalar_t__ ini_getint(int *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int ini_getint_default(int *value, char *param) {
  char key[256];
  snprintf(key, (sizeof(key)), "%s:%s", "default", param);
  if (ini_getint(value, key))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ini_getint_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%r8
mov    $0x100,%esi
lea    0xeb6(%rip),%rdx
lea    0xeb5(%rip),%rcx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1040 <ini_getint@plt>
cmp    $0x0,%rax
je     117c <ini_getint_default+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <ini_getint_default+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_getint_default>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%r8
mov    %rdi,%rbx
lea    0xec9(%rip),%rdx
lea    0xec8(%rip),%rcx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ini_getint@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s:%s\00"
@.str.1 = [8 x i8] c"default\00"
define i32 @ini_getint_default(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca [256 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %5
%9 = call i32 @snprintf(i8* %7, i32 256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32*, i32** %4
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = call i64 @ini_getint(i32* %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s:%s\00"
@.str.1 = [8 x i8] c"default\00"
define i32 @ini_getint_default(i32* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%6 = call i64 @ini_getint(i32* %0, i8* %4)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int do_it();
int skip_it();
int /*<<< orphan*/ valid(int);
int tex(void) {
  register int fieldnum;
  for (fieldnum = 0; fieldnum <= 4; ++fieldnum)
    if (!valid(fieldnum))
      return (skip_it());
  return (do_it());
}


x86 assembly (clang, -O0):
<tex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jg     117c <tex+0x4c>
mov    -0x8(%rbp),%edi
call   1030 <valid@plt>
cmp    $0x0,%eax
jne    1169 <tex+0x39>
mov    $0x0,%al
call   1050 <skip_it@plt>
mov    %eax,-0x4(%rbp)
jmp    1186 <tex+0x56>
jmp    116e <tex+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <tex+0xf>
mov    $0x0,%al
call   1040 <do_it@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tex>:
push   %rax
xor    %edi,%edi
call   1030 <valid@plt>
test   %eax,%eax
je     117c <tex+0x4c>
mov    $0x1,%edi
call   1030 <valid@plt>
test   %eax,%eax
je     117c <tex+0x4c>
mov    $0x2,%edi
call   1030 <valid@plt>
test   %eax,%eax
je     117c <tex+0x4c>
mov    $0x3,%edi
call   1030 <valid@plt>
test   %eax,%eax
je     117c <tex+0x4c>
mov    $0x4,%edi
call   1030 <valid@plt>
test   %eax,%eax
je     117c <tex+0x4c>
xor    %eax,%eax
pop    %rcx
jmp    1040 <do_it@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <skip_it@plt>

LLVM IR (-O0):
define i32 @tex() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 4
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @valid(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = call i32 (...) @skip_it()
store i32 %11, i32* %1
br label %18
12: ; preds = %6
br label %13
13: ; preds = %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
%17 = call i32 (...) @do_it()
store i32 %17, i32* %1
br label %18
18: ; preds = %16, %10
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @tex() {
%1 = tail call i32 @valid(i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %17, label %3
3: ; preds = %0
%4 = tail call i32 @valid(i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3
%7 = tail call i32 @valid(i32 2)
%8 = icmp eq i32 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6
%10 = tail call i32 @valid(i32 3)
%11 = icmp eq i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = tail call i32 @valid(i32 4)
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 (...) @do_it()
br label %19
17: ; preds = %12, %9, %6, %3, %0
%18 = tail call i32 (...) @skip_it()
br label %19
19: ; preds = %15, %17
%20 = phi i32 [ %18, %17 ], [ %16, %15 ]
ret i32 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ _random_8_func(int /*<<< orphan*/, int /*<<< orphan*/);
int8_t AMCRandom8(int8_t min, int8_t max) { return _random_8_func(min, max); }


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

x86 assembly (clang, -O2):
<AMCRandom8>:
jmp    1030 <_random_8_func@plt>

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

LLVM IR (-O2):
define i32 @AMCRandom8(i32 %0, i32 %1) {
%3 = tail call i32 @_random_8_func(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *malloc(size_t const);
void cacheflush(void) {
  const size_t size = 20 * 1024 * 1024;
  int i, j;
  char *c = malloc(size);
  for (i = 0; i < 5; i++)
    for (j = 0; j < size; j++)
      c[j] = i * j;
}


x86 assembly (clang, -O0):
<cacheflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x1400000,-0x8(%rbp)
01
mov    $0x1400000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    118b <cacheflush+0x7b>
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
cmp    $0x1400000,%rax
jae    1178 <cacheflush+0x68>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <cacheflush+0x36>
jmp    117d <cacheflush+0x6d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <cacheflush+0x25>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cacheflush() {
ret void
}
/* Variables and functions */
int __builtin_mips_cabs_seq_s(float, float);
int test10(float a, float b) { return __builtin_mips_cabs_seq_s(a, b); }


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_seq_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
jmp    1030 <__builtin_mips_cabs_seq_s@plt>

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

LLVM IR (-O2):
define i32 @test10(float %0, float %1) {
%3 = tail call i32 @__builtin_mips_cabs_seq_s(float %0, float %1)
ret i32 %3
}
/* Variables and functions */
void Default_RTC1_IRQHandler(void) {
  while (1)
    ;
}


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

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

LLVM IR (-O0):
define void @Default_RTC1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_RTC1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t get_capabilities(int palette) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_capabilities(i32 %0) {
ret i32 0
}
int devtmpfs_create_node(struct device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @devtmpfs_create_node(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @devtmpfs_create_node(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main(int argc, char **argv) {
  FILE *fp;
  if (argc != 2)
    return 1;
  fp = fopen(argv[1], "a+");
  if (fp) {
    fclose(fp);
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    118b <main+0x6b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1184 <main+0x64>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    118b <main+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x2,%edi
jne    114a <main+0x2a>
mov    0x8(%rsi),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     114a <main+0x2a>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"a+\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 @fclose(i32* %7)
br label %11
11: ; preds = %4, %2, %9
%12 = phi i32 [ 0, %9 ], [ 1, %2 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
double randn();
double randn_f(double v) { return randn(); }


x86 assembly (clang, -O0):
<randn_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <randn@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @randn_f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @randn()
ret double %3
}

LLVM IR (-O2):
define double @randn_f(double %0) {
%2 = tail call double (...) @randn()
ret double %2
}
int IAec_GetOnceRunMinCharLen() { return ((256 * 2) * 2); }


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

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

LLVM IR (-O0):
define i32 @IAec_GetOnceRunMinCharLen() {
ret i32 1024
}

LLVM IR (-O2):
define i32 @IAec_GetOnceRunMinCharLen() {
ret i32 1024
}
void function(a, b) {}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @function(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @function(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C_bad_min_argc_2(int, int, long);
void C_bad_min_argc(int c, int n) {
  C_bad_min_argc_2(c, n, ((long)(0x00000006 | 0x00000000)));
}


x86 assembly (clang, -O0):
<C_bad_min_argc>:
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    $0x6,%edx
call   1030 <C_bad_min_argc_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_bad_min_argc>:
mov    $0x6,%edx
jmp    1030 <C_bad_min_argc_2@plt>

LLVM IR (-O0):
define void @C_bad_min_argc(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 @C_bad_min_argc_2(i32 %5, i32 %6, i64 6)
ret void
}

LLVM IR (-O2):
define void @C_bad_min_argc(i32 %0, i32 %1) {
%3 = tail call i32 @C_bad_min_argc_2(i32 %0, i32 %1, i64 6)
ret void
}
char cast_uchar_char_fast(unsigned char x) { return (char)x; }


x86 assembly (clang, -O0):
<cast_uchar_char_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @cast_uchar_char_fast(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @cast_uchar_char_fast(i8 returned zeroext %0) {
ret i8 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
void volatile_fetch_and_u32(uint32_t *dest, uint32_t val) {
  *((volatile uint32_t *)dest) &= val;
}


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

x86 assembly (clang, -O2):
<volatile_fetch_and_u32>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_fetch_and_u32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load volatile i32, i32* %4
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
%8 = and i32 %7, %5
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @volatile_fetch_and_u32(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = load volatile i32, i32* %0
%6 = and i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int remove(const char *path) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @remove(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @remove(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printResults(int (*someFunction)(int, int), int arg0, int arg1) {
  printf("The return value of the function is %i.\n", someFunction(arg0, arg1));
}


x86 assembly (clang, -O0):
<printResults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResults>:
push   %rax
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
call   *%rax
lea    0xedf(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"The return value of the function is %i.\0A\00"
define void @printResults(i32 (i32, i32)* %0, i32 %1, i32 %2) {
%4 = alloca i32 (i32, i32)*
%5 = alloca i32
%6 = alloca i32
store i32 (i32, i32)* %0, i32 (i32, i32)** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32 (i32, i32)*, i32 (i32, i32)** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 %7(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"The return value of the function is %i.\0A\00"
define void @printResults(i32 (i32, i32)* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 %0(i32 %1, i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stderr;
char *check_next(char flag, char *next) {
  if (!next) {
    fprintf(stderr, "-%c requires another argument\n", flag);
    exit(1);
  }
  return next;
}


x86 assembly (clang, -O0):
<check_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <check_next+0x40>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_next>:
test   %rsi,%rsi
je     1129 <check_next+0x9>
mov    %rsi,%rax
ret
push   %rax
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
movsbl %dil,%edx
lea    0xec2(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"-%c requires another argument\0A\00"
define i8* @check_next(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8, i8* %3
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"-%c requires another argument\0A\00"
define i8* @check_next(i8 signext %0, i8* readnone returned %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %1
}
int do_039() { return 39; }


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

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

LLVM IR (-O0):
define i32 @do_039() {
ret i32 39
}

LLVM IR (-O2):
define i32 @do_039() {
ret i32 39
}
/* Variables and functions */
int /*<<< orphan*/ native_to_little_endian(void *, char *);
void WavpackNativeToLittleEndian(void *data, char *format) {
  native_to_little_endian(data, format);
}


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

x86 assembly (clang, -O2):
<WavpackNativeToLittleEndian>:
jmp    1030 <native_to_little_endian@plt>

LLVM IR (-O0):
define void @WavpackNativeToLittleEndian(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
%7 = call i32 @native_to_little_endian(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @WavpackNativeToLittleEndian(i8* %0, i8* %1) {
%3 = tail call i32 @native_to_little_endian(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test2(int);
int test(int a) {
  int i;
  for (i = 0; i < a; i++) {
    test2(a);
    test2(a);
  }
}


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

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1133 <test+0x23>
mov    %edi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <test2@plt>
mov    %ebx,%edi
call   1030 <test2@plt>
add    $0xffffffff,%ebp
jne    1120 <test+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 @test2(i32 %0)
%6 = tail call i32 @test2(i32 %0)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  long long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
uint64_t time_between(struct timeval previous, struct timeval current) {
  return (current.tv_sec - previous.tv_sec) * 1000000LL +
         (current.tv_usec - previous.tv_usec);
}


x86 assembly (clang, -O0):
<time_between>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x10(%rbp),%rax
imul   $0xf4240,%rax,%rax
mov    -0x18(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_between>:
sub    %rdi,%rdx
imul   $0xf4240,%rdx,%rax
sub    %rsi,%rcx
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @time_between(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %5 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timeval* %6 to { i64, i64 }*
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 0
store i64 %2, i64* %11
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%16 = load i64, i64* %15
%17 = sub nsw i64 %14, %16
%18 = mul nsw i64 %17, 1000000
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%22 = load i64, i64* %21
%23 = sub nsw i64 %20, %22
%24 = add nsw i64 %18, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @time_between(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %2, %0
%6 = mul nsw i64 %5, 1000000
%7 = sub i64 %3, %1
%8 = add nsw i64 %7, %6
ret i64 %8
}
/* Variables and functions */
float cosf(float);
float sinf(float);
float *mat2_rotation(float *result, float angle) {
  float c = cosf(angle);
  float s = sinf(angle);
  result[0] = c;
  result[1] = s;
  result[2] = -s;
  result[3] = c;
  return result;
}


x86 assembly (clang, -O0):
<mat2_rotation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat2_rotation>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
call   1040 <cosf@plt>
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
call   1030 <sinf@plt>
movss  0xc(%rsp),%xmm1
movss  %xmm1,(%rbx)
movss  %xmm0,0x4(%rbx)
xorps  0xea6(%rip),%xmm0
movss  %xmm0,0x8(%rbx)
movss  %xmm1,0xc(%rbx)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float* @mat2_rotation(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float* %0, float** %3
store float %1, float* %4
%7 = load float, float* %4
%8 = call float @cosf(float %7)
store float %8, float* %5
%9 = load float, float* %4
%10 = call float @sinf(float %9)
store float %10, float* %6
%11 = load float, float* %5
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float, float* %6
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float, float* %6
%18 = fneg float %17
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
%21 = load float, float* %5
%22 = load float*, float** %3
%23 = getelementptr inbounds float, float* %22, i64 3
store float %21, float* %23
%24 = load float*, float** %3
ret float* %24
}

LLVM IR (-O2):
define float* @mat2_rotation(float* returned writeonly %0, float %1) {
%3 = tail call float @cosf(float %1)
%4 = tail call float @sinf(float %1)
store float %3, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
store float %4, float* %5
%6 = fneg float %4
%7 = getelementptr inbounds float, float* %0, i64 2
store float %6, float* %7
%8 = getelementptr inbounds float, float* %0, i64 3
store float %3, float* %8
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ perm(int *, int /*<<< orphan*/, int);
void main() {
  int list[] = {3, 4, 5, 6, 7};
  perm(list, 0, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <perm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <perm@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.list = [5 x i32] [i32 3, i32 4, i32 5, i32 6, i32 7]
define void @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @perm(i32* %3, i32 0, i32 5)
ret void
}

LLVM IR (-O2):
@__const.main.list = [5 x i32] [i32 3, i32 4, i32 5, i32 6, i32 7]
define void @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @perm(i32* %3, i32 0, i32 5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __pformat(int, int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
              int /*<<< orphan*/);
int /*<<< orphan*/ _lock_file(int /*<<< orphan*/ *);
int /*<<< orphan*/ _unlock_file(int /*<<< orphan*/ *);
int __attribute__((__cdecl__))
__vfprintf(FILE *stream, const char *fmt, va_list argv) {
  register int retval;
  _lock_file(stream);
  retval = __pformat(0x2000 | 0x4000, stream, 0, fmt, argv);
  _unlock_file(stream);
  return retval;
}


x86 assembly (clang, -O0):
<__vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <_lock_file@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x6000,%edi
xor    %edx,%edx
call   1030 <__pformat@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_unlock_file@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__vfprintf>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1050 <_lock_file@plt>
mov    $0x6000,%edi
mov    %rbp,%rsi
xor    %edx,%edx
mov    %rbx,%rcx
mov    %r14d,%r8d
call   1030 <__pformat@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1040 <_unlock_file@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = call i32 @_lock_file(i32* %8)
%10 = load i32*, i32** %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @__pformat(i32 24576, i32* %10, i32 0, i8* %11, i32 %12)
store i32 %13, i32* %7
%14 = load i32*, i32** %4
%15 = call i32 @_unlock_file(i32* %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @__vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_lock_file(i32* %0)
%5 = tail call i32 @__pformat(i32 24576, i32* %0, i32 0, i8* %1, i32 %2)
%6 = tail call i32 @_unlock_file(i32* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ packet_crc_process(unsigned short *, int /*<<< orphan*/);
void packet_crc_block(unsigned short *context, const unsigned char *blk,
                      int len) {
  while (len-- > 0)
    packet_crc_process(context, *blk++);
}


x86 assembly (clang, -O0):
<packet_crc_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    1157 <packet_crc_block+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%esi
call   1030 <packet_crc_process@plt>
jmp    1123 <packet_crc_block+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packet_crc_block>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1147 <packet_crc_block+0x37>
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%esi
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <packet_crc_process@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <packet_crc_block+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @packet_crc_block(i16* %0, i8* %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i8*
%6 = alloca i32
store i16* %0, i16** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %6
%9 = add nsw i32 %8, -1
store i32 %9, i32* %6
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load i16*, i16** %4
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
%15 = load i8, i8* %13
%16 = zext i8 %15 to i32
%17 = call i32 @packet_crc_process(i16* %12, i32 %16)
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @packet_crc_block(i16* %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %2, %3 ]
%7 = phi i8* [ %9, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, -1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = zext i8 %10 to i32
%12 = tail call i32 @packet_crc_process(i16* %0, i32 %11)
%13 = icmp ugt i32 %6, 1
br i1 %13, label %5, label %14
14: ; preds = %5, %3
ret void
}
/* Variables and functions */
size_t pcomp_rle_bufsize(size_t input_size) { return 2 * input_size; }


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

x86 assembly (clang, -O2):
<pcomp_rle_bufsize>:
lea    (%rdi,%rdi,1),%rax
ret

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

LLVM IR (-O2):
define i64 @pcomp_rle_bufsize(i64 %0) {
%2 = shl i64 %0, 1
ret i64 %2
}
int is_little_endian(void) {
  unsigned short n = 1;
  return *((unsigned char *)&n) != 0;
}


x86 assembly (clang, -O0):
<is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movw   $0x1,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_little_endian() {
%1 = alloca i16
store i16 1, i16* %1
%2 = bitcast i16* %1 to i8*
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_little_endian() {
ret i32 1
}
int dmp_tm_show_error(int value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dmp_tm_show_error(i32 %0) {
ret i32 0
}
void clear_pageblock_skip(struct page *page) {}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define void @clear_pageblock_skip(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @clear_pageblock_skip(%struct.page* nocapture %0) {
ret void
}
/* Variables and functions */
int PERDummyInit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PERDummyInit() {
ret i32 0
}