xunge/DecIR huggingface dataset:
int main(void) { return (10 == 10) + (20 == 20) + (20 == 10); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ checkOptions();
int /*<<< orphan*/ parseCommandLine(int, char **);
void interpretCommandLine(int argc, char **argv) {
  parseCommandLine(argc, argv);
  checkOptions();
}


x86 assembly (clang, -O0):
<interpretCommandLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parseCommandLine@plt>
mov    $0x0,%al
call   1040 <checkOptions@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @interpretCommandLine(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @parseCommandLine(i32 %5, i8** %6)
%8 = call i32 (...) @checkOptions()
ret void
}

LLVM IR (-O2):
define void @interpretCommandLine(i32 %0, i8** %1) {
%3 = tail call i32 @parseCommandLine(i32 %0, i8** %1)
%4 = tail call i32 (...) @checkOptions()
ret void
}
float Double_to_MINUS_float(double x) { return (float)x; }


x86 assembly (clang, -O0):
<Double_to_MINUS_float>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double_to_MINUS_float>:
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @Double_to_MINUS_float(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
ret float %4
}

LLVM IR (-O2):
define float @Double_to_MINUS_float(double %0) {
%2 = fptrunc double %0 to float
ret float %2
}
void marker(int anarg) {
  asm("    .global "
      "set_point"
      "\n"
      "set_point"
      ":\n"
      "    call "
      "func"
      "\n");
  ++anarg;
  asm("    .global "
      "four_byter"
      "\n"
      "four_byter"
      ":\n");
}


x86 assembly (clang, -O0):
<marker>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)

x86 assembly (clang, -O2):
<marker>:
call   1030 <func@plt>

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

LLVM IR (-O2):
define void @marker(i32 %0) {
tail call void asm sideeffect " .global set_point\0Aset_point:\0A call func\0A", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " .global four_byter\0Afour_byter:\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t CondSwapFromBus32(uint32_t d) { return d; }


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

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

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

LLVM IR (-O2):
define i32 @CondSwapFromBus32(i32 returned %0) {
ret i32 %0
}
void clear_args(struct gengetopt_args_info *args_info) { (void)(args_info); }


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

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

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

LLVM IR (-O2):
%struct.gengetopt_args_info = type opaque
define void @clear_args(%struct.gengetopt_args_info* nocapture %0) {
ret void
}
/* Type definitions */
struct generator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ w(struct generator *, char *);
void wsetlab_end(struct generator *g) { w(g, "~-~M} while (false);~N"); }


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

x86 assembly (clang, -O2):
<wsetlab_end>:
lea    0xee9(%rip),%rsi
jmp    1030 <w@plt>

LLVM IR (-O0):
%struct.generator = type { i32 }
@.str = [23 x i8] c"~-~M} while (false);~N\00"
define void @wsetlab_end(%struct.generator* %0) {
%2 = alloca %struct.generator*
store %struct.generator* %0, %struct.generator** %2
%3 = load %struct.generator*, %struct.generator** %2
%4 = call i32 @w(%struct.generator* %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.generator = type { i32 }
@.str = [23 x i8] c"~-~M} while (false);~N\00"
define void @wsetlab_end(%struct.generator* %0) {
%2 = tail call i32 @w(%struct.generator* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int /*<<< orphan*/ error(char *);
int fstat(int, struct stat *);
size_t get_fsize(int fd) {
  struct stat s;
  int ret;
  ret = fstat(fd, &s);
  if (ret == -1)
    error("fstat barfed");
  return s.st_size;
}


x86 assembly (clang, -O0):
<get_fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1150 <get_fsize+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fsize>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    113a <get_fsize+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <error@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [13 x i8] c"fstat barfed\00"
define i64 @get_fsize(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i64, i64* %9
ret i64 %10
}
int foo(int a) {
  if (a) {
    return 3;
  }
  return 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <foo+0x1d>
movl   $0x3,-0x4(%rbp)
jmp    1124 <foo+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 3
ret i32 %3
}
int GetAnswer() { return 42; }


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

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

LLVM IR (-O0):
define i32 @GetAnswer() {
ret i32 42
}

LLVM IR (-O2):
define i32 @GetAnswer() {
ret i32 42
}
int test_imm_8Auint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x8A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Auint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 138
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct RNAinverse_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
RNAinverse_cmdline_parser_release(struct RNAinverse_args_info *);
void RNAinverse_cmdline_parser_free(struct RNAinverse_args_info *args_info) {
  RNAinverse_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<RNAinverse_cmdline_parser_free>:
jmp    1030 <RNAinverse_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.RNAinverse_args_info = type { i32 }
define void @RNAinverse_cmdline_parser_free(%struct.RNAinverse_args_info* %0) {
%2 = tail call i32 @RNAinverse_cmdline_parser_release(%struct.RNAinverse_args_info* %0)
ret void
}
int izbaciCifruDesetica(int n) {
  int s;
  s = n % 10;
  n /= 100;
  n *= 10;
  return (n + s);
}


x86 assembly (clang, -O0):
<izbaciCifruDesetica>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
imul   $0xa,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<izbaciCifruDesetica>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
imul   $0x51eb851f,%rax,%rdx
sub    %ecx,%eax
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rdx
add    %ecx,%edx
lea    (%rdx,%rdx,4),%ecx
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @izbaciCifruDesetica(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 100
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, 10
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @izbaciCifruDesetica(i32 %0) {
%2 = srem i32 %0, 10
%3 = sdiv i32 %0, 100
%4 = mul nsw i32 %3, 10
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
mode_t umask(mode_t cmask) {
  static mode_t mask = 0;
  int retval = mask;
  printf("umask\n");
  mask = cmask;
  return retval;
}


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

x86 assembly (clang, -O2):
<umask>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2f11(%rip),%ebp
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,0x2eff(%rip)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@umask.mask = internal unnamed_addr global i32 0
@str = [6 x i8] c"umask\00"
define i32 @umask(i32 %0) {
%2 = load i32, i32* @umask.mask
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
store i32 %0, i32* @umask.mask
ret i32 %2
}
/* Variables and functions */
double cos(double);
double sin(double);
double F(double x) {
  double value = x * sin(x) + cos(x);
  return value;
}


x86 assembly (clang, -O0):
<F>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x20(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @F(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @sin(double %5)
%7 = load double, double* %2
%8 = call double @cos(double %7)
%9 = call double @llvm.fmuladd.f64(double %4, double %6, double %8)
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @F(double %0) {
%2 = tail call double @sin(double %0)
%3 = tail call double @cos(double %0)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void my_exit_handler(int s) {
  puts("\nBye bye!");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<my_exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [10 x i8] c"\0ABye bye!\00"
@EXIT_SUCCESS = global i32 0
define void @my_exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0ABye bye!\00"
@EXIT_SUCCESS = global i32 0
define void @my_exit_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void pnv_tm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @pnv_tm_init() {
ret void
}
void display_put(void *display_io, unsigned int x, unsigned int y,
                 unsigned int color) {
  unsigned int *addr;
  addr = (unsigned int *)((char *)display_io + 0xc000);
  addr += x + (y * 640);
  *addr = color;
}


x86 assembly (clang, -O0):
<display_put>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0xc000,%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
imul   $0x280,-0x10(%rbp),%eax
add    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_put>:
lea    (%rdx,%rdx,4),%eax
shl    $0x7,%eax
add    %esi,%eax
mov    %ecx,0xc000(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @display_put(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 49152
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %9
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = mul i32 %14, 640
%16 = add i32 %13, %15
%17 = load i32*, i32** %9
%18 = zext i32 %16 to i64
%19 = getelementptr inbounds i32, i32* %17, i64 %18
store i32* %19, i32** %9
%20 = load i32, i32* %8
%21 = load i32*, i32** %9
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @display_put(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 49152
%6 = bitcast i8* %5 to i32*
%7 = mul i32 %2, 640
%8 = add i32 %7, %1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %6, i64 %9
store i32 %3, i32* %10
ret void
}
/* Variables and functions */
unsigned long BIT_MASK(int);
int BIT_WORD(int);
int __test_and_clear_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = BIT_MASK(nr);
  unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
  unsigned long old = *p;
  *p = old & ~mask;
  return (old & mask) != 0;
}


x86 assembly (clang, -O0):
<__test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <BIT_MASK@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <BIT_WORD@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_clear_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <BIT_MASK@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1040 <BIT_WORD@plt>
cltq
mov    (%r14,%rax,8),%rcx
mov    %rbx,%rdx
not    %rdx
and    %rcx,%rdx
mov    %rdx,(%r14,%rax,8)
xor    %eax,%eax
test   %rbx,%rcx
setne  %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__test_and_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = call i64 @BIT_MASK(i32 %8)
store i64 %9, i64* %5
%10 = load i64*, i64** %4
%11 = load i32, i32* %3
%12 = call i32 @BIT_WORD(i32 %11)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %10, i64 %13
store i64* %14, i64** %6
%15 = load i64*, i64** %6
%16 = load i64, i64* %15
store i64 %16, i64* %7
%17 = load i64, i64* %7
%18 = load i64, i64* %5
%19 = xor i64 %18, -1
%20 = and i64 %17, %19
%21 = load i64*, i64** %6
store i64 %20, i64* %21
%22 = load i64, i64* %7
%23 = load i64, i64* %5
%24 = and i64 %22, %23
%25 = icmp ne i64 %24, 0
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @__test_and_clear_bit(i32 %0, i64* nocapture %1) {
%3 = tail call i64 @BIT_MASK(i32 %0)
%4 = tail call i32 @BIT_WORD(i32 %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %1, i64 %5
%7 = load i64, i64* %6
%8 = xor i64 %3, -1
%9 = and i64 %7, %8
store i64 %9, i64* %6
%10 = and i64 %7, %3
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
void ext_configuration_delete(void) {}


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

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

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

LLVM IR (-O2):
define void @ext_configuration_delete() {
ret void
}
double tan(x)
double x;
{ return sin(x) / cos(x); }


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = load double, double* %2
%6 = call double @cos(double %5)
%7 = fdiv double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double @sin(double %0)
%3 = tail call double @cos(double %0)
%4 = fdiv double %2, %3
ret double %4
}
void musb_init_debugfs(struct musb *musb) {}


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

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

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

LLVM IR (-O2):
%struct.musb = type opaque
define void @musb_init_debugfs(%struct.musb* nocapture %0) {
ret void
}
int test_imm_D2int64_highword_reg(long long val) {
  return ((val >> 32) & (0xD2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D2int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 210
%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_D2int64_highword_reg(i64 %0) {
%2 = and i64 %0, 901943132160
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  while (x > 1) {
    y = x;
    while (y > 1) {
      y = y - 2;
    }
    if (y == 0) {
      while (2 * y < x) {
        y = y + 1;
      }
      x = y;
    } else {
      x = 3 * x + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1197 <main+0x87>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1151 <main+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <main+0x29>
cmpl   $0x0,-0xc(%rbp)
jne    1188 <main+0x78>
jmp    1160 <main+0x50>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    117d <main+0x6d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <main+0x50>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1192 <main+0x82>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void foo785() {}


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

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

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

LLVM IR (-O2):
define void @foo785() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
void smbw_initialize(void) { initialize(); }


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

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

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

LLVM IR (-O2):
define void @smbw_initialize() {
%1 = tail call i32 (...) @initialize()
ret void
}
/* Type definitions */
struct sprd_mcdt_chan {
  int dummy;
};

/* Variables and functions */
void sprd_mcdt_chan_int_disable(struct sprd_mcdt_chan *chan) {}


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

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

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

LLVM IR (-O2):
%struct.sprd_mcdt_chan = type { i32 }
define void @sprd_mcdt_chan_int_disable(%struct.sprd_mcdt_chan* nocapture %0) {
ret void
}
/* Variables and functions */
int callee(int);
int __attribute__((no, noclone)) caller(int i) { return callee(i + 1); }


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

x86 assembly (clang, -O2):
<caller>:
add    $0x1,%edi
jmp    1030 <callee@plt>

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

LLVM IR (-O2):
define i32 @caller(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @callee(i32 %2)
ret i32 %3
}
void ft_striter(char *s, void (*f)(char *)) {
  int i;
  if (!s || !f)
    return;
  i = 0;
  while (s[i]) {
    f(&s[i]);
    ++i;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <ft_striter+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    112b <ft_striter+0x2b>
jmp    1163 <ft_striter+0x63>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1163 <ft_striter+0x63>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rcx
add    %rcx,%rdi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <ft_striter+0x32>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6, %9
%10 = phi i64 [ %12, %9 ], [ 0, %6 ]
%11 = phi i8* [ %13, %9 ], [ %0, %6 ]
tail call void %1(i8* %11)
%12 = add nuw i64 %10, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %9
16: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
char *strchr(char *, char);
__attribute__((no, noclone)) char *foo(char *p, const char *q) {
  char *e = strchr(p, '\0');
  strcat(p, q);
  return e;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
add    %r15,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @foo(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strchr(i8* %6, i8 signext 0)
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @foo(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr i8, i8* %0, i64 %3
%5 = tail call i32 @strcat(i8* %0, i8* %1)
ret i8* %4
}
int reverseBits(unsigned int initial) {
  unsigned int reversed = 0, loop;
  for (loop = 0; loop < 9; loop++) {
    reversed <<= 1;
    reversed += (initial & 1);
    initial >>= 1;
  }
  return reversed;
}


x86 assembly (clang, -O0):
<reverseBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jae    114b <reverseBits+0x4b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <reverseBits+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits>:
rol    $0x8,%di
mov    %edi,%eax
and    $0xf0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x5540,%ecx
shr    %eax
and    $0x5500,%eax
lea    (%rax,%rcx,2),%eax
shr    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @reverseBits(i32 %0) {
%2 = trunc i32 %0 to i9
%3 = call i9 @llvm.bitreverse.i9(i9 %2)
%4 = zext i9 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ cleanupW();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void cntrl_c_handler_W(int signum) {
  cleanupW();
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @cntrl_c_handler_W(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanupW()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @cntrl_c_handler_W(i32 %0) {
%2 = tail call i32 (...) @cleanupW()
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ _BITULL(int);
void gpiotools_set_bit(__u64 *b, int n) { *b |= _BITULL(n); }


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

x86 assembly (clang, -O2):
<gpiotools_set_bit>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <_BITULL@plt>
or     %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @gpiotools_set_bit(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 = call i32 @_BITULL(i32 %5)
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = or i32 %8, %6
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @gpiotools_set_bit(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @_BITULL(i32 %1)
%4 = load i32, i32* %0
%5 = or i32 %4, %3
store i32 %5, i32* %0
ret void
}
void t4_init(float *t4) {
  int i;
  for (i = 0; i < 16; i++)
    t4[i] = 0.;
  for (i = 0; i < 16; i += 5)
    t4[i] = 1.;
}


x86 assembly (clang, -O0):
<t4_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1137 <t4_init+0x37>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <t4_init+0xf>
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    116b <t4_init+0x6b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  0xea8(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <t4_init+0x3e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4_init>:
xorps  %xmm0,%xmm0
movups %xmm0,0x14(%rdi)
movups %xmm0,0x24(%rdi)
movups %xmm0,0x4(%rdi)
movq   $0x0,0x34(%rdi)
movl   $0x3f800000,(%rdi)
movl   $0x3f800000,0x14(%rdi)
movl   $0x3f800000,0x28(%rdi)
movl   $0x3f800000,0x3c(%rdi)
ret

LLVM IR (-O0):
define void @t4_init(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load float*, float** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
store float 0.000000e+00, float* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
store i32 0, i32* %3
br label %16
16: ; preds = %24, %15
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 16
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load float*, float** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
store float 1.000000e+00, float* %23
br label %24
24: ; preds = %19
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 5
store i32 %26, i32* %3
br label %16
27: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @t4_init(float* nocapture writeonly %0) {
%2 = getelementptr inbounds float, float* %0, i64 1
%3 = bitcast float* %2 to i8*
store float 1.000000e+00, float* %0
%4 = getelementptr inbounds float, float* %0, i64 5
store float 1.000000e+00, float* %4
%5 = getelementptr inbounds float, float* %0, i64 10
store float 1.000000e+00, float* %5
%6 = getelementptr inbounds float, float* %0, i64 15
store float 1.000000e+00, float* %6
ret void
}
void destroy_firenze() { return; }


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

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

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

LLVM IR (-O2):
define void @destroy_firenze() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mmu_enable(int);
void mmu_init(void) {
  volatile unsigned long *table = (volatile unsigned long *)0x51000000;
  table[256] = 0x7f000000 | ((3 << 10) | (0 << 5) | (1 << 4) | (2));
  table[0x200] = 0x7f000000 | ((3 << 10) | (0 << 5) | (1 << 4) | (2));
  table[0] = 0 | ((3 << 10) | (0 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (2));
  table[0xc00] = 0x57000000 |
                 ((3 << 10) | (0 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (2));
  mmu_enable(0x51000000);
}


x86 assembly (clang, -O0):
<mmu_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x51000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x7f000c12,0x800(%rax)
mov    -0x8(%rbp),%rax
movq   $0x7f000c12,0x1000(%rax)
mov    -0x8(%rbp),%rax
movq   $0xc1e,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x57000c1e,0x6000(%rax)
mov    $0x51000000,%edi
call   1030 <mmu_enable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmu_init>:
movq   $0x7f000c12,0x51000800
movq   $0x7f000c12,0x51001000
movq   $0xc1e,0x51000000
movq   $0x57000c1e,0x51006000
mov    $0x51000000,%edi
jmp    1030 <mmu_enable@plt>

LLVM IR (-O0):
define void @mmu_init() {
%1 = alloca i64*
store i64* inttoptr (i64 1358954496 to i64*), i64** %1
%2 = load i64*, i64** %1
%3 = getelementptr inbounds i64, i64* %2, i64 256
store volatile i64 2130709522, i64* %3
%4 = load i64*, i64** %1
%5 = getelementptr inbounds i64, i64* %4, i64 512
store volatile i64 2130709522, i64* %5
%6 = load i64*, i64** %1
%7 = getelementptr inbounds i64, i64* %6, i64 0
store volatile i64 3102, i64* %7
%8 = load i64*, i64** %1
%9 = getelementptr inbounds i64, i64* %8, i64 3072
store volatile i64 1459620894, i64* %9
%10 = call i32 @mmu_enable(i32 1358954496)
ret void
}

LLVM IR (-O2):
define void @mmu_init() {
store volatile i64 2130709522, i64* inttoptr (i64 1358956544 to i64*)
store volatile i64 2130709522, i64* inttoptr (i64 1358958592 to i64*)
store volatile i64 3102, i64* inttoptr (i64 1358954496 to i64*)
store volatile i64 1459620894, i64* inttoptr (i64 1358979072 to i64*)
%1 = tail call i32 @mmu_enable(i32 1358954496)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serialputc(char);
void logputc(char c) { serialputc(c); }


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

x86 assembly (clang, -O2):
<logputc>:
jmp    1030 <serialputc@plt>

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

LLVM IR (-O2):
define void @logputc(i8 signext %0) {
%2 = tail call i32 @serialputc(i8 signext %0)
ret void
}
main() {
  int x[][2][3] = {{
                       {1, 2, 3},
                       {5, 6, 7},
                   },
                   {
                       {8, 9, 10},
                   }};
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.x = [2 x [2 x [3 x i32]]] [[2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 5, i32 6, i32 7]], [2 x [3 x i32]] [[3 x i32] [i32 8, i32 9, i32 10], [3 x i32] zeroinitializer]]
define i32 @main() {
%1 = alloca [2 x [2 x [3 x i32]]]
%2 = bitcast [2 x [2 x [3 x i32]]]* %1 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: lmb url\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 = [16 x i8] c"usage: lmb url\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [15 x i8] c"usage: lmb url\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mdaq_file_close(int);
void ToFileTerminate(void) { mdaq_file_close(1); }


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

x86 assembly (clang, -O2):
<ToFileTerminate>:
mov    $0x1,%edi
jmp    1030 <mdaq_file_close@plt>

LLVM IR (-O0):
define void @ToFileTerminate() {
%1 = call i32 @mdaq_file_close(i32 1)
ret void
}

LLVM IR (-O2):
define void @ToFileTerminate() {
%1 = tail call i32 @mdaq_file_close(i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ pthread_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, char const *, unsigned int, unsigned int,
                          unsigned int);
scalar_t__ pthread_self();
void print_threadid(const char *msg) {
  pid_t pid;
  pthread_t thid;
  pid = getpid();
  thid = pthread_self();
  printf("%s pid is %u, tid is %u, 0x%x\n", msg, (unsigned int)pid,
         (unsigned int)thid, (unsigned int)thid);
}


x86 assembly (clang, -O0):
<print_threadid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %eax,%r8d
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_threadid>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s pid is %u, tid is %u, 0x%x\0A\00"
define void @print_threadid(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = call i64 (...) @getpid()
store i64 %5, i64* %3
%6 = call i64 (...) @pthread_self()
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i32
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s pid is %u, tid is %u, 0x%x\0A\00"
define void @print_threadid(i8* %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @pthread_self()
%4 = trunc i64 %2 to i32
%5 = trunc i64 %3 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4, i32 %5, i32 %5)
ret void
}