xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ fmaxl(long double, long double);
int /*<<< orphan*/ link_failure_fmaxl();
void test_fmaxl(long double ld1, long double ld2) {
  if (fmaxl(ld1, ld2) != fmaxl(ld1, ld2))
    link_failure_fmaxl();
}


x86 assembly (clang, -O0):
<test_fmaxl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <fmaxl@plt>
mov    %rax,-0x28(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <fmaxl@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1175 <test_fmaxl+0x55>
mov    $0x0,%al
call   1030 <link_failure_fmaxl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fmaxl>:
push   %rbx
sub    $0x40,%rsp
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
fldt   0x60(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1040 <fmaxl@plt>
mov    %rax,%rbx
fldt   0x28(%rsp)
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1040 <fmaxl@plt>
cmp    %rax,%rbx
jne    1167 <test_fmaxl+0x47>
add    $0x40,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
jmp    1030 <link_failure_fmaxl@plt>

LLVM IR (-O0):
define void @test_fmaxl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @fmaxl(x86_fp80 %5, x86_fp80 %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = load x86_fp80, x86_fp80* %4
%10 = call i64 @fmaxl(x86_fp80 %8, x86_fp80 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_fmaxl()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_fmaxl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @fmaxl(x86_fp80 %0, x86_fp80 %1)
%4 = tail call i64 @fmaxl(x86_fp80 %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_fmaxl()
br label %8
8: ; preds = %6, %2
ret void
}
int main2() {
  static int x = 20;
  struct X {
    int x;
    int y;
  };
}


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

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

LLVM IR (-O0):
@main2.x = internal global i32 20
define i32 @main2() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @main2() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int init();
int /*<<< orphan*/ led_on(int);
void init_robot() {
  if (init() == -1) {
    exit(1);
  }
  led_on(1);
}


x86 assembly (clang, -O0):
<init_robot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init@plt>
cmp    $0xffffffff,%eax
jne    114e <init_robot+0x1e>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    $0x1,%edi
call   1030 <led_on@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_robot>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
mov    $0x1,%edi
cmp    $0xffffffff,%eax
je     1148 <init_robot+0x18>
pop    %rax
jmp    1030 <led_on@plt>
call   1050 <exit@plt>

LLVM IR (-O0):
define void @init_robot() {
%1 = call i32 (...) @init()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 1)
unreachable
5: ; preds = %0
%6 = call i32 @led_on(i32 1)
ret void
}

LLVM IR (-O2):
define void @init_robot() {
%1 = tail call i32 (...) @init()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %0
%6 = tail call i32 @led_on(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void xerbla_(char *e, int i) {
  fprintf(stderr, "BLAS error\n");
  exit(1);
}


x86 assembly (clang, -O0):
<xerbla_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xerbla_>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"BLAS error\0A\00"
define void @xerbla_(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ KheBuffAddChar(char **, int *, int *, char);
void KheBuffAddStr(char **buff, int *curr_len, int *max_len, char *str) {
  char *p;
  for (p = str; *p != '\0'; p++)
    KheBuffAddChar(buff, curr_len, max_len, *p);
}


x86 assembly (clang, -O0):
<KheBuffAddStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <KheBuffAddStr+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rax
movsbl (%rax),%ecx
call   1030 <KheBuffAddChar@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1130 <KheBuffAddStr+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KheBuffAddStr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rcx),%al
test   %al,%al
je     114c <KheBuffAddStr+0x3c>
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%ecx
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <KheBuffAddChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <KheBuffAddStr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @KheBuffAddStr(i8** %0, i32* %1, i32* %2, i8* nocapture %3) {
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %12, %7 ], [ %5, %4 ]
%9 = phi i8* [ %11, %7 ], [ %3, %4 ]
%10 = tail call i32 @KheBuffAddChar(i8** %0, i32* %1, i32* %2, i8 signext %8)
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max_heapify(int *, int, int);
void build_max_heap(int *arr, int length, int heap_size) {
  int i = 0;
  for (i = length / 2; i >= 1; i--) {
    max_heapify(arr, heap_size, i);
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     115e <build_max_heap+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <max_heapify@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <build_max_heap+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1147 <build_max_heap+0x37>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
shr    %ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <max_heapify@plt>
lea    -0x1(%rbp),%eax
cmp    $0x1,%ebp
mov    %eax,%ebp
ja     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = lshr i32 %1, 1
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %10, %7 ], [ %6, %5 ]
%9 = tail call i32 @max_heapify(i32* %0, i32 %2, i32 %8)
%10 = add nsw i32 %8, -1
%11 = icmp ugt i32 %8, 1
br i1 %11, label %7, label %12
12: ; preds = %7, %3
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ read_formats(char *, int *, int /*<<< orphan*/);
void read_env_formats(int *numformatsp) {
  char *filename;
  if ((filename = getenv("SUMLINES.FMT")) != 0)
    read_formats(filename, numformatsp, 0);
}


x86 assembly (clang, -O0):
<read_env_formats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1155 <read_env_formats+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1040 <read_formats@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_env_formats>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1143 <read_env_formats+0x23>
mov    %rax,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
pop    %rbx
jmp    1040 <read_formats@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"SUMLINES.FMT\00"
define void @read_env_formats(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = load i32*, i32** %2
%9 = call i32 @read_formats(i8* %7, i32* %8, i32 0)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"SUMLINES.FMT\00"
define void @read_env_formats(i32* %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @read_formats(i8* %2, i32* %0, i32 0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_CYAN;
int /*<<< orphan*/ ChangeColor(int /*<<< orphan*/);
void SetColorCyan() { ChangeColor(COLOR_CYAN); }


x86 assembly (clang, -O0):
<SetColorCyan>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <ChangeColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetColorCyan>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ChangeColor@plt>

LLVM IR (-O0):
@COLOR_CYAN = global i32 0
define void @SetColorCyan() {
%1 = load i32, i32* @COLOR_CYAN
%2 = call i32 @ChangeColor(i32 %1)
ret void
}

LLVM IR (-O2):
@COLOR_CYAN = global i32 0
define void @SetColorCyan() {
%1 = load i32, i32* @COLOR_CYAN
%2 = tail call i32 @ChangeColor(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char *ascii = "2 meme 4 u :^)\n";
  printf("%s", ascii);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"2 meme 4 u :^)\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float acoshf(float);
float futrts_acosh32(float x) { return acoshf(x); }


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

x86 assembly (clang, -O2):
<futrts_acosh32>:
jmp    1030 <acoshf@plt>

LLVM IR (-O0):
define float @futrts_acosh32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @acoshf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @futrts_acosh32(float %0) {
%2 = tail call float @acoshf(float %0)
ret float %2
}
/* Variables and functions */
int sum(int, int);
int main(void) {
  int a, b;
  a = 1, b = 2;
  int s = sum(a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <sum@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 1, i32 2)
ret i32 0
}
int test_imm_63uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x63 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_63uint64_highword_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, 32
%6 = and i64 %5, 99
%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_63uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 425201762304
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int sockopt_cork(int sock, int onoff) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sockopt_cork(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  int fd = open("/dev/tty", O_RDWR);
  write(fd, "hello\n", 6);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    0xea1(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1040 <open@plt>
lea    0xebc(%rip),%rsi
mov    %eax,%edi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/tty\00"
@O_RDWR = global i32 0
@.str.1 = [7 x i8] c"hello\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @O_RDWR
%8 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/tty\00"
@O_RDWR = global i32 0
@.str.1 = [7 x i8] c"hello\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ udp_kmalloc_warm();
void kmalloc_warm() { udp_kmalloc_warm(); }


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

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

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

LLVM IR (-O2):
define void @kmalloc_warm() {
%1 = tail call i32 (...) @udp_kmalloc_warm()
ret void
}
int Seccomp_exists() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Seccomp_exists() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t rtp2435_get_offset(uint8_t *header) {
  return header[1] << 16 | header[2] << 8 | header[3];
}


x86 assembly (clang, -O0):
<rtp2435_get_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp2435_get_offset>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rtp2435_get_offset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 3
%14 = load i32, i32* %13
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @rtp2435_get_offset(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 3
%10 = load i32, i32* %9
%11 = or i32 %8, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ aucMagic;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int contains_data(int /*<<< orphan*/ *, int, unsigned char *, int);
int is_ntfs_fs(FILE *fp) {
  unsigned char aucMagic[] = {'N', 'T', 'F', 'S', ' ', ' ', ' ', ' '};
  return contains_data(fp, 0x03, aucMagic, sizeof(aucMagic));
}


x86 assembly (clang, -O0):
<is_ntfs_fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rdx
mov    $0x3,%esi
mov    $0x8,%ecx
call   1030 <contains_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ntfs_fs>:
push   %rax
movabs $0x202020205346544e,%rax
20 20 20
mov    %rax,(%rsp)
mov    %rsp,%rdx
mov    $0x3,%esi
mov    $0x8,%ecx
call   1030 <contains_data@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.is_ntfs_fs.aucMagic = [8 x i8] c"NTFS "
define i32 @is_ntfs_fs(i32* %0) {
%2 = alloca i32*
%3 = alloca [8 x i8]
store i32* %0, i32** %2
%4 = bitcast [8 x i8]* %3 to i8*
%5 = load i32*, i32** %2
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = call i32 @contains_data(i32* %5, i32 3, i8* %6, i32 8)
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_ntfs_fs(i32* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 2314885531676595278, i64* %2
%4 = call i32 @contains_data(i32* %0, i32 3, i8* %3, i32 8)
ret i32 %4
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double double_rand() { return ((double)rand()) / (RAND_MAX); }


x86 assembly (clang, -O0):
<double_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_rand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @double_rand() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @double_rand() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
int sort_batch(char *database, int (*compare)(const void *x, const void *y)) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @sort_batch(i8* %0, i32 (i8*, i8*)* %1) {
%3 = alloca i8*
%4 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %3
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @sort_batch(i8* nocapture readnone %0, i32 (i8*, i8*)* nocapture readnone %1) {
ret i32 0
}
extern void __run_user_rf_pre_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @__run_user_rf_pre_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage() {
  puts("program dictionary-file word-test-file iterations-count");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"program dictionary-file word-test-file iterations-count\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"program dictionary-file word-test-file iterations-count\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "FILEDIR: Return directory part of file pathname\n");
  fprintf(stderr, "Usage:  filedir file1 file2 file3 ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"FILEDIR: Return directory part of file pathname\0A\00"
@.str.1 = [39 x i8] c"Usage: filedir file1 file2 file3 ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"FILEDIR: Return directory part of file pathname\0A\00"
@.str.1 = [39 x i8] c"Usage: filedir file1 file2 file3 ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ophh_time_ussleep(int);
void psleep(int paus) { ophh_time_ussleep(paus * 10); }


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

x86 assembly (clang, -O2):
<psleep>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%edi
jmp    1030 <ophh_time_ussleep@plt>

LLVM IR (-O0):
define void @psleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 10
%5 = call i32 @ophh_time_ussleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @psleep(i32 %0) {
%2 = mul nsw i32 %0, 10
%3 = tail call i32 @ophh_time_ussleep(i32 %2)
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *get_filename(const char *path) {
  const char *slash = strrchr(path, '/');
  if (slash != NULL)
    return slash + 1;
  return path;
}


x86 assembly (clang, -O0):
<get_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <get_filename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <get_filename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @get_filename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
short swapshortEndian(short s) { return ((s & 0xFF) << 8) | (s >> 8); }


x86 assembly (clang, -O0):
<swapshortEndian>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movswl -0x2(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapshortEndian>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @swapshortEndian(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = or i32 %6, %9
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @swapshortEndian(i16 signext %0) {
%2 = shl i16 %0, 8
%3 = ashr i16 %0, 8
%4 = or i16 %2, %3
ret i16 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
void *get_XCreateWindowEvent_display(void *_p) {
  return (void *)((XCreateWindowEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XCreateWindowEvent_display>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @get_XCreateWindowEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
void *memcpy(int /*<<< orphan*/, void const *, size_t);
int /*<<< orphan*/ xmalloc(size_t);
__attribute__((__returns_nonnull__)) __attribute__((__nonnull__))
__attribute__((__alloc_size__(2))) void *
xmemdup(const void *ptr, size_t size) {
  return memcpy(xmalloc(size), ptr, size);
}


x86 assembly (clang, -O0):
<xmemdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <xmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <xmalloc@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @xmemdup(i8* %0, i64 %1) {
%3 = tail call i32 @xmalloc(i64 %1)
%4 = tail call i8* @memcpy(i32 %3, i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int myvararg(char *, int, int, int, int);
int main() {
  if (10 != myvararg("1234", 1, 2, 3, 4))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
call   1030 <myvararg@plt>
mov    %eax,%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
je     115b <main+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <main+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
call   1030 <myvararg@plt>
xor    %ecx,%ecx
cmp    $0xa,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"1234\00"
define i32 @main() {
%1 = tail call i32 @myvararg(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3, i32 4)
%2 = icmp ne i32 %1, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ do_all_factorials(int, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/);
scalar_t__ malloc(int);
uint64_t *all_factorials(int n) {
  if (n < 0 || n > 20)
    return NULL;
  uint64_t *results = (uint64_t *)malloc(n * sizeof(uint64_t));
  do_all_factorials(n, results, 0);
  return results;
}


x86 assembly (clang, -O0):
<all_factorials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     113f <all_factorials+0x1f>
cmpl   $0x14,-0xc(%rbp)
jle    114c <all_factorials+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1175 <all_factorials+0x55>
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <do_all_factorials@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_factorials>:
push   %r14
push   %rbx
push   %rax
cmp    $0x14,%edi
jbe    112e <all_factorials+0xe>
xor    %r14d,%r14d
jmp    114b <all_factorials+0x2b>
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %ebx,%edi
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <do_all_factorials@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @all_factorials(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 20
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i32* null, i32** %2
br label %22
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = mul i64 %13, 4
%15 = trunc i64 %14 to i32
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i32*
store i32* %17, i32** %4
%18 = load i32, i32* %3
%19 = load i32*, i32** %4
%20 = call i32 @do_all_factorials(i32 %18, i32* %19, i32 0)
%21 = load i32*, i32** %4
store i32* %21, i32** %2
br label %22
22: ; preds = %11, %10
%23 = load i32*, i32** %2
ret i32* %23
}

LLVM IR (-O2):
define i32* @all_factorials(i32 %0) {
%2 = icmp ugt i32 %0, 20
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = shl nuw nsw i32 %0, 2
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @do_all_factorials(i32 %0, i32* %6, i32 0)
br label %8
8: ; preds = %1, %3
%9 = phi i32* [ %6, %3 ], [ null, %1 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void *, int);
int omp_get_thread_num();
void _gather(void *sendbuf, int sendcount1, void *recvbuf, size_t itemsize) {
  int ThisTask = omp_get_thread_num();
  memcpy((char *)recvbuf + ThisTask * sendcount1 * itemsize, sendbuf,
         sendcount1 * itemsize);
#pragma omp barrier
}


x86 assembly (clang, -O0):
<_gather>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
imul   -0x20(%rbp),%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %eax,%edx
call   1040 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gather>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
imul   %ebp,%eax
movslq %eax,%rdi
imul   %rbx,%rdi
add    %r14,%rdi
imul   %ebp,%ebx
mov    %r15,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @_gather(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = call i32 (...) @omp_get_thread_num()
store i32 %10, i32* %9
%11 = load i8*, i8** %7
%12 = load i32, i32* %9
%13 = load i32, i32* %6
%14 = mul nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = load i64, i64* %8
%17 = mul i64 %15, %16
%18 = getelementptr inbounds i8, i8* %11, i64 %17
%19 = load i8*, i8** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = load i64, i64* %8
%23 = mul i64 %21, %22
%24 = trunc i64 %23 to i32
%25 = call i32 @memcpy(i8* %18, i8* %19, i32 %24)
ret void
}

LLVM IR (-O2):
define void @_gather(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 (...) @omp_get_thread_num()
%6 = mul nsw i32 %5, %1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, %3
%9 = getelementptr inbounds i8, i8* %2, i64 %8
%10 = trunc i64 %3 to i32
%11 = mul i32 %10, %1
%12 = tail call i32 @memcpy(i8* %9, i8* %0, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
int x_set_control(int, int, int);
int v4l2_set_control(int fd, int id, int val) {
  init();
  return x_set_control(fd, id, val);
}


x86 assembly (clang, -O0):
<v4l2_set_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1030 <init@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <x_set_control@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l2_set_control>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <init@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <x_set_control@plt>

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

LLVM IR (-O2):
define i32 @v4l2_set_control(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @init()
%5 = tail call i32 @x_set_control(i32 %0, i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *print_color(char *c) {
  if (c == NULL)
    return "^fg()";
  char *fmt = "^fg(#%s)";
  char *s = malloc(24);
  sprintf(s, fmt, c);
  return s;
}


x86 assembly (clang, -O0):
<print_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <print_color+0x27>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <print_color+0x59>
lea    0xeb8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_color>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     114d <print_color+0x2d>
mov    %rdi,%r14
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec6(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <sprintf@plt>
jmp    1154 <print_color+0x34>
lea    0xeac(%rip),%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"^fg()\00"
@.str.1 = [9 x i8] c"^fg(#%s)\00"
define i8* @print_color(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
9: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %4
%10 = call i8* @malloc(i32 24)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = load i8*, i8** %3
%14 = call i32 @sprintf(i8* %11, i8* %12, i8* %13)
%15 = load i8*, i8** %5
store i8* %15, i8** %2
br label %16
16: ; preds = %9, %8
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"^fg()\00"
@.str.1 = [9 x i8] c"^fg(#%s)\00"
define i8* @print_color(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call dereferenceable_or_null(24) i8* @malloc(i32 24)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int stop_tsung_player(char *prefix) {
  printf("Stopping tsung player is not implemented.\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<stop_tsung_player>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Stopping tsung player is not implemented.\0A\00"
define i32 @stop_tsung_player(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [42 x i8] c"Stopping tsung player is not implemented.\00"
define i32 @stop_tsung_player(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
char *strstr(int /*<<< orphan*/, char *);
char *getlocale() {
  char *str;
  str = strstr(getenv("LANG"), ".");
  if (str)
    *str++;
  else
    str = "US-ASCII";
  return str;
}


x86 assembly (clang, -O0):
<getlocale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
lea    0xec8(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1162 <getlocale+0x42>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116d <getlocale+0x4d>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlocale>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
call   1040 <strstr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xebe(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"LANG\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [9 x i8] c"US-ASCII\00"
define i8* @getlocale() {
%1 = alloca i8*
%2 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i8* @strstr(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %1
%9 = load i8, i8* %7
br label %11
10: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %11
11: ; preds = %10, %6
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"LANG\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [9 x i8] c"US-ASCII\00"
define i8* @getlocale() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @strstr(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %4
ret i8* %5
}