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

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_clkgr0(void) { return readl((void *)0xb0000000 + (0x20)); }


x86 assembly (clang, -O0):
<read_clkgr0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000000,%edi
add    $0x20,%rdi
call   1030 <readl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_clkgr0>:
mov    $0xb0000020,%edi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_clkgr0() {
%1 = call i32 @readl(i8* getelementptr (i8, i8* inttoptr (i64 2952790016 to i8*), i64 32))
ret i32 %1
}

LLVM IR (-O2):
define i32 @read_clkgr0() {
%1 = tail call i32 @readl(i8* inttoptr (i64 2952790048 to i8*))
ret i32 %1
}
void divvv(double *result, const double *s1) {
  result[0] /= s1[0];
  result[1] /= s1[1];
  result[2] /= s1[2];
}


x86 assembly (clang, -O0):
<divvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divvv>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
divsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
divsd  0x8(%rsi),%xmm1
movsd  %xmm1,0x8(%rdi)
movsd  0x10(%rdi),%xmm0
divsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @divvv(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fdiv double %4, %3
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fdiv double %9, %7
store double %10, double* %8
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = fdiv double %14, %12
store double %15, double* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int, int);
int /*<<< orphan*/ stdout;
void print_json_fork(int parent_pid, int parent_tgid, int child_pid,
                     int child_tgid) {
  fprintf(stdout,
          "{\"type\": \"fork\" \"parent_pid\": %d, "
          "\"parent_tgid\": %d, \"child_pid\": %d, "
          "\"child_tgid\": %d}\n",
          parent_pid, parent_tgid, child_pid, child_tgid);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_json_fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_json_fork>:
push   %rbx
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2eae(%rip),%rbx
mov    (%rbx),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [89 x i8] c"{\22type\22: \22fork\22 \22parent_pid\22: %d, \22parent_tgid\22: %d, \22child_pid\22: %d, \22child_tgid\22: %d}\0A\00"
define void @print_json_fork(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stdout
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* @stdout
%16 = call i32 @fflush(i32 %15)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [89 x i8] c"{\22type\22: \22fork\22 \22parent_pid\22: %d, \22parent_tgid\22: %d, \22child_pid\22: %d, \22child_tgid\22: %d}\0A\00"
define void @print_json_fork(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
ret void
}
unsigned int perfctr_cstatus_has_ictrs(unsigned int cstatus) {
  return (cstatus & (0x7F << 16));
}


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

x86 assembly (clang, -O2):
<perfctr_cstatus_has_ictrs>:
mov    %edi,%eax
and    $0x7f0000,%eax
ret

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

LLVM IR (-O2):
define i32 @perfctr_cstatus_has_ictrs(i32 %0) {
%2 = and i32 %0, 8323072
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ swap(int *, int *);
int main(void) {
  int n, m;
  scanf("%d%d", &n, &m);
  swap(&n, &m);
  printf("%d\n%d", n, m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [6 x i8] c"%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 100; i++) {
    printf("%d\n", fib(30));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1166 <main+0x46>
mov    $0x1e,%edi
call   1040 <fib@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x64,%ebp
lea    0xed1(%rip),%rbx
nop
mov    $0x1e,%edi
call   1040 <fib@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 @fib(i32 30)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @fib(i32 30)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Type definitions */
struct reefile_t {
  int dummy;
};

/* Variables and functions */
unsigned int openFile(void *f, const struct reefile_t *data_dump,
                      bool decrypt) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.reefile_t = type { i32 }
define i32 @openFile(i8* %0, %struct.reefile_t* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.reefile_t*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.reefile_t* %1, %struct.reefile_t** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.reefile_t = type { i32 }
define i32 @openFile(i8* nocapture readnone %0, %struct.reefile_t* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ add_sub_butterfly(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *const, int);
int /*<<< orphan*/ idct32_1024_8x32_quarter_1_2(int /*<<< orphan*/ const *const,
                                                int /*<<< orphan*/ *);
int /*<<< orphan*/ idct32_1024_8x32_quarter_3_4(int /*<<< orphan*/ const *const,
                                                int /*<<< orphan*/ *);
void idct32_1024_8x32(const __m128i *const in, __m128i *const out) {
  __m128i temp[32];
  idct32_1024_8x32_quarter_1_2(in, temp);
  idct32_1024_8x32_quarter_3_4(in, temp);
  add_sub_butterfly(temp, out, 32);
}


x86 assembly (clang, -O0):
<idct32_1024_8x32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1050 <idct32_1024_8x32_quarter_1_2@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1040 <idct32_1024_8x32_quarter_3_4@plt>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x20,%edx
call   1030 <add_sub_butterfly@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idct32_1024_8x32>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rsi
call   1050 <idct32_1024_8x32_quarter_1_2@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <idct32_1024_8x32_quarter_3_4@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1030 <add_sub_butterfly@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @idct32_1024_8x32(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [32 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%8 = call i32 @idct32_1024_8x32_quarter_1_2(i32* %6, i32* %7)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%11 = call i32 @idct32_1024_8x32_quarter_3_4(i32* %9, i32* %10)
%12 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%13 = load i32*, i32** %4
%14 = call i32 @add_sub_butterfly(i32* %12, i32* %13, i32 32)
ret void
}

LLVM IR (-O2):
define void @idct32_1024_8x32(i32* %0, i32* %1) {
%3 = alloca [32 x i32]
%4 = bitcast [32 x i32]* %3 to i8*
%5 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%6 = call i32 @idct32_1024_8x32_quarter_1_2(i32* %0, i32* %5)
%7 = call i32 @idct32_1024_8x32_quarter_3_4(i32* %0, i32* %5)
%8 = call i32 @add_sub_butterfly(i32* %5, i32* %1, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char name[48];
  printf("Please input your name: ");
  scanf("%s", name);
  printf("Hello, %s Mr./Mrs.!!\n", name);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Please input your name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [22 x i8] c"Hello, %s Mr./Mrs.!!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [48 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [48 x i8], [48 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [48 x i8], [48 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please input your name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [22 x i8] c"Hello, %s Mr./Mrs.!!\0A\00"
define i32 @main() {
%1 = alloca [48 x i8]
%2 = getelementptr inbounds [48 x i8], [48 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 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), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
void init_alphaTables() {}


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

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

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

LLVM IR (-O2):
define void @init_alphaTables() {
ret void
}
unsigned int wordstart(const char *text, unsigned int count) {
  unsigned int i;
  for (i = count; i > 0; i--) {
    if (text[i - 1] == ' ')
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<wordstart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jbe    114c <wordstart+0x4c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1139 <wordstart+0x39>
jmp    114c <wordstart+0x4c>
jmp    113e <wordstart+0x3e>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1111 <wordstart+0x11>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordstart>:
mov    %esi,%eax
add    $0xffffffffffffffff,%rax
cs nopw 0x0(%rax,%rax,1)
cmp    $0xffffffffffffffff,%rax
je     1126 <wordstart+0x26>
mov    %eax,%ecx
add    $0xffffffffffffffff,%rax
cmpb   $0x20,(%rdi,%rcx,1)
jne    1110 <wordstart+0x10>
add    $0x2,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @wordstart(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %7, %2
%5 = phi i64 [ %8, %7 ], [ %3, %2 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %4
%8 = add nsw i64 %5, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 32
br i1 %12, label %13, label %4
13: ; preds = %7
%14 = trunc i64 %5 to i32
br label %15
15: ; preds = %4, %13
%16 = phi i32 [ %14, %13 ], [ 0, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ emit(char *);
void generate_function_postamble(void) {
  emit("\n\t# **** FUNCTION POSTAMBLE ****\n");
  emit("\tleave   #restore stack frame\n");
  emit("\tret     #return from function call\n");
}


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

x86 assembly (clang, -O2):
<generate_function_postamble>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emit@plt>
lea    0xefe(%rip),%rdi
call   1030 <emit@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <emit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0A\09# **** FUNCTION POSTAMBLE ****\0A\00"
@.str.1 = [31 x i8] c"\09leave #restore stack frame\0A\00"
@.str.2 = [37 x i8] c"\09ret #return from function call\0A\00"
define void @generate_function_postamble() {
%1 = call i32 @emit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emit(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @emit(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0A\09# **** FUNCTION POSTAMBLE ****\0A\00"
@.str.1 = [31 x i8] c"\09leave #restore stack frame\0A\00"
@.str.2 = [37 x i8] c"\09ret #return from function call\0A\00"
define void @generate_function_postamble() {
%1 = tail call i32 @emit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emit(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @emit(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ena_term_unix();
void ena_term(void) { ena_term_unix(); }


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

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

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

LLVM IR (-O2):
define void @ena_term() {
%1 = tail call i32 (...) @ena_term_unix()
ret void
}
/* Variables and functions */
char *fptr_capi20ext_get_raw_devname(unsigned int, unsigned int, char *,
                                     size_t);
scalar_t__ loadlib();
char *capi20ext_get_raw_devname(unsigned applid, unsigned ncci, char *buf,
                                size_t size) {
  if (loadlib() < 0)
    return 0;
  return fptr_capi20ext_get_raw_devname(applid, ncci, buf, size);
}


x86 assembly (clang, -O0):
<capi20ext_get_raw_devname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <loadlib@plt>
cmp    $0x0,%rax
jge    1154 <capi20ext_get_raw_devname+0x34>
movq   $0x0,-0x8(%rbp)
jmp    116b <capi20ext_get_raw_devname+0x4b>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <fptr_capi20ext_get_raw_devname@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capi20ext_get_raw_devname>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <loadlib@plt>
test   %rax,%rax
js     1156 <capi20ext_get_raw_devname+0x36>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fptr_capi20ext_get_raw_devname@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @capi20ext_get_raw_devname(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%10 = call i64 (...) @loadlib()
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %4
store i8* null, i8** %5
br label %19
13: ; preds = %4
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i8*, i8** %8
%17 = load i64, i64* %9
%18 = call i8* @fptr_capi20ext_get_raw_devname(i32 %14, i32 %15, i8* %16, i64 %17)
store i8* %18, i8** %5
br label %19
19: ; preds = %13, %12
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @capi20ext_get_raw_devname(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i64 (...) @loadlib()
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i8* @fptr_capi20ext_get_raw_devname(i32 %0, i32 %1, i8* %2, i64 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i8* [ %8, %7 ], [ null, %4 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c;
  scanf("%d", &a);
  b = a * a;
  c = a * a * a;
  printf(" %d\n %d\n", b, c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c" %d\0A %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
float arc2pixel(int, int /*<<< orphan*/);
int /*<<< orphan*/ atanhf(int /*<<< orphan*/);
int /*<<< orphan*/ sinf(float);
float lat2pixel(int zoom, float lat) {
  return arc2pixel(zoom, -atanhf(sinf(lat)));
}


x86 assembly (clang, -O0):
<lat2pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <sinf@plt>
mov    %eax,%edi
call   1050 <atanhf@plt>
mov    -0xc(%rbp),%edi
xor    %esi,%esi
sub    %eax,%esi
call   1040 <arc2pixel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lat2pixel>:
push   %rbx
mov    %edi,%ebx
call   1030 <sinf@plt>
mov    %eax,%edi
call   1050 <atanhf@plt>
neg    %eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <arc2pixel@plt>

LLVM IR (-O0):
define float @lat2pixel(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = call i32 @sinf(float %6)
%8 = call i32 @atanhf(i32 %7)
%9 = sub nsw i32 0, %8
%10 = call float @arc2pixel(i32 %5, i32 %9)
ret float %10
}

LLVM IR (-O2):
define float @lat2pixel(i32 %0, float %1) {
%3 = tail call i32 @sinf(float %1)
%4 = tail call i32 @atanhf(i32 %3)
%5 = sub nsw i32 0, %4
%6 = tail call float @arc2pixel(i32 %0, i32 %5)
ret float %6
}
int isCorrectMod(long number) { return number % 3 == 2; }


x86 assembly (clang, -O0):
<isCorrectMod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
cqto
idiv   %rcx
cmp    $0x2,%rdx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCorrectMod>:
movabs $0x5555555555555556,%rcx
55 55 55
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
add    %rdx,%rax
lea    (%rax,%rax,2),%rax
sub    %rax,%rdi
xor    %eax,%eax
cmp    $0x2,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @isCorrectMod(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = srem i64 %3, 3
%5 = icmp eq i64 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isCorrectMod(i64 %0) {
%2 = srem i64 %0, 3
%3 = icmp eq i64 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ inet_addr(char const *);
int __attribute__((__unused__))
init_in_addr_t(in_addr_t *ip, const char *argv[]) {
  *ip = inet_addr(argv[0]);
  return 1;
}


x86 assembly (clang, -O0):
<init_in_addr_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <inet_addr@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_in_addr_t>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%rdi
call   1030 <inet_addr@plt>
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @init_in_addr_t(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @inet_addr(i8* %7)
%9 = load i32*, i32** %3
store i32 %8, i32* %9
ret i32 1
}

LLVM IR (-O2):
define i32 @init_in_addr_t(i32* nocapture writeonly %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @inet_addr(i8* %3)
store i32 %4, i32* %0
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t getblock32(const uint32_t *p, int i) {
  return p[i];
}


x86 assembly (clang, -O0):
<getblock32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getblock32>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getblock32(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getblock32(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int intCompare(const void *left, const void *right) {
  const int leftVal = *((const int *)left);
  const int rightVal = *((const int *)right);
  if (rightVal > leftVal) {
    return 1;
  } else if (leftVal > rightVal) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<intCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1136 <intCompare+0x36>
movl   $0x1,-0x4(%rbp)
jmp    115a <intCompare+0x5a>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <intCompare+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <intCompare+0x5a>
jmp    1153 <intCompare+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intCompare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setg   %dl
neg    %edx
cmp    %eax,%ecx
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @intCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, %4
%8 = icmp sgt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void hang() {
  asm("cli");
  asm("hlt");
  hang();
}


x86 assembly (clang, -O0):
<hang>:
push   %rbp
mov    %rsp,%rbp
cli
hlt
call   1030 <hang@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hang>:
cli
hlt
jmp    1100 <hang>

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

LLVM IR (-O2):
define void @hang() {
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
int test_imm_22uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x22 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_22uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2228224
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SYS_getrandom;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, unsigned char *, size_t,
                           int /*<<< orphan*/);
void __getrandom(unsigned char *buf, size_t buf_len) {
  syscall(SYS_getrandom, buf, buf_len, 0);
}


x86 assembly (clang, -O0):
<__getrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getrandom>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_getrandom = global i32 0
define void @__getrandom(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @SYS_getrandom
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @syscall(i32 %5, i8* %6, i64 %7, i32 0)
ret void
}

LLVM IR (-O2):
@SYS_getrandom = global i32 0
define void @__getrandom(i8* %0, i64 %1) {
%3 = load i32, i32* @SYS_getrandom
%4 = tail call i32 @syscall(i32 %3, i8* %0, i64 %1, i32 0)
ret void
}
ISR(TIMER1_COMPB_vect) {
  DEBUG("ISR "
        "TIMER1_COMPB"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"ISR TIMER1_COMPB occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [25 x i8] c"ISR TIMER1_COMPB occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
__attribute__((weak)) void PIOB_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @PIOB_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ ArgText();
char *TextOf(int /*<<< orphan*/);
int /*<<< orphan*/ rwhocli_userlogout(char *);
void Act_RwhoLogout(void) {
  char *name = TextOf(ArgText());
  rwhocli_userlogout(name);
}


x86 assembly (clang, -O0):
<Act_RwhoLogout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1050 <TextOf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rwhocli_userlogout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_RwhoLogout>:
push   %rax
xor    %eax,%eax
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1050 <TextOf@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <rwhocli_userlogout@plt>

LLVM IR (-O0):
define void @Act_RwhoLogout() {
%1 = alloca i8*
%2 = call i32 (...) @ArgText()
%3 = call i8* @TextOf(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @rwhocli_userlogout(i8* %4)
ret void
}

LLVM IR (-O2):
define void @Act_RwhoLogout() {
%1 = tail call i32 (...) @ArgText()
%2 = tail call i8* @TextOf(i32 %1)
%3 = tail call i32 @rwhocli_userlogout(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_get_usec() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_get_usec"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_usec\0A\00"
define i32 @pa_tagstruct_get_usec() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_usec\00"
define i32 @pa_tagstruct_get_usec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
OP(op, f7) { RST(0x30); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x30,%edi
mov    $0x0,%al
call   1030 <RST@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
mov    $0x30,%edi
xor    %eax,%eax
jmp    1030 <RST@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 48)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 48)
ret i32 undef
}
/* Variables and functions */
int luaL_findstring(char *, char **);
int /*<<< orphan*/ luaL_verror(char *, char *);
int luaI_checkevent(char *name, char *list[]) {
  int e = luaL_findstring(name, list);
  if (e < 0)
    luaL_verror("`%.50s' is not a valid event name", name);
  return e;
}


x86 assembly (clang, -O0):
<luaI_checkevent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <luaL_findstring@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115a <luaI_checkevent+0x3a>
mov    -0x8(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <luaL_verror@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaI_checkevent>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <luaL_findstring@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1140 <luaI_checkevent+0x20>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <luaL_verror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"`%.50s' is not a valid event name\00"
define i32 @luaI_checkevent(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = load i8**, i8*** %4
%8 = call i32 @luaL_findstring(i8* %6, i8** %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @luaL_verror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [34 x i8] c"`%.50s' is not a valid event name\00"
define i32 @luaI_checkevent(i8* %0, i8** %1) {
%3 = tail call i32 @luaL_findstring(i8* %0, i8** %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @luaL_verror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int count = 10;
  int result = 1;
  int i;
  for (i = 2; i < count; i += 1) {
    result *= i;
  }
  printf("%d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x58980,%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
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, %10
store i32 %12, i32* %3
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 362880)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ l_start_repl(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    l_start_repl(NULL);
  } else {
    l_start_repl(argv[1]);
  }
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    113e <main+0x2e>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <l_start_repl@plt>
jmp    114b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <l_start_repl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jge    111a <main+0xa>
xor    %edi,%edi
jmp    111e <main+0xe>
mov    0x8(%rsi),%rdi
call   1030 <l_start_repl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @l_start_repl(i8* null)
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @l_start_repl(i8* %13)
br label %15
15: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ null, %2 ]
%9 = tail call i32 @l_start_repl(i8* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
char mallocGarbage() {
  char *buf = malloc(2);
  char result = buf[1];
  free(buf);
  return result;
}


x86 assembly (clang, -O0):
<mallocGarbage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocGarbage>:
push   %rax
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define signext i8 @mallocGarbage() {
%1 = alloca i8*
%2 = alloca i8
%3 = call i8* @malloc(i32 2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
store i8 %6, i8* %2
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
%9 = load i8, i8* %2
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @mallocGarbage() {
%1 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%2 = tail call i32 @free(i8* %1)
ret i8 undef
}
/* Variables and functions */
float asin(int /*<<< orphan*/);
int /*<<< orphan*/ f_clamp(float, int, int);
float f_asin(float x) { return asin(f_clamp(x, -1, 1)); }


x86 assembly (clang, -O0):
<f_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <f_clamp@plt>
mov    %eax,%edi
call   1030 <asin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_asin>:
push   %rax
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <f_clamp@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <asin@plt>

LLVM IR (-O0):
define float @f_asin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @f_clamp(float %3, i32 -1, i32 1)
%5 = call float @asin(i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @f_asin(float %0) {
%2 = tail call i32 @f_clamp(float %0, i32 -1, i32 1)
%3 = tail call float @asin(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ initialize_datatypes();
int /*<<< orphan*/ initialize_lexer();
int /*<<< orphan*/ initialize_pstack();
int /*<<< orphan*/ initialize_symtab();
void initialize(void) {
  initialize_lexer();
  initialize_datatypes();
  initialize_symtab();
  initialize_pstack();
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initialize_lexer@plt>
mov    $0x0,%al
call   1060 <initialize_datatypes@plt>
mov    $0x0,%al
call   1040 <initialize_symtab@plt>
mov    $0x0,%al
call   1050 <initialize_pstack@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %rax
xor    %eax,%eax
call   1030 <initialize_lexer@plt>
xor    %eax,%eax
call   1060 <initialize_datatypes@plt>
xor    %eax,%eax
call   1040 <initialize_symtab@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <initialize_pstack@plt>

LLVM IR (-O0):
define void @initialize() {
%1 = call i32 (...) @initialize_lexer()
%2 = call i32 (...) @initialize_datatypes()
%3 = call i32 (...) @initialize_symtab()
%4 = call i32 (...) @initialize_pstack()
ret void
}

LLVM IR (-O2):
define void @initialize() {
%1 = tail call i32 (...) @initialize_lexer()
%2 = tail call i32 (...) @initialize_datatypes()
%3 = tail call i32 (...) @initialize_symtab()
%4 = tail call i32 (...) @initialize_pstack()
ret void
}