xunge/DecIR huggingface dataset:
int enc4(char **buf, int x) {
  char *p = *buf;
  p[0] = x >> 24;
  p[1] = x >> 16;
  p[2] = x >> 8;
  p[3] = x;
  *buf += 4;
  return 0;
}


x86 assembly (clang, -O0):
<enc4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enc4>:
mov    (%rdi),%rax
bswap  %esi
mov    %esi,(%rax)
addq   $0x4,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @enc4(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = lshr i32 %1, 24
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %1 to i8
%13 = getelementptr inbounds i8, i8* %3, i64 3
store i8 %12, i8* %13
%14 = load i8*, i8** %0
%15 = getelementptr inbounds i8, i8* %14, i64 4
store i8* %15, i8** %0
ret i32 0
}
/* Variables and functions */
double get_distance(int);
int /*<<< orphan*/ output(double);
int /*<<< orphan*/ scanf(char *, int *, int *);
void test_case() {
  int r, n;
  scanf("%d %d", &r, &n);
  double distance = get_distance(n);
  output((distance -
          2 * r * 3.14159265358979323846264338327950288419716939937510582) /
         distance);
}


x86 assembly (clang, -O0):
<test_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <get_distance@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe79(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_case>:
push   %rax
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%edi
call   1040 <get_distance@plt>
mov    0x4(%rsp),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm1
mulsd  0xea1(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <output@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define void @test_case() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %2
%6 = call double @get_distance(i32 %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = load i32, i32* %1
%9 = mul nsw i32 2, %8
%10 = sitofp i32 %9 to double
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double %11, double 0x400921FB54442D18, double %7)
%13 = load double, double* %3
%14 = fdiv double %12, %13
%15 = call i32 @output(double %14)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define void @test_case() {
%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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = call double @get_distance(i32 %6)
%8 = load i32, i32* %1
%9 = shl nsw i32 %8, 1
%10 = sitofp i32 %9 to double
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double %11, double 0x400921FB54442D18, double %7)
%13 = fdiv double %12, %7
%14 = call i32 @output(double %13)
ret void
}
void init_stats() {}


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

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

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

LLVM IR (-O2):
define void @init_stats() {
ret void
}
void postOrder() {}


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

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

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

LLVM IR (-O2):
define void @postOrder() {
ret void
}
void *ghcjs_currentWindow() { return 0; }


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

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

LLVM IR (-O0):
define i8* @ghcjs_currentWindow() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @ghcjs_currentWindow() {
ret i8* null
}
int(__attribute__((const)) f_3)(int x) { return x; }


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

x86 assembly (clang, -O2):
<f_3>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f_3(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_envs() {
  extern char **environ;
  unsigned i;
  for (i = 0; environ[i]; i++) {
    printf("env=%s\n", environ[i]);
  }
}


x86 assembly (clang, -O0):
<print_envs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%rax
mov    -0x4(%rbp),%ecx
cmpq   $0x0,(%rax,%rcx,8)
je     1162 <print_envs+0x52>
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    -0x4(%rbp),%ecx
mov    (%rax,%rcx,8),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <print_envs+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_envs>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ecd(%rip),%r14
mov    (%r14),%rax
mov    (%rax),%rsi
test   %rsi,%rsi
je     1159 <print_envs+0x49>
mov    $0x1,%ebp
lea    0xece(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    (%r14),%rax
mov    %ebp,%ecx
mov    (%rax,%rcx,8),%rsi
add    $0x1,%ebp
test   %rsi,%rsi
jne    1140 <print_envs+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@environ = external global i8**
@.str = [8 x i8] c"env=%s\0A\00"
define void @print_envs() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %16, %0
%3 = load i8**, i8*** @environ
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8*, i8** %3, i64 %5
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i8**, i8*** @environ
%11 = load i32, i32* %1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
%14 = load i8*, i8** %13
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %1
%18 = add i32 %17, 1
store i32 %18, i32* %1
br label %2
19: ; preds = %2
ret void
}

LLVM IR (-O2):
@environ = external global i8**
@.str = [8 x i8] c"env=%s\0A\00"
define void @print_envs() {
%1 = load i8**, i8*** @environ
%2 = load i8*, i8** %1
%3 = icmp eq i8* %2, null
br i1 %3, label %14, label %4
4: ; preds = %0, %4
%5 = phi i8* [ %12, %4 ], [ %2, %0 ]
%6 = phi i32 [ %8, %4 ], [ 0, %0 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = add i32 %6, 1
%9 = load i8**, i8*** @environ
%10 = zext i32 %8 to i64
%11 = getelementptr inbounds i8*, i8** %9, i64 %10
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %4
14: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ beautifulMatrix(int, int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int sz, **M;
  printf("Type in the size of the matrix you want to create: ");
  scanf("%d", &sz);
  beautifulMatrix(sz, M);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <beautifulMatrix@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Type in the size of the matrix you want to create: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32**
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32**, i32*** %3
%8 = call i32 @beautifulMatrix(i32 %6, i32** %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"Type in the size of the matrix you want to create: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @beautifulMatrix(i32 %5, i32** undef)
ret i32 0
}
int main(argc, argv)
int argc;
char **argv;
{
  printf("hello, world!\n");
  exit(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)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
long long usec_from_tv(struct timeval *tv) {
  long long usec;
  usec = ((long long)tv->tv_sec) * 1000000;
  usec += tv->tv_usec;
  return usec;
}


x86 assembly (clang, -O0):
<usec_from_tv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usec_from_tv>:
imul   $0xf4240,0x8(%rdi),%rax
add    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @usec_from_tv(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i64
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%6 = load i64, i64* %5
%7 = mul nsw i64 %6, 1000000
store i64 %7, i64* %3
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = load i64, i64* %3
%12 = add nsw i64 %11, %10
store i64 %12, i64* %3
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @usec_from_tv(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_store_booke_tcr();
void spr_write_booke_tcr(void *opaque, int sprn) { gen_op_store_booke_tcr(); }


x86 assembly (clang, -O0):
<spr_write_booke_tcr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <gen_op_store_booke_tcr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @spr_write_booke_tcr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @gen_op_store_booke_tcr()
ret void
}

LLVM IR (-O2):
define void @spr_write_booke_tcr(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_store_booke_tcr()
ret void
}
void Wheels_1_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @Wheels_1_RestoreConfig() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void msleep(uint32_t milliseconds) {
  uint32_t max, ms;
  for (ms = milliseconds; ms > 0; --ms) {
    for (max = 4000; max > 0; --max)
      ;
  }
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    115a <msleep+0x5a>
movq   $0xfa0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1144 <msleep+0x44>
jmp    1133 <msleep+0x33>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1123 <msleep+0x23>
jmp    1149 <msleep+0x49>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <msleep+0x10>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @msleep(i64 %0) {
ret void
}
int dsatlit(int l) {
  if (l < 0)
    return ((-l - 1) << 1) | 1;
  return ((l - 1) << 1);
}


x86 assembly (clang, -O0):
<dsatlit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1127 <dsatlit+0x27>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
or     $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <dsatlit+0x33>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsatlit>:
test   %edi,%edi
js     110b <dsatlit+0xb>
lea    (%rdi,%rdi,1),%eax
add    $0xfffffffe,%eax
ret
not    %edi
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @dsatlit(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = xor i32 %0, -1
%5 = shl i32 %4, 1
%6 = or i32 %5, 1
br label %10
7: ; preds = %1
%8 = shl nuw i32 %0, 1
%9 = add i32 %8, -2
br label %10
10: ; preds = %7, %3
%11 = phi i32 [ %6, %3 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ SOURCE_SAMPLING_STRINGS;

/* Variables and functions */
int /*<<< orphan*/ print_enum(char *, char const **, int);
void print_source_sampling() {
  static const char *SOURCE_SAMPLING_STRINGS[] = {
      "Progressive",
      "Interlaced",
  };
  print_enum(
      "source_sampling", SOURCE_SAMPLING_STRINGS,
      (sizeof(SOURCE_SAMPLING_STRINGS) / sizeof((SOURCE_SAMPLING_STRINGS)[0])));
}


x86 assembly (clang, -O0):
<print_source_sampling>:
push   %rbp
mov    %rsp,%rbp
lea    0xefc(%rip),%rdi
lea    0x2f0e(%rip),%rsi
mov    $0x2,%edx
call   1030 <print_enum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_source_sampling>:
lea    0xf00(%rip),%rdi
lea    0x2f12(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <print_enum@plt>

LLVM IR (-O0):
@print_source_sampling.SOURCE_SAMPLING_STRINGS = internal global [2 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0)]
@.str = [12 x i8] c"Progressive\00"
@.str.1 = [11 x i8] c"Interlaced\00"
@.str.2 = [16 x i8] c"source_sampling\00"
define void @print_source_sampling() {
%1 = call i32 @print_enum(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @print_source_sampling.SOURCE_SAMPLING_STRINGS, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@print_source_sampling.SOURCE_SAMPLING_STRINGS = internal global [2 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0)]
@.str = [12 x i8] c"Progressive\00"
@.str.1 = [11 x i8] c"Interlaced\00"
@.str.2 = [16 x i8] c"source_sampling\00"
define void @print_source_sampling() {
%1 = tail call i32 @print_enum(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @print_source_sampling.SOURCE_SAMPLING_STRINGS, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FreshWin45();
void freshwin() { FreshWin45(); }


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

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

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

LLVM IR (-O2):
define void @freshwin() {
%1 = tail call i32 (...) @FreshWin45()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ seteuid(int /*<<< orphan*/ const);
scalar_t__ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int priv_mode(const uid_t euid, sigset_t *signalset, sigset_t *oldsignalset) {
  if (sigprocmask(SIG_BLOCK, signalset, oldsignalset)) {
    exit(-1);
  }
  seteuid(euid);
  return 0;
}


x86 assembly (clang, -O0):
<priv_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sigprocmask@plt>
cmp    $0x0,%rax
je     116d <priv_mode+0x3d>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%edi
call   1050 <seteuid@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<priv_mode>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1030 <sigprocmask@plt>
test   %rax,%rax
jne    1151 <priv_mode+0x21>
mov    %ebx,%edi
call   1050 <seteuid@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @priv_mode(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* @SIG_BLOCK
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i64 @sigprocmask(i32 %7, i32* %8, i32* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %3
%15 = load i32, i32* %4
%16 = call i32 @seteuid(i32 %15)
ret i32 0
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @priv_mode(i32 %0, i32* %1, i32* %2) {
%4 = load i32, i32* @SIG_BLOCK
%5 = tail call i64 @sigprocmask(i32 %4, i32* %1, i32* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %3
%10 = tail call i32 @seteuid(i32 %0)
ret i32 0
}
void fd34(int n) {
a : {
  typedef int(*b)[n];
P01A:
  goto P01A;
  {
    typedef int(*c)[n];
  p012A:
    goto p012A;
    goto a;
  P012A:
    goto P012A;
    0;
  }
P01B:
  goto P01B;
  {
    typedef int(*d)[n];
  P013A:
    goto P013A;
    0;
  }
P01C:
  goto P01C;
  ;
  typedef int(*e)[n];
P014A:
  goto P014A;
  0;
};
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd34>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd34+0x7>

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

LLVM IR (-O0):
define void @fd34(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %6, %3
br label %6
7: ; No predecessors!
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %10, %7
br label %10
11: ; preds = %11
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd34(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int do_145() { return 145; }


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

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

LLVM IR (-O0):
define i32 @do_145() {
ret i32 145
}

LLVM IR (-O2):
define i32 @do_145() {
ret i32 145
}
void logo() {}


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

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

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

LLVM IR (-O2):
define void @logo() {
ret void
}
void H420ToRGB565() {}


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

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

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

LLVM IR (-O2):
define void @H420ToRGB565() {
ret void
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int tio_get_cols(void) {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w.ws_col;
}


x86 assembly (clang, -O0):
<tio_get_cols>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tio_get_cols>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @tio_get_cols() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @tio_get_cols() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
unsigned int d2ui(double x) { return x; }


x86 assembly (clang, -O0):
<d2ui>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2ui>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @d2ui(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptoui double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @d2ui(double %0) {
%2 = fptoui double %0 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ AdsSetTimeout(int /*<<< orphan*/, int /*<<< orphan*/);
int32_t AdsSyncSetTimeoutEx(int32_t port, int32_t nMs) {
  return AdsSetTimeout(port, nMs);
}


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

x86 assembly (clang, -O2):
<AdsSyncSetTimeoutEx>:
jmp    1030 <AdsSetTimeout@plt>

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

LLVM IR (-O2):
define i32 @AdsSyncSetTimeoutEx(i32 %0, i32 %1) {
%3 = tail call i32 @AdsSetTimeout(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ eVA(int);
void gVA(int i, ...) { eVA(i); }


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

x86 assembly (clang, -O2):
<gVA>:
jmp    1030 <eVA@plt>

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

LLVM IR (-O2):
define void @gVA(i32 %0, ...) {
%2 = tail call i32 @eVA(i32 %0)
ret void
}
void sdl_set_title(char *name) {}


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

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

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

LLVM IR (-O2):
define void @sdl_set_title(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double log10(double);
double pop(struct lifo *);
double opr_log10(struct lifo *stack) {
  double op = pop(stack);
  return log10(op);
}


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

x86 assembly (clang, -O2):
<opr_log10>:
push   %rax
call   1030 <pop@plt>
pop    %rax
jmp    1040 <log10@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_log10(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @log10(double %6)
ret double %7
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_log10(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @log10(double %2)
ret double %3
}
/* Variables and functions */
void *xmalloc(size_t const);
void *xnmalloc(const size_t n, const size_t s) { return xmalloc(n * s); }


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

x86 assembly (clang, -O2):
<xnmalloc>:
imul   %rsi,%rdi
jmp    1030 <xmalloc@plt>

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

LLVM IR (-O2):
define i8* @xnmalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @xmalloc(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
void *checked_calloc(size_t count, size_t size, const char *file,
                     const int line) {
  (void)file;
  (void)line;
  void *temp = calloc(count, size);
  if (temp == NULL) {
    do {
    } while (0);
    abort();
  }
  return temp;
}


x86 assembly (clang, -O0):
<checked_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1164 <checked_calloc+0x44>
jmp    1158 <checked_calloc+0x38>
jmp    115d <checked_calloc+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_calloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     112d <checked_calloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @checked_calloc(i64 %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i8* @calloc(i64 %0, i64 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %4
ret i8* %5
}
int test_imm_03int8_mem(signed char *val) {
  return ((*val) & (0x03 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_03int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_03int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 3
%7 = icmp ne i32 %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_03int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 3
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ valid_vsprintf_helper(char *, float);
void valid_vsprintf() { valid_vsprintf_helper("%1.0f", 2.0f); }


x86 assembly (clang, -O0):
<valid_vsprintf>:
push   %rbp
mov    %rsp,%rbp
lea    0xee9(%rip),%rdi
movss  0xedd(%rip),%xmm0
call   1030 <valid_vsprintf_helper@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_vsprintf>:
lea    0xeed(%rip),%rdi
movss  0xee1(%rip),%xmm0
jmp    1030 <valid_vsprintf_helper@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%1.0f\00"
define void @valid_vsprintf() {
%1 = call i32 @valid_vsprintf_helper(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 2.000000e+00)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%1.0f\00"
define void @valid_vsprintf() {
%1 = tail call i32 @valid_vsprintf_helper(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 2.000000e+00)
ret void
}
/* Variables and functions */
int ioInit();
int progInit();
int scanInit();
int init(void) {
  int rc;
  rc = ioInit();
  rc |= progInit();
  rc |= scanInit();
  return (rc);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ioInit@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <progInit@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <scanInit@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <ioInit@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <progInit@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1040 <scanInit@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @init() {
%1 = alloca i32
%2 = call i32 (...) @ioInit()
store i32 %2, i32* %1
%3 = call i32 (...) @progInit()
%4 = load i32, i32* %1
%5 = or i32 %4, %3
store i32 %5, i32* %1
%6 = call i32 (...) @scanInit()
%7 = load i32, i32* %1
%8 = or i32 %7, %6
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @init() {
%1 = tail call i32 (...) @ioInit()
%2 = tail call i32 (...) @progInit()
%3 = or i32 %2, %1
%4 = tail call i32 (...) @scanInit()
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ UI_UI_startTest();
void Tracking_UI_startTest() { UI_UI_startTest(); }


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

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

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

LLVM IR (-O2):
define void @Tracking_UI_startTest() {
%1 = tail call i32 (...) @UI_UI_startTest()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putI2C1(int);
int /*<<< orphan*/ startI2C1();
int /*<<< orphan*/ stopI2C1();
void startConvertDS1631(void) {
  startI2C1();
  putI2C1(0x90);
  putI2C1(0x51);
  stopI2C1();
}


x86 assembly (clang, -O0):
<startConvertDS1631>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <startI2C1@plt>
mov    $0x90,%edi
call   1050 <putI2C1@plt>
mov    $0x51,%edi
call   1050 <putI2C1@plt>
mov    $0x0,%al
call   1040 <stopI2C1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startConvertDS1631>:
push   %rax
xor    %eax,%eax
call   1030 <startI2C1@plt>
mov    $0x90,%edi
call   1050 <putI2C1@plt>
mov    $0x51,%edi
call   1050 <putI2C1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <stopI2C1@plt>

LLVM IR (-O0):
define void @startConvertDS1631() {
%1 = call i32 (...) @startI2C1()
%2 = call i32 @putI2C1(i32 144)
%3 = call i32 @putI2C1(i32 81)
%4 = call i32 (...) @stopI2C1()
ret void
}

LLVM IR (-O2):
define void @startConvertDS1631() {
%1 = tail call i32 (...) @startI2C1()
%2 = tail call i32 @putI2C1(i32 144)
%3 = tail call i32 @putI2C1(i32 81)
%4 = tail call i32 (...) @stopI2C1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ absolute();
int /*<<< orphan*/ adc16(int /*<<< orphan*/);
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
void adcAbs16(void) { adc16(readmemw65816(absolute())); }


x86 assembly (clang, -O0):
<adcAbs16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <absolute@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <adc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcAbs16>:
push   %rax
xor    %eax,%eax
call   1040 <absolute@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <adc16@plt>

LLVM IR (-O0):
define void @adcAbs16() {
%1 = call i32 (...) @absolute()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @adc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcAbs16() {
%1 = tail call i32 (...) @absolute()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @adc16(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_castps_pd(int /*<<< orphan*/);
__m128d test_mm_castps_pd(__m128 A) { return _mm_castps_pd(A); }


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

x86 assembly (clang, -O2):
<test_mm_castps_pd>:
jmp    1030 <_mm_castps_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_castps_pd(i32 %0) {
%2 = tail call i32 @_mm_castps_pd(i32 %0)
ret i32 %2
}
void f20(void) {
  ({
    goto a;
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f20>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f20() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
br label %5
5: ; preds = %0
store i32 0, i32* %2
%6 = load i32, i32* %2
store i32 0, i32* %3
%7 = load i32, i32* %3
store i32 0, i32* %4
%8 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @f20() {
ret void
}
/* Type definitions */
struct ls_attr_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insert_string(char *);
void record_file(char *path_name, struct ls_attr_t *p) {
  insert_string(path_name);
}


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

x86 assembly (clang, -O2):
<record_file>:
jmp    1030 <insert_string@plt>

LLVM IR (-O0):
%struct.ls_attr_t = type { i32 }
define void @record_file(i8* %0, %struct.ls_attr_t* %1) {
%3 = alloca i8*
%4 = alloca %struct.ls_attr_t*
store i8* %0, i8** %3
store %struct.ls_attr_t* %1, %struct.ls_attr_t** %4
%5 = load i8*, i8** %3
%6 = call i32 @insert_string(i8* %5)
ret void
}

LLVM IR (-O2):
%struct.ls_attr_t = type { i32 }
define void @record_file(i8* %0, %struct.ls_attr_t* nocapture readnone %1) {
%3 = tail call i32 @insert_string(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float const, float const, float const);
void mlPointPrint(const float *a) {
  printf("(%f, %f, %f)\n", a[0], a[1], a[2]);
}


x86 assembly (clang, -O0):
<mlPointPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlPointPrint>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  0x8(%rdi),%xmm2
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"(%f, %f, %f)\0A\00"
define void @mlPointPrint(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float %2, float %4, float %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(int);
int main() {
  func(2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f2(int);
__attribute__((no)) int func1(void) { f2(1); }


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

x86 assembly (clang, -O2):
<func1>:
mov    $0x1,%edi
jmp    1030 <f2@plt>

LLVM IR (-O0):
define i32 @func1() {
%1 = alloca i32
%2 = call i32 @f2(i32 1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @func1() {
%1 = tail call i32 @f2(i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int j;
  assume(j < 100);
  assume(j >= 0);
  i = j;
  while (i < 10000) {
    i = i + 1;
    j = j + 1;
  }
  assert(i == j + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    117b <main+0x5b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1157 <main+0x37>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 100
%6 = zext i1 %5 to i32
%7 = call i32 @assume(i32 %6)
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assume(i32 %10)
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %16, %0
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 10000
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %13
21: ; preds = %13
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 2
%25 = icmp eq i32 %22, %24
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assume(i32 1)
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
unsigned long long rdtsc(void) {
  unsigned long long result;
  asm volatile(".byte 0x0F, 0x31" : "=A"(result));
  return result;
}


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

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

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 0x0F, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call i64 asm sideeffect ".byte 0x0F, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}