xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sys_defs_free();
int /*<<< orphan*/ sys_defs_init();
int /*<<< orphan*/ testVMCreateContext();
int /*<<< orphan*/ testVMCycle();
int /*<<< orphan*/ testVMCycleDescend();
int /*<<< orphan*/ testVMCycleEval();
int /*<<< orphan*/ testVMCycleLoad();
void testVM() {
  sys_defs_init();
  testVMCreateContext();
  testVMCycleLoad();
  testVMCycleDescend();
  testVMCycleEval();
  testVMCycle();
  sys_defs_free();
}


x86 assembly (clang, -O0):
<testVM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <sys_defs_init@plt>
mov    $0x0,%al
call   1060 <testVMCreateContext@plt>
mov    $0x0,%al
call   1040 <testVMCycleLoad@plt>
mov    $0x0,%al
call   1090 <testVMCycleDescend@plt>
mov    $0x0,%al
call   1070 <testVMCycleEval@plt>
mov    $0x0,%al
call   1050 <testVMCycle@plt>
mov    $0x0,%al
call   1030 <sys_defs_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testVM>:
push   %rax
xor    %eax,%eax
call   1080 <sys_defs_init@plt>
xor    %eax,%eax
call   1060 <testVMCreateContext@plt>
xor    %eax,%eax
call   1040 <testVMCycleLoad@plt>
xor    %eax,%eax
call   1090 <testVMCycleDescend@plt>
xor    %eax,%eax
call   1070 <testVMCycleEval@plt>
xor    %eax,%eax
call   1050 <testVMCycle@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <sys_defs_free@plt>

LLVM IR (-O0):
define void @testVM() {
%1 = call i32 (...) @sys_defs_init()
%2 = call i32 (...) @testVMCreateContext()
%3 = call i32 (...) @testVMCycleLoad()
%4 = call i32 (...) @testVMCycleDescend()
%5 = call i32 (...) @testVMCycleEval()
%6 = call i32 (...) @testVMCycle()
%7 = call i32 (...) @sys_defs_free()
ret void
}

LLVM IR (-O2):
define void @testVM() {
%1 = tail call i32 (...) @sys_defs_init()
%2 = tail call i32 (...) @testVMCreateContext()
%3 = tail call i32 (...) @testVMCycleLoad()
%4 = tail call i32 (...) @testVMCycleDescend()
%5 = tail call i32 (...) @testVMCycleEval()
%6 = tail call i32 (...) @testVMCycle()
%7 = tail call i32 (...) @sys_defs_free()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void badvpn_write_le32(uint32_t x, char *c_ptr) {
  uint8_t *ptr = (uint8_t *)c_ptr;
  ptr[3] = x >> 24;
  ptr[2] = x >> 16;
  ptr[1] = x >> 8;
  ptr[0] = x >> 0;
}


x86 assembly (clang, -O0):
<badvpn_write_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<badvpn_write_le32>:
mov    %edi,%eax
sar    $0x18,%eax
mov    %eax,0xc(%rsi)
mov    %edi,%eax
sar    $0x10,%eax
mov    %eax,0x8(%rsi)
mov    %edi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rsi)
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @badvpn_write_le32(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 24
%5 = getelementptr inbounds i8, i8* %1, i64 12
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = ashr i32 %0, 16
%8 = getelementptr inbounds i8, i8* %1, i64 8
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
%10 = ashr i32 %0, 8
%11 = getelementptr inbounds i8, i8* %1, i64 4
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
store i32 %0, i32* %3
ret void
}
int cpusupport_x86_aesni_detect_CPUSUPPORT_X86_AESNI(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @cpusupport_x86_aesni_detect_CPUSUPPORT_X86_AESNI() {
ret i32 0
}
int add_last_boot_info(const char *c, void (*s)(struct seq_file *)) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.seq_file = type opaque
define i32 @add_last_boot_info(i8* %0, void (%struct.seq_file*)* %1) {
%3 = alloca i8*
%4 = alloca void (%struct.seq_file*)*
store i8* %0, i8** %3
store void (%struct.seq_file*)* %1, void (%struct.seq_file*)** %4
ret i32 0
}

LLVM IR (-O2):
%struct.seq_file = type opaque
define i32 @add_last_boot_info(i8* nocapture readnone %0, void (%struct.seq_file*)* nocapture readnone %1) {
ret i32 0
}
void XGetWindowAttributes() {}


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

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

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

LLVM IR (-O2):
define void @XGetWindowAttributes() {
ret void
}
/* Variables and functions */
int init_mat(int);
int mat_sum();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int sum1, sum2;
  sum1 = init_mat(3);
  sum2 = mat_sum();
  printf("sum1 = %d sum2 = %d\n", sum1, sum2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1050 <init_mat@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <mat_sum@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1050 <init_mat@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <mat_sum@plt>
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"sum1 = %d sum2 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @init_mat(i32 3)
store i32 %4, i32* %2
%5 = call i32 (...) @mat_sum()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"sum1 = %d sum2 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @init_mat(i32 3)
%2 = tail call i32 (...) @mat_sum()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
int test_imm_C5int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xC5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C5int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 197
%7 = icmp ne i64 %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_C5int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 846108557312
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_slide(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
__attribute__((always_)) struct vec2i *
psvec2i_slide(struct vec2i *result, struct vec2i *a, struct vec2i *b) {
  vec2i_slide((int32_t *)result, (int32_t *)a, (int32_t *)b);
  return result;
}


x86 assembly (clang, -O0):
<psvec2i_slide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <vec2i_slide@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2i_slide>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_slide@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_slide(%struct.vec2i* %0, %struct.vec2i* %1, %struct.vec2i* %2) {
%4 = alloca %struct.vec2i*
%5 = alloca %struct.vec2i*
%6 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %4
store %struct.vec2i* %1, %struct.vec2i** %5
store %struct.vec2i* %2, %struct.vec2i** %6
%7 = load %struct.vec2i*, %struct.vec2i** %4
%8 = bitcast %struct.vec2i* %7 to i32*
%9 = load %struct.vec2i*, %struct.vec2i** %5
%10 = bitcast %struct.vec2i* %9 to i32*
%11 = load %struct.vec2i*, %struct.vec2i** %6
%12 = bitcast %struct.vec2i* %11 to i32*
%13 = call i32 @vec2i_slide(i32* %8, i32* %10, i32* %12)
%14 = load %struct.vec2i*, %struct.vec2i** %4
ret %struct.vec2i* %14
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_slide(%struct.vec2i* returned %0, %struct.vec2i* %1, %struct.vec2i* %2) {
%4 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec2i, %struct.vec2i* %1, i64 0, i32 0
%6 = getelementptr %struct.vec2i, %struct.vec2i* %2, i64 0, i32 0
%7 = tail call i32 @vec2i_slide(i32* %4, i32* %5, i32* %6)
ret %struct.vec2i* %0
}
/* Variables and functions */
int encryption(char *, char *, int);
int createpass(char *a) { return encryption(a, "passwd", 555); }


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

x86 assembly (clang, -O2):
<createpass>:
lea    0xee9(%rip),%rsi
mov    $0x22b,%edx
jmp    1030 <encryption@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"passwd\00"
define i32 @createpass(i8* %0) {
%2 = tail call i32 @encryption(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 555)
ret i32 %2
}
int iio_simple_dummy_events_unregister(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @iio_simple_dummy_events_unregister(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int epoll_create(int);
int /*<<< orphan*/ unix_error(char *);
int Epoll_create() {
  int epollfd;
  if ((epollfd = epoll_create(10)) < 0)
    unix_error("Epoll create error");
  return epollfd;
}


x86 assembly (clang, -O0):
<Epoll_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <epoll_create@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    114a <Epoll_create+0x2a>
lea    0xebb(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Epoll_create>:
push   %rbx
mov    $0xa,%edi
call   1040 <epoll_create@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    113d <Epoll_create+0x1d>
lea    0xec8(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Epoll create error\00"
define i32 @Epoll_create() {
%1 = alloca i32
%2 = call i32 @epoll_create(i32 10)
store i32 %2, i32* %1
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @unix_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [19 x i8] c"Epoll create error\00"
define i32 @Epoll_create() {
%1 = tail call i32 @epoll_create(i32 10)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @unix_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
bool starts_with(const char *a, const char *b) {
  if (strncmp(a, b, strlen(b)) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    116e <starts_with+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <starts_with+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void foo294(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo294(i32 %0) {
ret void
}
int gdysize(yr)
int yr;
{
  if (!(yr % 4)) {
    if ((!(yr % 100)) && yr % 400)
      return (365);
    return (366);
  }
  return (365);
}


x86 assembly (clang, -O0):
<gdysize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115b <gdysize+0x5b>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <gdysize+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114f <gdysize+0x4f>
movl   $0x16d,-0x4(%rbp)
jmp    1162 <gdysize+0x62>
movl   $0x16e,-0x4(%rbp)
jmp    1162 <gdysize+0x62>
movl   $0x16d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdysize>:
mov    $0x16d,%eax
test   $0x3,%dil
je     110c <gdysize+0xc>
ret
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
setae  %cl
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
setb   %al
or     %cl,%al
movzbl %al,%eax
add    $0x16d,%eax
ret

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

LLVM IR (-O2):
define i32 @gdysize(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
%10 = select i1 %9, i32 366, i32 365
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 365, %1 ], [ %10, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ FlashWrite(int /*<<< orphan*/, int);
void FlashUnlockBypassReset(void) {
  FlashWrite((0), (0x0090));
  FlashWrite((0), (0x0000));
}


x86 assembly (clang, -O0):
<FlashUnlockBypassReset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x90,%esi
call   1030 <FlashWrite@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <FlashWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashUnlockBypassReset>:
push   %rax
xor    %edi,%edi
mov    $0x90,%esi
call   1030 <FlashWrite@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <FlashWrite@plt>

LLVM IR (-O0):
define void @FlashUnlockBypassReset() {
%1 = call i32 @FlashWrite(i32 0, i32 144)
%2 = call i32 @FlashWrite(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @FlashUnlockBypassReset() {
%1 = tail call i32 @FlashWrite(i32 0, i32 144)
%2 = tail call i32 @FlashWrite(i32 0, i32 0)
ret void
}
__attribute__((unused)) void _force_has_format_string(const char *format, ...) {
  (void)format;
}


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

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

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

LLVM IR (-O2):
define void @_force_has_format_string(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die_usage(const char *program_name) {
  fprintf(stderr, "Usage: %s [-v]\n", program_name);
  exit(1);
}


x86 assembly (clang, -O0):
<die_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Usage: %s [-v]\0A\00"
define void @die_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Usage: %s [-v]\0A\00"
define void @die_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d) {
  asm volatile("int $0x40" ::"a"(7), "c"(w * 65536 + h), "d"(x * 65536 + y),
               "b"(d));
}


x86 assembly (clang, -O0):
<kol_paint_image>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
add    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%edx
shl    $0x10,%edx
add    -0x10(%rbp),%edx
mov    -0x20(%rbp),%rbx
mov    $0x7,%eax
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_paint_image>:
push   %rbx
mov    %r8,%rbx
shl    $0x10,%edx
add    %edx,%ecx
shl    $0x10,%edi
lea    (%rdi,%rsi,1),%edx
mov    $0x7,%eax
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define void @kol_paint_image(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %8
%12 = mul i32 %11, 65536
%13 = load i32, i32* %9
%14 = add i32 %12, %13
%15 = load i32, i32* %6
%16 = mul i32 %15, 65536
%17 = load i32, i32* %7
%18 = add i32 %16, %17
%19 = load i8*, i8** %10
ret void
}

LLVM IR (-O2):
define void @kol_paint_image(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = shl i32 %2, 16
%7 = add i32 %6, %3
%8 = shl i32 %0, 16
%9 = add i32 %8, %1
tail call void asm sideeffect "int $$0x40", "{ax},{cx},{dx},{bx},~{dirflag},~{fpsr},~{flags}"(i32 7, i32 %7, i32 %9, i8* %4)
ret void
}
int thread_limit(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @thread_limit() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void printUsage(void) {
  printf("Usage: <binfile> <shiftfactor>\n");
  exit(EXIT_SUCCESS);
}


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

x86 assembly (clang, -O2):
<printUsage>:
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 = [32 x i8] c"Usage: <binfile> <shiftfactor>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [31 x i8] c"Usage: <binfile> <shiftfactor>\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
int countbits(unsigned int x) {
  x -= (x >> 1) & 0x55555555;
  x = ((x >> 2) & 0x33333333) + (x & 0x33333333);
  x = ((x >> 4) + x) & 0x0f0f0f0f;
  x += x >> 8;
  x += x >> 16;
  return x & 0x3f;
}


x86 assembly (clang, -O0):
<countbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
add    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countbits>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
shr    $0x2,%eax
and    $0x33333333,%eax
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @countbits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = sub i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = lshr i32 %8, 2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = and i32 %11, 858993459
%13 = add i32 %10, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = lshr i32 %14, 4
%16 = load i32, i32* %2
%17 = add i32 %15, %16
%18 = and i32 %17, 252645135
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 8
%21 = load i32, i32* %2
%22 = add i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = lshr i32 %23, 16
%25 = load i32, i32* %2
%26 = add i32 %25, %24
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 63
ret i32 %28
}

LLVM IR (-O2):
define i32 @countbits(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = lshr i32 %4, 2
%6 = and i32 %5, 858993459
%7 = and i32 %4, 858993459
%8 = add nuw nsw i32 %6, %7
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = lshr i32 %11, 8
%13 = add nuw nsw i32 %12, %11
%14 = lshr i32 %13, 16
%15 = add nuw nsw i32 %14, %13
%16 = and i32 %15, 63
ret i32 %16
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
pid_t vfork() {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<vfork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfork>:
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 @vfork() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @vfork() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int random();
int getbyte() { return random() & 0xffff; }


x86 assembly (clang, -O0):
<getbyte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbyte>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
movzwl %ax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getbyte() {
%1 = call i32 (...) @random()
%2 = and i32 %1, 65535
ret i32 %2
}

LLVM IR (-O2):
define i32 @getbyte() {
%1 = tail call i32 (...) @random()
%2 = and i32 %1, 65535
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
float inputint(char *c) {
  int num;
  printf("%s\n", c);
  scanf("%d", &num);
  return num;
}


x86 assembly (clang, -O0):
<inputint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cvtsi2ssl -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputint>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cvtsi2ssl 0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define float @inputint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define float @inputint(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void exit_print(const char *prompt) {
  printf("%s", prompt);
  exit(1);
}


x86 assembly (clang, -O0):
<exit_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_print>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @exit_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int _SCOTCHintGcd(int u, int v) {
  int t;
  if (v < u) {
    t = u;
    u = v;
    v = t;
  }
  while (v != 0) {
    t = v;
    v = u % v;
    u = t;
  }
  return (u);
}


x86 assembly (clang, -O0):
<_SCOTCHintGcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <_SCOTCHintGcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <_SCOTCHintGcd+0x2d>
cmpl   $0x0,-0x8(%rbp)
je     1152 <_SCOTCHintGcd+0x52>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112d <_SCOTCHintGcd+0x2d>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_SCOTCHintGcd>:
mov    %esi,%edx
cmp    %edi,%esi
mov    %edi,%eax
cmovl  %esi,%eax
cmovl  %edi,%edx
test   %edx,%edx
je     111d <_SCOTCHintGcd+0x1d>
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <_SCOTCHintGcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_SCOTCHintGcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
store i32 %11, i32* %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %13
13: ; preds = %9, %2
br label %14
14: ; preds = %17, %13
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %4
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = srem i32 %19, %20
store i32 %21, i32* %4
%22 = load i32, i32* %5
store i32 %22, i32* %3
br label %14
23: ; preds = %14
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @_SCOTCHintGcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %5, %2 ]
%9 = phi i32 [ %8, %7 ], [ %4, %2 ]
%10 = srem i32 %9, %8
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i32 [ %4, %2 ], [ %8, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t expansion(uint8_t r0) {
  return ((r0 << 2) & 0b11000000) |
         (((r0 & 0b00001000) >> 1 | (r0 & 0b00001000) << 1) |
          ((r0 & 0b00000100) << 1 | (r0 & 0b00000100) << 3)) |
         (r0 & 0b00000011);
}


x86 assembly (clang, -O0):
<expansion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
and    $0xc0,%eax
mov    -0x4(%rbp),%ecx
and    $0x8,%ecx
sar    $0x1,%ecx
mov    -0x4(%rbp),%edx
and    $0x8,%edx
shl    $0x1,%edx
or     %edx,%ecx
mov    -0x4(%rbp),%edx
and    $0x4,%edx
shl    $0x1,%edx
mov    -0x4(%rbp),%esi
and    $0x4,%esi
shl    $0x3,%esi
or     %esi,%edx
or     %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<expansion>:
mov    %edi,%eax
and    $0x30,%eax
mov    %edi,%ecx
and    $0x8,%ecx
mov    %ecx,%edx
shr    %edx
lea    (%rdx,%rcx,2),%ecx
mov    %edi,%edx
and    $0x4,%edx
lea    (%rdx,%rdx,4),%edx
lea    (%rcx,%rdx,2),%ecx
lea    (%rcx,%rax,4),%eax
and    $0x3,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @expansion(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 2
%5 = and i32 %4, 192
%6 = load i32, i32* %2
%7 = and i32 %6, 8
%8 = ashr i32 %7, 1
%9 = load i32, i32* %2
%10 = and i32 %9, 8
%11 = shl i32 %10, 1
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = and i32 %13, 4
%15 = shl i32 %14, 1
%16 = load i32, i32* %2
%17 = and i32 %16, 4
%18 = shl i32 %17, 3
%19 = or i32 %15, %18
%20 = or i32 %12, %19
%21 = or i32 %5, %20
%22 = load i32, i32* %2
%23 = and i32 %22, 3
%24 = or i32 %21, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @expansion(i32 %0) {
%2 = shl i32 %0, 2
%3 = and i32 %2, 192
%4 = and i32 %0, 8
%5 = lshr exact i32 %4, 1
%6 = shl nuw nsw i32 %4, 1
%7 = or i32 %5, %6
%8 = and i32 %0, 4
%9 = mul nuw nsw i32 %8, 10
%10 = add nuw nsw i32 %7, %9
%11 = add nuw nsw i32 %10, %3
%12 = and i32 %0, 3
%13 = or i32 %11, %12
ret i32 %13
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
mode_t umask(mode_t mask) { return 0666; }


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

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

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

LLVM IR (-O2):
define i32 @umask(i32 %0) {
ret i32 438
}
/* Variables and functions */
int /*<<< orphan*/ launch_missile();
int run() {
  launch_missile();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @run() {
%1 = tail call i32 (...) @launch_missile()
ret i32 0
}
int test_imm_89int8_reg(signed char val) {
  return ((val) & (-0x89 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_89int8_reg>:
test   $0xffffff77,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_89int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -137
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ wDateTimePush(char, int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopDateTime();
void wBuiltinMonth() { wDateTimePush('m', wStackPopDateTime()); }


x86 assembly (clang, -O0):
<wBuiltinMonth>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wStackPopDateTime@plt>
mov    %eax,%esi
mov    $0x6d,%edi
call   1030 <wDateTimePush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinMonth>:
push   %rax
xor    %eax,%eax
call   1040 <wStackPopDateTime@plt>
mov    $0x6d,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <wDateTimePush@plt>

LLVM IR (-O0):
define void @wBuiltinMonth() {
%1 = call i32 (...) @wStackPopDateTime()
%2 = call i32 @wDateTimePush(i8 signext 109, i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBuiltinMonth() {
%1 = tail call i32 (...) @wStackPopDateTime()
%2 = tail call i32 @wDateTimePush(i8 signext 109, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addToTree(int /*<<< orphan*/);
int /*<<< orphan*/ dequeueList();
int /*<<< orphan*/ peekList();
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int alphabet() {
  if (strcmp(peekList(), "<alphabet>") != 0) {
    return 0;
  }
  dequeueList();
  addToTree(peekList());
  dequeueList();
  return 1;
}


x86 assembly (clang, -O0):
<alphabet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <peekList@plt>
mov    %eax,%edi
lea    0xea8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1173 <alphabet+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1196 <alphabet+0x56>
mov    $0x0,%al
call   1060 <dequeueList@plt>
mov    $0x0,%al
call   1050 <peekList@plt>
mov    %eax,%edi
call   1040 <addToTree@plt>
mov    $0x0,%al
call   1060 <dequeueList@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphabet>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <peekList@plt>
lea    0xeaf(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    117e <alphabet+0x3e>
xor    %eax,%eax
call   1060 <dequeueList@plt>
xor    %eax,%eax
call   1050 <peekList@plt>
mov    %eax,%edi
call   1040 <addToTree@plt>
xor    %eax,%eax
call   1060 <dequeueList@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"<alphabet>\00"
define i32 @alphabet() {
%1 = alloca i32
%2 = call i32 (...) @peekList()
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %11
6: ; preds = %0
%7 = call i32 (...) @dequeueList()
%8 = call i32 (...) @peekList()
%9 = call i32 @addToTree(i32 %8)
%10 = call i32 (...) @dequeueList()
store i32 1, i32* %1
br label %11
11: ; preds = %6, %5
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"<alphabet>\00"
define i32 @alphabet() {
%1 = tail call i32 (...) @peekList()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i32 (...) @dequeueList()
%6 = tail call i32 (...) @peekList()
%7 = tail call i32 @addToTree(i32 %6)
%8 = tail call i32 (...) @dequeueList()
br label %9
9: ; preds = %0, %4
%10 = phi i32 [ 1, %4 ], [ 0, %0 ]
ret i32 %10
}
void gdk_rgb_cmap_free() {}


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

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

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

LLVM IR (-O2):
define void @gdk_rgb_cmap_free() {
ret void
}
void dev_remove_param(struct param_d *p) {}


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

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

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

LLVM IR (-O2):
%struct.param_d = type opaque
define void @dev_remove_param(%struct.param_d* nocapture %0) {
ret void
}
/* Variables and functions */
void eeprom_write_int16(int, int);
void settings_set_channel(int val) { return eeprom_write_int16(32, val); }


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

x86 assembly (clang, -O2):
<settings_set_channel>:
mov    %edi,%esi
mov    $0x20,%edi
jmp    1030 <eeprom_write_int16@plt>

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

LLVM IR (-O2):
define void @settings_set_channel(i32 %0) {
tail call void @eeprom_write_int16(i32 32, i32 %0)
ret void
}
/* Type definitions */
struct pmd_part {
  int dummy;
};
struct fmdriver_work {
  int dummy;
};
struct driver_pmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pmd_part_cmdload(struct driver_pmd *, struct pmd_part *);
void pmd_cmdf1_ppsdrv(struct fmdriver_work *work, struct driver_pmd *pmd,
                      struct pmd_part *part) {
  (void)work;
  pmd_part_cmdload(pmd, part);
}


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

x86 assembly (clang, -O2):
<pmd_cmdf1_ppsdrv>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <pmd_part_cmdload@plt>

LLVM IR (-O0):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdf1_ppsdrv(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = alloca %struct.fmdriver_work*
%5 = alloca %struct.driver_pmd*
%6 = alloca %struct.pmd_part*
store %struct.fmdriver_work* %0, %struct.fmdriver_work** %4
store %struct.driver_pmd* %1, %struct.driver_pmd** %5
store %struct.pmd_part* %2, %struct.pmd_part** %6
%7 = load %struct.fmdriver_work*, %struct.fmdriver_work** %4
%8 = load %struct.driver_pmd*, %struct.driver_pmd** %5
%9 = load %struct.pmd_part*, %struct.pmd_part** %6
%10 = call i32 @pmd_part_cmdload(%struct.driver_pmd* %8, %struct.pmd_part* %9)
ret void
}

LLVM IR (-O2):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdf1_ppsdrv(%struct.fmdriver_work* nocapture readnone %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = tail call i32 @pmd_part_cmdload(%struct.driver_pmd* %1, %struct.pmd_part* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void const *, double);
int /*<<< orphan*/ stdout;
void set_member_show_double(const void *member, void *arg) {
  { arg = arg; }
  fprintf(stdout, "\tset member=>{object=>0x%p,value=>%.3f}\n", member,
          *(double *)member);
}


x86 assembly (clang, -O0):
<set_member_show_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_member_show_double>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
movsd  (%rdx),%xmm0
lea    0xed9(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [41 x i8] c"\09set member=>{object=>0x%p,value=>%.3f}\0A\00"
define void @set_member_show_double(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
store i8* %5, i8** %4
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %7, double %10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [41 x i8] c"\09set member=>{object=>0x%p,value=>%.3f}\0A\00"
define void @set_member_show_double(i8* %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, double %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ altera(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int vet[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  int x = 0;
  altera(vet, x);
  printf("vet[0] = %d\n", vet[0]);
  printf("x = %d", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <altera@plt>
mov    -0x30(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <altera@plt>
mov    (%rsp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.vet = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@.str = [13 x i8] c"vet[0] = %d\0A\00"
@.str.1 = [7 x i8] c"x = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @altera(i32* %5, i32 %6)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vet = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@.str = [13 x i8] c"vet[0] = %d\0A\00"
@.str.1 = [7 x i8] c"x = %d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @altera(i32* %3, i32 0)
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}