xunge/DecIR huggingface dataset:
/* Variables and functions */
int fibonacci(int);
int fibonacci_iter(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", fibonacci(10));
  printf("%d\n", fibonacci_iter(10));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <fibonacci@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <fibonacci_iter@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
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 @fibonacci(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @fibonacci_iter(i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fibonacci(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @fibonacci_iter(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ call6c(int, long, float, double, unsigned char,
                          unsigned short, unsigned int, unsigned long);
void call6b(short s, int i, long l, float f, double d, unsigned char uc,
            unsigned short us, unsigned int ui, unsigned long ul) {
  s = s;
  call6c(i, l, f, d, uc, us, ui, ul);
}


x86 assembly (clang, -O0):
<call6b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8w,%ax
mov    0x10(%rbp),%r8
mov    %di,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %cl,-0x21(%rbp)
mov    %ax,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x2(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x21(%rbp),%cl
mov    -0x24(%rbp),%ax
mov    -0x28(%rbp),%r8d
mov    0x10(%rbp),%r9
movzbl %cl,%edx
movzwl %ax,%ecx
call   1030 <call6c@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call6b>:
mov    %r9d,%eax
mov    %esi,%edi
mov    0x8(%rsp),%r9
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %eax,%r8d
jmp    1030 <call6c@plt>

LLVM IR (-O0):
define void @call6b(i16 signext %0, i32 %1, i64 %2, float %3, double %4, i8 zeroext %5, i16 zeroext %6, i32 %7, i64 %8) {
%10 = alloca i16
%11 = alloca i32
%12 = alloca i64
%13 = alloca float
%14 = alloca double
%15 = alloca i8
%16 = alloca i16
%17 = alloca i32
%18 = alloca i64
store i16 %0, i16* %10
store i32 %1, i32* %11
store i64 %2, i64* %12
store float %3, float* %13
store double %4, double* %14
store i8 %5, i8* %15
store i16 %6, i16* %16
store i32 %7, i32* %17
store i64 %8, i64* %18
%19 = load i16, i16* %10
store i16 %19, i16* %10
%20 = load i32, i32* %11
%21 = load i64, i64* %12
%22 = load float, float* %13
%23 = load double, double* %14
%24 = load i8, i8* %15
%25 = load i16, i16* %16
%26 = load i32, i32* %17
%27 = load i64, i64* %18
%28 = call i32 @call6c(i32 %20, i64 %21, float %22, double %23, i8 zeroext %24, i16 zeroext %25, i32 %26, i64 %27)
ret void
}

LLVM IR (-O2):
define void @call6b(i16 signext %0, i32 %1, i64 %2, float %3, double %4, i8 zeroext %5, i16 zeroext %6, i32 %7, i64 %8) {
%10 = tail call i32 @call6c(i32 %1, i64 %2, float %3, double %4, i8 zeroext %5, i16 zeroext %6, i32 %7, i64 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *get_array1(int *, int);
int /*<<< orphan*/ stderr;
void rd_loop(int loop[31]) {
  char *cp;
  cp = get_array1(loop, 31);
  if (cp) {
    fprintf(stderr, "\nrd_loop: %s\n", cp);
    exit(1);
  }
  return;
}


x86 assembly (clang, -O0):
<rd_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1f,%esi
call   1040 <get_array1@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117c <rd_loop+0x4c>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_loop>:
push   %rax
mov    $0x1f,%esi
call   1040 <get_array1@plt>
test   %rax,%rax
jne    1142 <rd_loop+0x12>
pop    %rax
ret
mov    0x2e97(%rip),%rcx
mov    (%rcx),%edi
lea    0xeae(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"\0Ard_loop: %s\0A\00"
define void @rd_loop(i32* %0) {
%2 = tail call i8* @get_array1(i32* %0, i32 31)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
void SysTickIntEnable(void) {
  (*((volatile unsigned long *)(0xE000E010))) |= 0x00000002;
}


x86 assembly (clang, -O0):
<SysTickIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0xe000e010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickIntEnable>:
mov    $0xe000e010,%eax
orq    $0x2,(%rax)
ret

LLVM IR (-O0):
define void @SysTickIntEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysTickIntEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}
unsigned xrop3_175_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~T;
  stk1 = D | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_175_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_175_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_175_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %5
%25 = load i32, i32* %9
%26 = or i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = xor i32 %28, -1
%30 = and i32 %27, %29
%31 = load i32, i32* %7
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %7
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_175_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
void qd_minus(double *a) {
  a[0] = -a[0];
  a[1] = -a[1];
  a[2] = -a[2];
  a[3] = -a[3];
}


x86 assembly (clang, -O0):
<qd_minus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_minus>:
movaps 0xef9(%rip),%xmm0
movups (%rdi),%xmm1
movups 0x10(%rdi),%xmm2
xorps  %xmm0,%xmm1
movups %xmm1,(%rdi)
xorps  %xmm0,%xmm2
movups %xmm2,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @qd_minus(double* nocapture %0) {
%2 = bitcast double* %0 to <2 x double>*
%3 = load <2 x double>, <2 x double>* %2
%4 = fneg <2 x double> %3
%5 = bitcast double* %0 to <2 x double>*
store <2 x double> %4, <2 x double>* %5
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = bitcast double* %6 to <2 x double>*
%8 = load <2 x double>, <2 x double>* %7
%9 = fneg <2 x double> %8
%10 = bitcast double* %6 to <2 x double>*
store <2 x double> %9, <2 x double>* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_exec_t(char **, int /*<<< orphan*/, int,
                                 int /*<<< orphan*/ *);
int /*<<< orphan*/ print_dec(int /*<<< orphan*/);
char **strsplit(char *, char *, int *);
int main() {
  int num;
  char **tokens = strsplit("echo 2+5 | bc | grep 7 | cat", " ", &num);
  print_dec(create_exec_t(tokens, 0, num, NULL));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed7(%rip),%rsi
lea    -0x4(%rbp),%rdx
call   1050 <strsplit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <create_exec_t@plt>
mov    %eax,%edi
call   1030 <print_dec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xede(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1050 <strsplit@plt>
mov    0x4(%rsp),%edx
mov    %rax,%rdi
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <create_exec_t@plt>
mov    %eax,%edi
call   1030 <print_dec@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"echo 2+5 | bc | grep 7 | cat\00"
@.str.1 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8**
%3 = call i8** @strsplit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
store i8** %3, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i32, i32* %1
%6 = call i32 @create_exec_t(i8** %4, i32 0, i32 %5, i32* null)
%7 = call i32 @print_dec(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"echo 2+5 | bc | grep 7 | cat\00"
@.str.1 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i8** @strsplit(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @create_exec_t(i8** %3, i32 0, i32 %4, i32* null)
%6 = call i32 @print_dec(i32 %5)
ret i32 0
}
int batadv_mcast_init(struct batadv_priv *bat_priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.batadv_priv = type opaque
define i32 @batadv_mcast_init(%struct.batadv_priv* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int syscall(long, long, void *, unsigned long, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
int write(long fd, void *buffer, unsigned long size) {
  return syscall(1L, fd, buffer, size, 0, 0, 0);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
movl   $0x0,(%rsp)
mov    $0x1,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @write(i64 %0, i8* %1, i64 %2) {
%4 = tail call i32 @syscall(i64 1, i64 %0, i8* %1, i64 %2, i32 0, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PLATFORM_printf(char *msg) { printf(msg); }


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

x86 assembly (clang, -O2):
<PLATFORM_printf>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @PLATFORM_printf(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
void store(volatile int *var) {
  asm volatile("");
  (*var) = 1;
}


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

x86 assembly (clang, -O2):
<store>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @store(i32* %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
store volatile i32 1, i32* %0
ret void
}
char deref_pointer(char *p) { return *p; }


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

x86 assembly (clang, -O2):
<deref_pointer>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @deref_pointer(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float f = (float)1 / (float)10;
  printf("%.28f\n", f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%.28f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float 0x3FB99999A0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_eoi(int);
int /*<<< orphan*/ parallel_set_eoi(int);
void parallel_emu_set_eoi(unsigned char val) {
  if (val) {
    parallel_set_eoi(0x01);
  } else {
    parallel_clr_eoi(~0x01);
  }
}


x86 assembly (clang, -O0):
<parallel_emu_set_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_emu_set_eoi+0x27>
mov    $0x1,%edi
call   1040 <parallel_set_eoi@plt>
jmp    1151 <parallel_emu_set_eoi+0x31>
mov    $0xfffffffe,%edi
call   1030 <parallel_clr_eoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_emu_set_eoi>:
test   %edi,%edi
je     112e <parallel_emu_set_eoi+0xe>
mov    $0x1,%edi
jmp    1040 <parallel_set_eoi@plt>
mov    $0xfffffffe,%edi
jmp    1030 <parallel_clr_eoi@plt>

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

LLVM IR (-O2):
define void @parallel_emu_set_eoi(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_eoi(i32 1)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_eoi(i32 -2)
br label %7
7: ; preds = %5, %3
ret void
}
int xmlUCSIsKanbun(int code) {
  return (((code >= 0x3190) && (code <= 0x319F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsKanbun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x3190,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsKanbun+0x26>
cmpl   $0x319f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsKanbun>:
and    $0xfffffff0,%edi
xor    %eax,%eax
cmp    $0x3190,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsKanbun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 12688
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 12703
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsKanbun(i32 %0) {
%2 = and i32 %0, -16
%3 = icmp eq i32 %2, 12688
%4 = zext i1 %3 to i32
ret i32 %4
}
double f4_cb_send_pre_int_int_float(double (*cb)(int, int, float)) {
  float r = 55.0;
  return cb(8, 9, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
call   *%rax
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_float>:
push   %rax
mov    %rdi,%rax
movss  0xef4(%rip),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
call   *%rax
addsd  0xee8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_float(double (i32, i32, float)* %0) {
%2 = alloca double (i32, i32, float)*
%3 = alloca float
store double (i32, i32, float)* %0, double (i32, i32, float)** %2
store float 5.500000e+01, float* %3
%4 = load double (i32, i32, float)*, double (i32, i32, float)** %2
%5 = load float, float* %3
%6 = call double %4(i32 8, i32 9, float %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_float(double (i32, i32, float)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, float 5.500000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Shuffle_array(int *, int);
int /*<<< orphan*/ _optimize_quick_sort(int *, int /*<<< orphan*/, int);
void optimize_quick_sort(int *array, int length) {
  Shuffle_array(array, length);
  _optimize_quick_sort(array, 0, length - 1);
}


x86 assembly (clang, -O0):
<optimize_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <Shuffle_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <_optimize_quick_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optimize_quick_sort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <Shuffle_array@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <_optimize_quick_sort@plt>

LLVM IR (-O0):
define void @optimize_quick_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @Shuffle_array(i32* %5, i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = call i32 @_optimize_quick_sort(i32* %8, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @optimize_quick_sort(i32* %0, i32 %1) {
%3 = tail call i32 @Shuffle_array(i32* %0, i32 %1)
%4 = add nsw i32 %1, -1
%5 = tail call i32 @_optimize_quick_sort(i32* %0, i32 0, i32 %4)
ret void
}
/* Variables and functions */
char getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void getc_t() {
  char c;
  printf("Enter character: ");
  c = getc(stdin);
  printf("Character entered: ");
  putc(c, stdout);
}


x86 assembly (clang, -O0):
<getc_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %al,-0x1(%rbp)
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1(%rbp),%al
mov    0x2e6d(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc_t>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %eax,%ebx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
movsbl %bl,%edi
pop    %rbx
jmp    1040 <putc@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Enter character: \00"
@stdin = global i32 0
@.str.1 = [20 x i8] c"Character entered: \00"
@stdout = global i32 0
define void @getc_t() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = call signext i8 @getc(i32 %3)
store i8 %4, i8* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8, i8* %1
%7 = load i32, i32* @stdout
%8 = call i32 @putc(i8 signext %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter character: \00"
@stdin = global i32 0
@.str.1 = [20 x i8] c"Character entered: \00"
@stdout = global i32 0
define void @getc_t() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = tail call signext i8 @getc(i32 %2)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @putc(i8 signext %3, i32 %5)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t TimerPrescaleMatchGet(uint32_t ui32Base, uint32_t ui32Timer) {
  ;
  ;
  return ((ui32Timer == 0x000000FF)
              ? (*((volatile unsigned long *)(ui32Base + 0x00000040)))
              : (*((volatile unsigned long *)(ui32Base + 0x00000044))));
}


x86 assembly (clang, -O0):
<TimerPrescaleMatchGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jne    112b <TimerPrescaleMatchGet+0x2b>
mov    -0x4(%rbp),%eax
add    $0x40,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    113a <TimerPrescaleMatchGet+0x3a>
mov    -0x4(%rbp),%eax
add    $0x44,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerPrescaleMatchGet>:
xor    %eax,%eax
cmp    $0xff,%esi
setne  %al
lea    0x40(,%rax,4),%eax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%rax
ret

LLVM IR (-O0):
define i32 @TimerPrescaleMatchGet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 64
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
br label %19
13: ; preds = %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 68
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
br label %19
19: ; preds = %13, %7
%20 = phi i64 [ %12, %7 ], [ %18, %13 ]
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @TimerPrescaleMatchGet(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 255
%4 = select i1 %3, i32 64, i32 68
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
int Cyc_BansheeIf_add_all_constraints(struct Cyc_List_List *assoc) { ; }


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

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

LLVM IR (-O0):
%struct.Cyc_List_List = type opaque
define i32 @Cyc_BansheeIf_add_all_constraints(%struct.Cyc_List_List* %0) {
%2 = alloca i32
%3 = alloca %struct.Cyc_List_List*
store %struct.Cyc_List_List* %0, %struct.Cyc_List_List** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.Cyc_List_List = type opaque
define i32 @Cyc_BansheeIf_add_all_constraints(%struct.Cyc_List_List* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void showTermExceedsMaximumValueMessage(char *value) {
  fprintf(stderr,
          "Numeral string '%s' exceeds maximum allowable value of 3999.\n",
          value);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"Numeral string '%s' exceeds maximum allowable value of 3999.\0A\00"
define void @showTermExceedsMaximumValueMessage(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 ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"Numeral string '%s' exceeds maximum allowable value of 3999.\0A\00"
define void @showTermExceedsMaximumValueMessage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ point(int);
int real(char *s) {
  if (s == 0)
    return (0);
  if (!point((int)s))
    return (1);
  if (*s == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <real+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1176 <real+0x66>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <point@plt>
cmp    $0x0,%eax
jne    1153 <real+0x43>
movl   $0x1,-0x4(%rbp)
jmp    1176 <real+0x66>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116f <real+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    1176 <real+0x66>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real>:
push   %rbx
test   %rdi,%rdi
je     112c <real+0x1c>
mov    %rdi,%rbx
call   1030 <point@plt>
test   %eax,%eax
je     1130 <real+0x20>
xor    %eax,%eax
cmpb   $0x0,(%rbx)
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @real(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %20
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %8 to i32
%10 = call i32 @point(i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %7
store i32 1, i32* %2
br label %20
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 0, i32* %2
br label %20
19: ; preds = %13
store i32 1, i32* %2
br label %20
20: ; preds = %19, %18, %12, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @real(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @point(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = load i8, i8* %0
%10 = icmp ne i8 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %11, %8 ]
ret i32 %13
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long quot;
  long rem;
};
typedef TYPE_1__ ldiv_t;

/* Variables and functions */
ldiv_t ldiv(long int numer, long int denom) {
  ldiv_t ans;
  ans.quot = numer / denom;
  ans.rem = numer - ans.quot * denom;
  return ans;
}


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

x86 assembly (clang, -O2):
<ldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <ldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%12 = load i64, i64* %11
%13 = load i64, i64* %5
%14 = mul nsw i64 %12, %13
%15 = sub nsw i64 %10, %14
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %15, i64* %16
%17 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%18 = load { i64, i64 }, { i64, i64 }* %17
ret { i64, i64 } %18
}

LLVM IR (-O2):
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = mul nsw i64 %3, %1
%5 = srem i64 %0, %1
%6 = insertvalue { i64, i64 } poison, i64 %3, 0
%7 = insertvalue { i64, i64 } %6, i64 %5, 1
ret { i64, i64 } %7
}
/* Type definitions */
struct AstNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ declarator();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ typeSpec();
struct AstNode *paramDecl() {
  printf("in paramDecl\n");
  typeSpec();
  declarator();
  return NULL;
}


x86 assembly (clang, -O0):
<paramDecl>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <typeSpec@plt>
mov    $0x0,%al
call   1050 <declarator@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<paramDecl>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <typeSpec@plt>
xor    %eax,%eax
call   1050 <declarator@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.AstNode = type { i32 }
@.str = [14 x i8] c"in paramDecl\0A\00"
define %struct.AstNode* @paramDecl() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @typeSpec()
%3 = call i32 (...) @declarator()
ret %struct.AstNode* null
}

LLVM IR (-O2):
%struct.AstNode = type { i32 }
@str = [13 x i8] c"in paramDecl\00"
define noalias %struct.AstNode* @paramDecl() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @typeSpec()
%3 = tail call i32 (...) @declarator()
ret %struct.AstNode* null
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void wrmsr() {
  db(0x0F);
  db(0x30);
}


x86 assembly (clang, -O0):
<wrmsr>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x30,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrmsr>:
push   %rax
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x30,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @wrmsr() {
%1 = call i32 @db(i32 15)
%2 = call i32 @db(i32 48)
ret void
}

LLVM IR (-O2):
define void @wrmsr() {
%1 = tail call i32 @db(i32 15)
%2 = tail call i32 @db(i32 48)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ turn_led_off_tir(int);
int /*<<< orphan*/ turn_led_on_tir(int);
void switch_blue(bool state) {
  if (state) {
    turn_led_on_tir(0x40);
  } else {
    turn_led_off_tir(0x40);
  }
}


x86 assembly (clang, -O0):
<switch_blue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <switch_blue+0x24>
mov    $0x40,%edi
call   1030 <turn_led_on_tir@plt>
jmp    114e <switch_blue+0x2e>
mov    $0x40,%edi
call   1040 <turn_led_off_tir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_blue>:
test   %edi,%edi
je     112e <switch_blue+0xe>
mov    $0x40,%edi
jmp    1030 <turn_led_on_tir@plt>
mov    $0x40,%edi
jmp    1040 <turn_led_off_tir@plt>

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

LLVM IR (-O2):
define void @switch_blue(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @turn_led_on_tir(i32 64)
br label %7
5: ; preds = %1
%6 = tail call i32 @turn_led_off_tir(i32 64)
br label %7
7: ; preds = %5, %3
ret void
}
void p1(void) { printf((void *)0); }


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

x86 assembly (clang, -O2):
<p1>:
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @p1() {
%1 = call i32 (i8*, ...) @printf(i8* null)
ret void
}

LLVM IR (-O2):
define void @p1() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rotateLeft(int /*<<< orphan*/);
uint64_t rotateNibbles(uint64_t state) {
  int i;
  for (i = 0; i < 16; i++) {
    state = rotateLeft(state);
  }
  return state;
}


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

x86 assembly (clang, -O2):
<rotateNibbles>:
push   %rax
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
call   1030 <rotateLeft@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <rotateLeft@plt>

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

LLVM IR (-O2):
define i32 @rotateNibbles(i32 %0) {
%2 = tail call i32 @rotateLeft(i32 %0)
%3 = tail call i32 @rotateLeft(i32 %2)
%4 = tail call i32 @rotateLeft(i32 %3)
%5 = tail call i32 @rotateLeft(i32 %4)
%6 = tail call i32 @rotateLeft(i32 %5)
%7 = tail call i32 @rotateLeft(i32 %6)
%8 = tail call i32 @rotateLeft(i32 %7)
%9 = tail call i32 @rotateLeft(i32 %8)
%10 = tail call i32 @rotateLeft(i32 %9)
%11 = tail call i32 @rotateLeft(i32 %10)
%12 = tail call i32 @rotateLeft(i32 %11)
%13 = tail call i32 @rotateLeft(i32 %12)
%14 = tail call i32 @rotateLeft(i32 %13)
%15 = tail call i32 @rotateLeft(i32 %14)
%16 = tail call i32 @rotateLeft(i32 %15)
%17 = tail call i32 @rotateLeft(i32 %16)
ret i32 %17
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmpstrptr(const void *_x, const void *_y) {
  const char *x = *(const char **)_x;
  const char *y = *(const char **)_y;
  return strcmp(x, y);
}


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

x86 assembly (clang, -O2):
<cmpstrptr>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmpstrptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmpstrptr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ aes_fifos(void *, void *, size_t);
void _decrypt(uint32_t value, void *inbuf, void *outbuf, size_t blocks) {
  *((volatile uint32_t *)0x10009000) = 0;
  *((volatile uint32_t *)0x10009004) = blocks << 16;
  *((volatile uint32_t *)0x10009000) = value | 0x80000000 | 0x02000000 |
                                       0x01000000 | 0x00800000 | 0x00400000 |
                                       0x00000800 | 0x00000400;
  aes_fifos(inbuf, outbuf, blocks);
}


x86 assembly (clang, -O0):
<_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x10009000,%eax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
shl    $0x10,%rax
mov    %eax,%ecx
mov    $0x10009004,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
or     $0x80000000,%ecx
or     $0x2000000,%ecx
or     $0x1000000,%ecx
or     $0x800000,%ecx
or     $0x400000,%ecx
or     $0x800,%ecx
or     $0x400,%ecx
mov    $0x10009000,%eax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <aes_fifos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_decrypt>:
mov    %rdx,%rax
movl   $0x0,0x10009000
mov    %ecx,%edx
shl    $0x10,%edx
mov    %edx,0x10009004
or     $0x83c00c00,%edi
mov    %edi,0x10009000
mov    %rcx,%rdx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <aes_fifos@plt>

LLVM IR (-O0):
define void @_decrypt(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
store volatile i32 0, i32* inttoptr (i64 268472320 to i32*)
%9 = load i64, i64* %8
%10 = shl i64 %9, 16
%11 = trunc i64 %10 to i32
store volatile i32 %11, i32* inttoptr (i64 268472324 to i32*)
%12 = load i32, i32* %5
%13 = or i32 %12, -2147483648
%14 = or i32 %13, 33554432
%15 = or i32 %14, 16777216
%16 = or i32 %15, 8388608
%17 = or i32 %16, 4194304
%18 = or i32 %17, 2048
%19 = or i32 %18, 1024
store volatile i32 %19, i32* inttoptr (i64 268472320 to i32*)
%20 = load i8*, i8** %6
%21 = load i8*, i8** %7
%22 = load i64, i64* %8
%23 = call i32 @aes_fifos(i8* %20, i8* %21, i64 %22)
ret void
}

LLVM IR (-O2):
define void @_decrypt(i32 %0, i8* %1, i8* %2, i64 %3) {
store volatile i32 0, i32* inttoptr (i64 268472320 to i32*)
%5 = trunc i64 %3 to i32
%6 = shl i32 %5, 16
store volatile i32 %6, i32* inttoptr (i64 268472324 to i32*)
%7 = or i32 %0, -2084566016
store volatile i32 %7, i32* inttoptr (i64 268472320 to i32*)
%8 = tail call i32 @aes_fifos(i8* %1, i8* %2, i64 %3)
ret void
}
unsigned xrop3_217_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T & S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_217_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_217_1_1>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%esi
not    %edi
shl    $0x8,%edi
not    %eax
and    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_217_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %7
%39 = xor i32 %38, -1
%40 = and i32 %37, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = and i32 %41, %42
%44 = or i32 %40, %43
%45 = load i32, i32* %5
%46 = load i32, i32* %7
%47 = and i32 %45, %46
%48 = or i32 %44, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @xrop3_217_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = xor i32 %3, -1
%7 = shl nsw i32 %6, 8
%8 = xor i32 %5, -1
%9 = and i32 %7, %8
%10 = or i8 %1, %0
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
ret i32 %12
}