xunge/DecIR huggingface dataset:
unsigned int umin(unsigned int a, unsigned int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<umin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1121 <umin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <umin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @umin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @umin(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ history_forgetFuture();
int /*<<< orphan*/ libc_printf(char *, int);
int /*<<< orphan*/ printQueue();
int /*<<< orphan*/ removeCollisionEvent();
int /*<<< orphan*/ resetQueue();
void up(void) {
  history_forgetFuture();
  resetQueue();
  if ((1 == 0)) {
    libc_printf((char *)"exiting up\\n", 12);
    printQueue();
    libc_printf((char *)"remaking queue\\n", 16);
    removeCollisionEvent();
    libc_printf((char *)"collision event removed\\n", 25);
    printQueue();
    libc_printf((char *)"collision event added\\n", 23);
    resetQueue();
    printQueue();
    libc_printf((char *)"and again (collision event added)\\n", 35);
    removeCollisionEvent();
    resetQueue();
    printQueue();
    libc_printf((char *)"exiting finishing\\n", 19);
  }
}


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

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

LLVM IR (-O0):
define void @up() {
%1 = call i32 (...) @history_forgetFuture()
%2 = call i32 (...) @resetQueue()
ret void
}

LLVM IR (-O2):
define void @up() {
%1 = tail call i32 (...) @history_forgetFuture()
%2 = tail call i32 (...) @resetQueue()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RB_POWER_OFF;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int /*<<< orphan*/ sync();
int main(int argc, const char *argv[]) {
  sync();
  reboot(RB_POWER_OFF);
  _exit(errno);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <sync@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <reboot@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sync@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1050 <reboot@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@RB_POWER_OFF = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @sync()
%7 = load i32, i32* @RB_POWER_OFF
%8 = call i32 @reboot(i32 %7)
%9 = load i32, i32* @errno
%10 = call i32 @_exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@RB_POWER_OFF = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sync()
%4 = load i32, i32* @RB_POWER_OFF
%5 = tail call i32 @reboot(i32 %4)
%6 = load i32, i32* @errno
%7 = tail call i32 @_exit(i32 %6)
unreachable
}
/* Variables and functions */
int bitcount(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", bitcount(0777));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1ff,%edi
call   1040 <bitcount@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1ff,%edi
call   1040 <bitcount@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 511)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
void *malloc(int);
void *sn_malloc(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<sn_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @sn_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
int json_is_hexadecimal_digit(const char c) {
  return (('0' <= c && c <= '9') || ('a' <= c && c <= 'f') ||
          ('A' <= c && c <= 'F'));
}


x86 assembly (clang, -O0):
<json_is_hexadecimal_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     112d <json_is_hexadecimal_digit+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1179 <json_is_hexadecimal_digit+0x79>
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1150 <json_is_hexadecimal_digit+0x50>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    1179 <json_is_hexadecimal_digit+0x79>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1173 <json_is_hexadecimal_digit+0x73>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_is_hexadecimal_digit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @json_is_hexadecimal_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 97, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 65, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @json_is_hexadecimal_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int hashtable_strcmp(void *x, void *y) { return !strcmp((char *)x, (char *)y); }


x86 assembly (clang, -O0):
<hashtable_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_strcmp>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hashtable_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @hashtable_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bye();
int /*<<< orphan*/ dummy();
int main() {
  dummy();
  bye();
  dummy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <dummy@plt>
mov    $0x0,%al
call   1040 <bye@plt>
mov    $0x0,%al
call   1030 <dummy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @dummy()
%3 = call i32 (...) @bye()
%4 = call i32 (...) @dummy()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dummy()
%2 = tail call i32 (...) @bye()
%3 = tail call i32 (...) @dummy()
ret i32 0
}
/* Variables and functions */
int subtract_func(int, int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int dec_func(int src, int dest, int is_word) {
  (void)src;
  return subtract_func(1, dest, is_word, 0, 0);
}


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

x86 assembly (clang, -O2):
<dec_func>:
mov    $0x1,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <subtract_func@plt>

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

LLVM IR (-O2):
define i32 @dec_func(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @subtract_func(i32 1, i32 %1, i32 %2, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float a;
  printf("Enter value: ");
  scanf("%f", &a);
  printf("Value = %f\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter value: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"Value = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter value: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"Value = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Type definitions */
struct Parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ naParseError(struct Parser *, char *, int);
void oops(struct Parser *p) { naParseError(p, "parse error", -1); }


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

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

LLVM IR (-O0):
%struct.Parser = type { i32 }
@.str = [12 x i8] c"parse error\00"
define void @oops(%struct.Parser* %0) {
%2 = alloca %struct.Parser*
store %struct.Parser* %0, %struct.Parser** %2
%3 = load %struct.Parser*, %struct.Parser** %2
%4 = call i32 @naParseError(%struct.Parser* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 -1)
ret void
}

LLVM IR (-O2):
%struct.Parser = type { i32 }
@.str = [12 x i8] c"parse error\00"
define void @oops(%struct.Parser* %0) {
%2 = tail call i32 @naParseError(%struct.Parser* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 -1)
ret void
}
/* Variables and functions */
scalar_t__ VIM_HIF_GetReg8(int);
int /*<<< orphan*/ VIM_HIF_SetReg8(int, int /*<<< orphan*/);
unsigned long VIM_MARB_GetJpegChipLastPointer(void) {
  unsigned long Temp = 0;
  VIM_HIF_SetReg8((0x2400 + 0x066), 0);
  Temp = (unsigned long)VIM_HIF_GetReg8((0x2400 + 0x068));
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x067))) << 8;
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x066))) << 16;
  return Temp;
}


x86 assembly (clang, -O0):
<VIM_MARB_GetJpegChipLastPointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x2466,%edi
xor    %esi,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    $0x2468,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %rax,-0x8(%rbp)
mov    $0x2467,%edi
call   1040 <VIM_HIF_GetReg8@plt>
shl    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x2466,%edi
call   1040 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_MARB_GetJpegChipLastPointer>:
push   %r14
push   %rbx
push   %rax
mov    $0x2466,%edi
xor    %esi,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    $0x2468,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %rax,%r14
mov    $0x2467,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %rax,%rbx
shl    $0x8,%rbx
or     %r14,%rbx
mov    $0x2466,%edi
call   1040 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @VIM_MARB_GetJpegChipLastPointer() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i32 @VIM_HIF_SetReg8(i32 9318, i32 0)
%3 = call i64 @VIM_HIF_GetReg8(i32 9320)
store i64 %3, i64* %1
%4 = call i64 @VIM_HIF_GetReg8(i32 9319)
%5 = shl i64 %4, 8
%6 = load i64, i64* %1
%7 = or i64 %6, %5
store i64 %7, i64* %1
%8 = call i64 @VIM_HIF_GetReg8(i32 9318)
%9 = shl i64 %8, 16
%10 = load i64, i64* %1
%11 = or i64 %10, %9
store i64 %11, i64* %1
%12 = load i64, i64* %1
ret i64 %12
}

LLVM IR (-O2):
define i64 @VIM_MARB_GetJpegChipLastPointer() {
%1 = tail call i32 @VIM_HIF_SetReg8(i32 9318, i32 0)
%2 = tail call i64 @VIM_HIF_GetReg8(i32 9320)
%3 = tail call i64 @VIM_HIF_GetReg8(i32 9319)
%4 = shl i64 %3, 8
%5 = or i64 %4, %2
%6 = tail call i64 @VIM_HIF_GetReg8(i32 9318)
%7 = shl i64 %6, 16
%8 = or i64 %5, %7
ret i64 %8
}
int func(int n) {
  if (n < 1)
    return 1;
  else
    return n += func(n - 2);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1131 <func+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1145 <func+0x35>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <func@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
test   %edi,%edi
jle    1130 <func+0x30>
cmp    $0x2,%edi
mov    $0x2,%eax
cmovl  %edi,%eax
neg    %eax
lea    (%rdi,%rax,1),%ecx
add    $0x1,%ecx
shr    %ecx
lea    -0x2(%rdi),%eax
imul   %ecx,%eax
lea    -0x1(%rcx),%edx
imul   %ecx,%edx
and    $0xfffffffe,%edx
add    %edi,%eax
sub    %edx,%eax
add    $0x1,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = add nuw i32 %0, 1
%5 = call i32 @llvm.smin.i32(i32 %0, i32 2)
%6 = sub nuw i32 %4, %5
%7 = lshr i32 %6, 1
%8 = add nsw i32 %0, -2
%9 = mul i32 %7, %8
%10 = lshr i32 %6, 1
%11 = add nsw i32 %7, -1
%12 = mul i32 %10, %11
%13 = and i32 %12, -2
%14 = add i32 %9, %0
%15 = sub i32 %14, %13
%16 = add i32 %15, 1
br label %17
17: ; preds = %3, %1
%18 = phi i32 [ 1, %1 ], [ %16, %3 ]
ret i32 %18
}
int test_imm_A2int64_highword_reg(long long val) {
  return ((val >> 32) & (0xA2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A2int64_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, 162
%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_A2int64_highword_reg(i64 %0) {
%2 = and i64 %0, 695784701952
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sys_read(int, void *, unsigned long);
char freadb(int fd) {
  char character = '\0';
  sys_read(fd, (void *)&character, 1UL);
  return character;
}


x86 assembly (clang, -O0):
<freadb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <sys_read@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freadb>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <sys_read@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @freadb(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
%4 = load i32, i32* %2
%5 = call i32 @sys_read(i32 %4, i8* %3, i64 1)
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @freadb(i32 %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 @sys_read(i32 %0, i8* %2, i64 1)
%4 = load i8, i8* %2
ret i8 %4
}
int test1_f1() {
  int y = 1;
  y++;
  return y;
}


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

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

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

LLVM IR (-O2):
define i32 @test1_f1() {
ret i32 2
}
upcase(ch) {
  register int c;
  c = ch & 0177;
  return ((('a' <= c) && (c <= 'z')) ? (c - ('a' - 'A')) : c);
}


x86 assembly (clang, -O0):
<upcase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x8(%rbp)
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     1136 <upcase+0x36>
cmpl   $0x7a,-0x8(%rbp)
jg     1136 <upcase+0x36>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <upcase+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcase>:
and    $0x7f,%edi
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @upcase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 127
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 97, %6
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 32
br label %16
14: ; preds = %8, %1
%15 = load i32, i32* %3
br label %16
16: ; preds = %14, %11
%17 = phi i32 [ %13, %11 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @upcase(i32 %0) {
%2 = and i32 %0, 127
%3 = add nsw i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = add nsw i32 %2, -32
%6 = select i1 %4, i32 %5, i32 %2
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
void set_XReparentEvent_y(void *_p, int _v) {
  ((XReparentEvent *)_p)->y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XReparentEvent_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XReparentEvent_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XReparentEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dummyfunc(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s[8] = {'H', 'e', 'l', 'l', 'o', ' ', ' ', '\0'};
  printf("Original:\n\t[%s]\n", s);
  dummyfunc(s);
  printf("Changed:\n\t[%s]\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0xc(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <dummyfunc@plt>
lea    -0xc(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x20206f6c6c6548,%rax
mov    %rax,0x8(%rsp)
lea    0xec5(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <dummyfunc@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [8 x i8] c"Hello \00"
@.str = [17 x i8] c"Original:\0A\09[%s]\0A\00"
@.str.1 = [16 x i8] c"Changed:\0A\09[%s]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = bitcast [8 x i8]* %2 to i8*
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%7 = call i32 @dummyfunc(i8* %6)
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Original:\0A\09[%s]\0A\00"
@.str.1 = [16 x i8] c"Changed:\0A\09[%s]\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 9042862187242824, i64* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @dummyfunc(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ c(char *);
void __attribute__((constructor)) initD() { c("initD"); }


x86 assembly (clang, -O0):
<initD>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <c@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initD>:
lea    0xee9(%rip),%rdi
jmp    1030 <c@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"initD\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initD, i8* null }]
define void @initD() {
%1 = call i32 @c(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"initD\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initD, i8* null }]
define void @initD() {
%1 = tail call i32 @c(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int f(unsigned int a, unsigned int b, unsigned int c) {
  a += (unsigned short)b * (c >> 16);
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
mov    -0xc(%rbp),%ecx
shr    $0x10,%ecx
imul   %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movzwl %si,%eax
shr    $0x10,%edx
imul   %edx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = trunc i32 %7 to i16
%9 = zext i16 %8 to i32
%10 = load i32, i32* %6
%11 = lshr i32 %10, 16
%12 = mul i32 %9, %11
%13 = load i32, i32* %4
%14 = add i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 65535
%5 = lshr i32 %2, 16
%6 = mul nuw i32 %5, %4
%7 = add i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 3;
  int b = 4;
  if (a > b) {
    a = 3;
    printf("a > b\n");
  } else {
    printf("a <= b\n");
  }
  if (a <= b) {
    printf("a <= b\n");
  } else {
    printf("a > b\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1151 <main+0x41>
movl   $0x3,-0x8(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <main+0x4d>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     117a <main+0x6a>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x76>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str.2 = [7 x i8] c"a <= b\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ch8_HIGH() { printf("Error: ch8_HIGH not yet implemented\n"); }


x86 assembly (clang, -O0):
<ch8_HIGH>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch8_HIGH>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Error: ch8_HIGH not yet implemented\0A\00"
define void @ch8_HIGH() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Error: ch8_HIGH not yet implemented\00"
define void @ch8_HIGH() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_to_console(char *, int, int, int);
void print_param_err() {
  write_to_console("Param error: try \"picalc -h\"\n", 0x1, 1, 1);
}


x86 assembly (clang, -O0):
<print_param_err>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <write_to_console@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_param_err>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
jmp    1030 <write_to_console@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Param error: try \22picalc -h\22\0A\00"
define void @print_param_err() {
%1 = call i32 @write_to_console(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Param error: try \22picalc -h\22\0A\00"
define void @print_param_err() {
%1 = tail call i32 @write_to_console(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ printf(char *, char *);
char *stpcpy(char *, char *);
int main(void) {
  char buffer[256];
  bzero(buffer, 256);
  char *to = buffer;
  to = stpcpy(to, "foo");
  to = stpcpy(to, "bar");
  printf("%s\n", buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
call   1050 <bzero@plt>
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <stpcpy@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1030 <stpcpy@plt>
mov    %rax,-0x108(%rbp)
lea    -0x100(%rbp),%rsi
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <bzero@plt>
movl   $0x6f6f66,(%rsp)
movl   $0x726162,0x3(%rsp)
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@.str.1 = [4 x i8] c"bar\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @bzero(i8* %3, i32 256)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @stpcpy(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i8* @stpcpy(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %2
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @bzero(i8* %2, i32 256)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 3
%5 = bitcast [256 x i8]* %1 to i32*
store i32 7303014, i32* %5
%6 = bitcast i8* %4 to i32*
store i32 7496034, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
void ff_hevc_put_hevc_bi_w_qpel_hv24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv24_10_sse4() {
ret void
}
unsigned int usb_checkgecko() {
  unsigned int i = 0;
  *(volatile unsigned int *)0xCC006814 = 0x000000D0;
  *(volatile unsigned int *)0xCC006824 = 0x90000000;
  *(volatile unsigned int *)0xCC006820 = 0x19;
  while ((*(volatile unsigned int *)0xCC006820) & 1)
    ;
  i = *(volatile unsigned int *)0xCC006824;
  *(volatile unsigned int *)0xCC006814 = 0x0;
  if (i == 0x04700000) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<usb_checkgecko>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
mov    $0xcc006814,%eax
movl   $0xd0,(%rax)
mov    $0xcc006824,%eax
movl   $0x90000000,(%rax)
mov    $0xcc006820,%eax
movl   $0x19,(%rax)
mov    $0xcc006820,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1144 <usb_checkgecko+0x44>
jmp    112c <usb_checkgecko+0x2c>
mov    $0xcc006824,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcc006814,%eax
movl   $0x0,(%rax)
cmpl   $0x4700000,-0x8(%rbp)
jne    1172 <usb_checkgecko+0x72>
movl   $0x1,-0x4(%rbp)
jmp    1179 <usb_checkgecko+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_checkgecko>:
mov    $0xcc006814,%eax
movl   $0xd0,(%rax)
movl   $0x90000000,0x10(%rax)
movl   $0x19,0xc(%rax)
nopl   0x0(%rax)
mov    0xc(%rax),%ecx
test   $0x1,%cl
jne    1120 <usb_checkgecko+0x20>
mov    0x10(%rax),%ecx
movl   $0x0,(%rax)
xor    %eax,%eax
cmp    $0x4700000,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @usb_checkgecko() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store volatile i32 208, i32* inttoptr (i64 3422578708 to i32*)
store volatile i32 -1879048192, i32* inttoptr (i64 3422578724 to i32*)
store volatile i32 25, i32* inttoptr (i64 3422578720 to i32*)
br label %3
3: ; preds = %7, %0
%4 = load volatile i32, i32* inttoptr (i64 3422578720 to i32*)
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load volatile i32, i32* inttoptr (i64 3422578724 to i32*)
store i32 %9, i32* %2
store volatile i32 0, i32* inttoptr (i64 3422578708 to i32*)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 74448896
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %1
br label %14
13: ; preds = %8
store i32 0, i32* %1
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @usb_checkgecko() {
store volatile i32 208, i32* inttoptr (i64 3422578708 to i32*)
store volatile i32 -1879048192, i32* inttoptr (i64 3422578724 to i32*)
store volatile i32 25, i32* inttoptr (i64 3422578720 to i32*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 3422578720 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 3422578724 to i32*)
store volatile i32 0, i32* inttoptr (i64 3422578708 to i32*)
%7 = icmp eq i32 %6, 74448896
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int square(int);
int is(int n) {
  int a = n % 100;
  int b = (n - a) / 100;
  return n == square(a + b);
}


x86 assembly (clang, -O0):
<is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
call   1030 <square@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is>:
push   %rbx
movslq %edi,%rbx
imul   $0x51eb851f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %ebx,%edi
sub    %ecx,%edi
add    %eax,%edi
call   1030 <square@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = srem i32 %5, 100
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = sdiv i32 %9, 100
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = call i32 @square(i32 %14)
%16 = icmp eq i32 %11, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @is(i32 %0) {
%2 = srem i32 %0, 100
%3 = sdiv i32 %0, 100
%4 = add nsw i32 %2, %3
%5 = tail call i32 @square(i32 %4)
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
void kms_crypto_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @kms_crypto_cleanup() {
ret void
}
int test_imm_AFint64_midword_reg(long long val) {
  return ((val >> 16) & (0xAF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_AFint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 175
%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_AFint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11468800
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("welcome to this code "); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"welcome to this code \00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"welcome to this code \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned char petcii_fix_dupes(unsigned char c) {
  if ((c >= 0x60) && (c <= 0x7f)) {
    return ((c - 0x60) + 0xc0);
  } else if (c >= 0xe0) {
    return ((c - 0xe0) + 0xa0);
  }
  return c;
}


x86 assembly (clang, -O0):
<petcii_fix_dupes>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x60,%eax
jl     1138 <petcii_fix_dupes+0x38>
movzbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jg     1138 <petcii_fix_dupes+0x38>
movzbl -0x2(%rbp),%eax
sub    $0x60,%eax
add    $0xc0,%eax
mov    %al,-0x1(%rbp)
jmp    1168 <petcii_fix_dupes+0x68>
movzbl -0x2(%rbp),%eax
cmp    $0xe0,%eax
jl     115d <petcii_fix_dupes+0x5d>
movzbl -0x2(%rbp),%eax
sub    $0xe0,%eax
add    $0xa0,%eax
mov    %al,-0x1(%rbp)
jmp    1168 <petcii_fix_dupes+0x68>
jmp    1162 <petcii_fix_dupes+0x62>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<petcii_fix_dupes>:
lea    0x60(%rdi),%eax
lea    -0x40(%rdi),%ecx
cmp    $0xe0,%dil
movzbl %cl,%ecx
cmovb  %edi,%ecx
cmp    $0x60,%dil
movzbl %al,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @petcii_fix_dupes(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 96
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 127
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 96
%15 = add nsw i32 %14, 192
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %30
17: ; preds = %7, %1
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = icmp sge i32 %19, 224
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = sub nsw i32 %23, 224
%25 = add nsw i32 %24, 160
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
br label %30
27: ; preds = %17
br label %28
28: ; preds = %27
%29 = load i8, i8* %3
store i8 %29, i8* %2
br label %30
30: ; preds = %28, %21, %11
%31 = load i8, i8* %2
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @petcii_fix_dupes(i8 zeroext %0) {
%2 = icmp sgt i8 %0, 95
%3 = add i8 %0, 96
%4 = icmp ugt i8 %0, -33
%5 = add i8 %0, -64
%6 = select i1 %4, i8 %5, i8 %0
%7 = select i1 %2, i8 %3, i8 %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int get_array(int a[]) {
  int i, n;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  return n;
}


x86 assembly (clang, -O0):
<get_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1168 <get_array+0x58>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1030 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <get_array+0x23>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_array>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r15
lea    0xedd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    115d <get_array+0x4d>
xor    %ebx,%ebx
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1140 <get_array+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @get_array(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %3
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @get_array(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1, %7
%8 = phi i64 [ %11, %7 ], [ 0, %1 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %1
%16 = phi i32 [ %5, %1 ], [ %12, %7 ]
ret i32 %16
}
int s3c6400_pm_init(void) { return 0; }


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

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

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

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