xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old\n", age);
  printf("I am %d inches tall\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x48,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"I am %d years old\0A\00"
@.str.1 = [21 x i8] c"I am %d inches tall\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 72, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"I am %d years old\0A\00"
@.str.1 = [21 x i8] c"I am %d inches tall\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ scalar_get();
int /*<<< orphan*/ test_ok(int /*<<< orphan*/);
int /*<<< orphan*/ vector_get();
int main() {
  initialize();
  test_ok(scalar_get());
  initialize();
  test_ok(vector_get());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <initialize@plt>
mov    $0x0,%al
call   1030 <scalar_get@plt>
mov    %eax,%edi
call   1060 <test_ok@plt>
mov    $0x0,%al
call   1050 <initialize@plt>
mov    $0x0,%al
call   1040 <vector_get@plt>
mov    %eax,%edi
call   1060 <test_ok@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <initialize@plt>
xor    %eax,%eax
call   1030 <scalar_get@plt>
mov    %eax,%edi
call   1060 <test_ok@plt>
xor    %eax,%eax
call   1050 <initialize@plt>
xor    %eax,%eax
call   1040 <vector_get@plt>
mov    %eax,%edi
call   1060 <test_ok@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialize()
%3 = call i32 (...) @scalar_get()
%4 = call i32 @test_ok(i32 %3)
%5 = call i32 (...) @initialize()
%6 = call i32 (...) @vector_get()
%7 = call i32 @test_ok(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 (...) @scalar_get()
%3 = tail call i32 @test_ok(i32 %2)
%4 = tail call i32 (...) @initialize()
%5 = tail call i32 (...) @vector_get()
%6 = tail call i32 @test_ok(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ yyerror(char *);
void handleError(int errNo) {
  switch (errNo) {
  case 1:
    yyerror("[Error]: Divide by zero!");
    exit(errNo);
  default:
    yyerror("[Error]: Unknown!");
    exit(errNo);
  }
}


x86 assembly (clang, -O0):
<handleError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    1150 <handleError+0x30>
jmp    113c <handleError+0x1c>
lea    0xebd(%rip),%rdi
call   1030 <yyerror@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
lea    0xec2(%rip),%rdi
call   1030 <yyerror@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handleError>:
push   %rbx
cmp    $0x1,%edi
jne    113c <handleError+0x1c>
lea    0xed3(%rip),%rdi
call   1030 <yyerror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    %edi,%ebx
lea    0xed4(%rip),%rdi
call   1030 <yyerror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"[Error]: Divide by zero!\00"
@.str.1 = [18 x i8] c"[Error]: Unknown!\00"
define void @handleError(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
]
4: ; preds = %1
%5 = call i32 @yyerror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = call i32 @yyerror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"[Error]: Divide by zero!\00"
@.str.1 = [18 x i8] c"[Error]: Unknown!\00"
define void @handleError(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @yyerror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 @yyerror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 %0)
unreachable
}
void serial_use_cnvss(int use_it) {}


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

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

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

LLVM IR (-O2):
define void @serial_use_cnvss(i32 %0) {
ret void
}
void WebPInitAlphaProcessingMIPSdspR2(void) {}


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

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

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

LLVM IR (-O2):
define void @WebPInitAlphaProcessingMIPSdspR2() {
ret void
}
void BIO_vfree(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ coroutine_yield(struct coroutine *);
void add_func(struct coroutine *C, void *arg) {
  int a;
  size_t i;
  for (i = 0; i < 10000; i++) {
    a = 100;
    while (a--)
      ;
    ((int *)arg)[0]++;
    coroutine_yield(C);
  }
}


x86 assembly (clang, -O0):
<add_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x2710,-0x20(%rbp)
jae    117b <add_func+0x6b>
movl   $0x64,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1156 <add_func+0x46>
jmp    113d <add_func+0x2d>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <coroutine_yield@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1128 <add_func+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_func>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x2710,%ebx
addl   $0x1,(%r14)
mov    %r15,%rdi
call   1030 <coroutine_yield@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <add_func+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.coroutine = type { i32 }
define void @add_func(%struct.coroutine* %0, i8* %1) {
%3 = alloca %struct.coroutine*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store %struct.coroutine* %0, %struct.coroutine** %3
store i8* %1, i8** %4
store i64 0, i64* %6
br label %7
7: ; preds = %24, %2
%8 = load i64, i64* %6
%9 = icmp ult i64 %8, 10000
br i1 %9, label %10, label %27
10: ; preds = %7
store i32 100, i32* %5
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %5
%13 = add nsw i32 %12, -1
store i32 %13, i32* %5
%14 = icmp ne i32 %12, 0
br i1 %14, label %15, label %16
15: ; preds = %11
br label %11
16: ; preds = %11
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to i32*
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
store i32 %21, i32* %19
%22 = load %struct.coroutine*, %struct.coroutine** %3
%23 = call i32 @coroutine_yield(%struct.coroutine* %22)
br label %24
24: ; preds = %16
%25 = load i64, i64* %6
%26 = add i64 %25, 1
store i64 %26, i64* %6
br label %7
27: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.coroutine = type { i32 }
define void @add_func(%struct.coroutine* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %9, %4 ]
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = tail call i32 @coroutine_yield(%struct.coroutine* %0)
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 10000
br i1 %10, label %11, label %4
11: ; preds = %4
ret void
}
double acos(double x) {
  const double a0 = 1.57079632679489661;
  const double a1 = -6.86225485913931799e-1;
  const double a2 = 1.32166590149486058e-151;
  const double a3 = -7.98481761590913950e-1;
  const double a4 = -1.22679393124305328e-151;
  return a0 + x * (a1 + x * (a2 + x * (a3 + x * a4)));
}


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  0xeb2(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xeae(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe8e(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe76(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5e(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @acos(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
store double 0x3FF921FB54442D18, double* %3
store double 0xBFE5F58F2675D352, double* %4
store double 0x209BB041CC304080, double* %5
store double 0xBFE98D299F8F88C3, double* %6
store double 0xA099B3726BF6A000, double* %7
%8 = load double, double* %2
%9 = load double, double* %2
%10 = load double, double* %2
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double %11, double 0xA099B3726BF6A000, double 0xBFE98D299F8F88C3)
%13 = call double @llvm.fmuladd.f64(double %10, double %12, double 0x209BB041CC304080)
%14 = call double @llvm.fmuladd.f64(double %9, double %13, double 0xBFE5F58F2675D352)
%15 = call double @llvm.fmuladd.f64(double %8, double %14, double 0x3FF921FB54442D18)
ret double %15
}

LLVM IR (-O2):
define double @acos(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0xA099B3726BF6A000, double 0xBFE98D299F8F88C3)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double 0x209BB041CC304080)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double 0xBFE5F58F2675D352)
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double 0x3FF921FB54442D18)
ret double %5
}
/* Variables and functions */
int __write(int /*<<< orphan*/, char *, int);
int strlen(char *);
int consoleprint(char *cpstring) {
  int slen, res;
  slen = strlen(cpstring);
  res = __write(0, cpstring, slen);
  return res;
}


x86 assembly (clang, -O0):
<consoleprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1040 <__write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleprint>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <__write@plt>

LLVM IR (-O0):
define i32 @consoleprint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = call i32 @__write(i32 0, i8* %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @consoleprint(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @__write(i32 0, i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHello(int taskid) { printf("Hello\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
define void @printHello(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define void @printHello(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, void *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_RSA_PUBLIC;
scalar_t__ i2d_RSAPublicKey;
int PEM_write_bio_RSAPublicKey(BIO *bp, const RSA *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_RSAPublicKey,
                            PEM_STRING_RSA_PUBLIC, bp, (void *)x, NULL, NULL, 0,
                            NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_RSAPublicKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_RSAPublicKey>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_RSAPublicKey = global i64 0
@PEM_STRING_RSA_PUBLIC = global i32 0
define i32 @PEM_write_bio_RSAPublicKey(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_RSAPublicKey
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_RSA_PUBLIC
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = bitcast i32* %9 to i8*
%11 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i8* %10, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %11
}

LLVM IR (-O2):
@i2d_RSAPublicKey = global i64 0
@PEM_STRING_RSA_PUBLIC = global i32 0
define i32 @PEM_write_bio_RSAPublicKey(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_RSAPublicKey
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_RSA_PUBLIC
%6 = bitcast i32* %1 to i8*
%7 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i8* %6, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %7
}
unsigned short rev2(unsigned short in) {
  return ((in & 0x00FF) << 8) | ((in & 0xFF00) >> 8);
}


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

x86 assembly (clang, -O2):
<rev2>:
mov    %edi,%eax
rol    $0x8,%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @rev2(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int foo5(int *);
int foo6() {
  int a = 5;
  return foo5(&a);
}


x86 assembly (clang, -O0):
<foo6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <foo5@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo6>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo5@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo6() {
%1 = alloca i32
store i32 5, i32* %1
%2 = call i32 @foo5(i32* %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @foo6() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @foo5(i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int _fork(void) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fork>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}
unsigned long long foo(int a) { return a * 7 & 1ULL << 63; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x7,-0x4(%rbp),%eax
cltq
movabs $0x8000000000000000,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x0(,%rdi,8),%eax
sub    %edi,%eax
movslq %eax,%rcx
movabs $0x8000000000000000,%rax
and    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 7
%5 = sext i32 %4 to i64
%6 = and i64 %5, -9223372036854775808
ret i64 %6
}

LLVM IR (-O2):
define i64 @foo(i32 %0) {
%2 = mul nsw i32 %0, 7
%3 = sext i32 %2 to i64
%4 = and i64 %3, -9223372036854775808
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  for (int i = 1; i < argc; ++i) {
    puts(argv[i]);
  }
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
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
store i32 1, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @puts(i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
short next_short(char *current) {
  short result = 0;
  for (int i = 0; i < 2; i++)
    result = result << 8 | *(current + i);
  return result;
}


x86 assembly (clang, -O0):
<next_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1146 <next_short+0x46>
movswl -0xa(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <next_short+0x15>
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_short>:
movzbl (%rdi),%ecx
shl    $0x8,%ecx
movsbl 0x1(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @next_short(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i32
store i8* %0, i8** %2
store i16 0, i16* %3
store i32 0, i32* %4
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8*, i8** %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = or i32 %11, %17
%19 = trunc i32 %18 to i16
store i16 %19, i16* %3
br label %20
20: ; preds = %8
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %5
23: ; preds = %5
%24 = load i16, i16* %3
ret i16 %24
}

LLVM IR (-O2):
define signext i16 @next_short(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int PopPaupTreeRubbish(FILE *ftree) {
  int ch;
  for (;;) {
    ch = fgetc(ftree);
    if (ch == '(') {
      ungetc(ch, ftree);
      return (0);
    } else if (ch == EOF)
      return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<PopPaupTreeRubbish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x28,-0x14(%rbp)
jne    115a <PopPaupTreeRubbish+0x3a>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <ungetc@plt>
movl   $0x0,-0x4(%rbp)
jmp    1182 <PopPaupTreeRubbish+0x62>
mov    -0x14(%rbp),%eax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%eax
jne    1178 <PopPaupTreeRubbish+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <PopPaupTreeRubbish+0x62>
jmp    117d <PopPaupTreeRubbish+0x5d>
jmp    112c <PopPaupTreeRubbish+0xc>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopPaupTreeRubbish>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0x28,%eax
je     1149 <PopPaupTreeRubbish+0x29>
cmp    (%r14),%eax
jne    1130 <PopPaupTreeRubbish+0x10>
mov    $0xffffffff,%eax
jmp    1158 <PopPaupTreeRubbish+0x38>
mov    $0x28,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @PopPaupTreeRubbish(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
br label %5
5: ; preds = %20, %1
%6 = load i32*, i32** %3
%7 = call i32 @fgetc(i32* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 40
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i32, i32* %4
%12 = load i32*, i32** %3
%13 = call i32 @ungetc(i32 %11, i32* %12)
store i32 0, i32* %2
br label %21
14: ; preds = %5
%15 = load i32, i32* %4
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 -1, i32* %2
br label %21
19: ; preds = %14
br label %20
20: ; preds = %19
br label %5
21: ; preds = %18, %10
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @PopPaupTreeRubbish(i32* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = icmp eq i32 %3, 40
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @ungetc(i32 40, i32* %0)
br label %10
7: ; preds = %2
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %3, %8
br i1 %9, label %10, label %2
10: ; preds = %7, %5
%11 = phi i32 [ 0, %5 ], [ -1, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test_dac();
void i2c_test(void) { test_dac(); }


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

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

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

LLVM IR (-O2):
define void @i2c_test() {
%1 = tail call i32 (...) @test_dac()
ret void
}
double MAP(double a, double rlo, double rhi, double slo, double shi) {
  return slo + (a - rlo) * (shi - slo) / (rhi - rlo);
}


x86 assembly (clang, -O0):
<MAP>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAP>:
subsd  %xmm1,%xmm0
subsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @MAP(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %9
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fsub double %12, %13
%15 = load double, double* %10
%16 = load double, double* %9
%17 = fsub double %15, %16
%18 = fmul double %14, %17
%19 = load double, double* %8
%20 = load double, double* %7
%21 = fsub double %19, %20
%22 = fdiv double %18, %21
%23 = fadd double %11, %22
ret double %23
}

LLVM IR (-O2):
define double @MAP(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %4, %3
%8 = fmul double %6, %7
%9 = fsub double %2, %1
%10 = fdiv double %8, %9
%11 = fadd double %10, %3
ret double %11
}
int test_imm_E3uint8_reg(unsigned char val) {
  return ((val) & (0xE3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E3uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xe3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E3uint8_reg>:
test   $0xe3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E3uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -29
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRCC_set(void) { return U_WMRCORENONE_set("U_WMRCC"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRCC\00"
define i8* @U_WMRCC_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRCC\00"
define i8* @U_WMRCC_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
gdec(lval) int lval[];
{
  if (lval[2] == (2 << 2))
    ol("subl2\t$4,r0");
  else
    ol("decl\tr0");
}


x86 assembly (clang, -O0):
<gdec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x8,0x8(%rax)
jne    113d <gdec+0x2d>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
jmp    114b <gdec+0x3b>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdec>:
cmpl   $0x8,0x8(%rdi)
lea    0xee5(%rip),%rax
lea    0xeea(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"subl2\09$4,r0\00"
@.str.1 = [8 x i8] c"decl\09r0\00"
define i32 @gdec(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 8
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"subl2\09$4,r0\00"
@.str.1 = [8 x i8] c"decl\09r0\00"
define i32 @gdec(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 8
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* %5)
ret i32 undef
}
/* Variables and functions */
int cc_three_parm_optimization();
int coplanar_calibration() { return cc_three_parm_optimization(); }


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

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

LLVM IR (-O0):
define i32 @coplanar_calibration() {
%1 = call i32 (...) @cc_three_parm_optimization()
ret i32 %1
}

LLVM IR (-O2):
define i32 @coplanar_calibration() {
%1 = tail call i32 (...) @cc_three_parm_optimization()
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x_root;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xkey_x_root(void *_p) {
  return (int)((XEvent *)_p)->xkey.x_root;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xkey_x_root>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XEvent_xkey_x_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_arith();
int /*<<< orphan*/ test_array();
int /*<<< orphan*/ test_basic();
int /*<<< orphan*/ test_default();
int /*<<< orphan*/ test_struct();
int main() {
  test_basic();
  test_arith();
  test_default();
  test_struct();
  test_array();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_basic@plt>
mov    $0x0,%al
call   1040 <test_arith@plt>
mov    $0x0,%al
call   1050 <test_default@plt>
mov    $0x0,%al
call   1030 <test_struct@plt>
mov    $0x0,%al
call   1060 <test_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_basic@plt>
xor    %eax,%eax
call   1040 <test_arith@plt>
xor    %eax,%eax
call   1050 <test_default@plt>
xor    %eax,%eax
call   1030 <test_struct@plt>
xor    %eax,%eax
call   1060 <test_array@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_basic()
%3 = call i32 (...) @test_arith()
%4 = call i32 (...) @test_default()
%5 = call i32 (...) @test_struct()
%6 = call i32 (...) @test_array()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_basic()
%2 = tail call i32 (...) @test_arith()
%3 = tail call i32 (...) @test_default()
%4 = tail call i32 (...) @test_struct()
%5 = tail call i32 (...) @test_array()
ret i32 0
}
void __DELETE_java_lang_StringBuilder(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_StringBuilder(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_pop();
int /*<<< orphan*/ output_line(char *);
void gen_and(void) {
  output_line("andb ,s");
  output_line("anda 1,s");
  gen_pop();
}


x86 assembly (clang, -O0):
<gen_and>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <output_line@plt>
lea    0xed1(%rip),%rdi
call   1040 <output_line@plt>
mov    $0x0,%al
call   1030 <gen_pop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_and>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <output_line@plt>
lea    0xed4(%rip),%rdi
call   1040 <output_line@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <gen_pop@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"andb ,s\00"
@.str.1 = [9 x i8] c"anda 1,s\00"
define void @gen_and() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_line(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @gen_pop()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"andb ,s\00"
@.str.1 = [9 x i8] c"anda 1,s\00"
define void @gen_and() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @gen_pop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void testPromotion(int a, char b) {
  if (b > 10) {
    if (a == b) {
      clang_analyzer_eval(a > 10);
      clang_analyzer_eval(
          a <= (char)((unsigned char)(~0U) & ((unsigned char)(~0U) >> 1)));
    }
  }
}


x86 assembly (clang, -O0):
<testPromotion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jle    1164 <testPromotion+0x54>
mov    -0x4(%rbp),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    115f <testPromotion+0x4f>
cmpl   $0xa,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    1164 <testPromotion+0x54>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testPromotion>:
cmp    $0xb,%sil
jl     1130 <testPromotion+0x20>
cmp    %edi,%esi
jne    1130 <testPromotion+0x20>
push   %rax
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <clang_analyzer_eval@plt>
ret

LLVM IR (-O0):
define void @testPromotion(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sgt i32 %6, 10
br i1 %7, label %8, label %23
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %22
13: ; preds = %8
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 10
%16 = zext i1 %15 to i32
%17 = call i32 @clang_analyzer_eval(i32 %16)
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 127
%20 = zext i1 %19 to i32
%21 = call i32 @clang_analyzer_eval(i32 %20)
br label %22
22: ; preds = %13, %8
br label %23
23: ; preds = %22, %2
ret void
}

LLVM IR (-O2):
define void @testPromotion(i32 %0, i8 signext %1) {
%3 = icmp sgt i8 %1, 10
%4 = sext i8 %1 to i32
%5 = icmp eq i32 %4, %0
%6 = and i1 %3, %5
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @clang_analyzer_eval(i32 1)
%9 = tail call i32 @clang_analyzer_eval(i32 1)
br label %10
10: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mymodule_destroy();
int mymodule_get();
int /*<<< orphan*/ mymodule_init();
int /*<<< orphan*/ mymodule_set(int);
int /*<<< orphan*/ mysubmodule_destroy();
int /*<<< orphan*/ mysubmodule_init();
int main() {
  mymodule_init();
  mysubmodule_init();
  mymodule_set(50);
  int x = mymodule_get();
  mysubmodule_destroy();
  mymodule_destroy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <mymodule_init@plt>
mov    $0x0,%al
call   1060 <mysubmodule_init@plt>
mov    $0x32,%edi
call   1050 <mymodule_set@plt>
mov    $0x0,%al
call   1030 <mymodule_get@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <mysubmodule_destroy@plt>
mov    $0x0,%al
call   1070 <mymodule_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <mymodule_init@plt>
xor    %eax,%eax
call   1060 <mysubmodule_init@plt>
mov    $0x32,%edi
call   1050 <mymodule_set@plt>
xor    %eax,%eax
call   1030 <mymodule_get@plt>
xor    %eax,%eax
call   1040 <mysubmodule_destroy@plt>
xor    %eax,%eax
call   1070 <mymodule_destroy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @mymodule_init()
%4 = call i32 (...) @mysubmodule_init()
%5 = call i32 @mymodule_set(i32 50)
%6 = call i32 (...) @mymodule_get()
store i32 %6, i32* %2
%7 = call i32 (...) @mysubmodule_destroy()
%8 = call i32 (...) @mymodule_destroy()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mymodule_init()
%2 = tail call i32 (...) @mysubmodule_init()
%3 = tail call i32 @mymodule_set(i32 50)
%4 = tail call i32 (...) @mymodule_get()
%5 = tail call i32 (...) @mysubmodule_destroy()
%6 = tail call i32 (...) @mymodule_destroy()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_getu32() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_getu32"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_tagstruct_getu32\00"
define i32 @pa_tagstruct_getu32() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
XFreeModifiermap() {}


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

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

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

LLVM IR (-O2):
define i32 @XFreeModifiermap() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_78() {
  Assert_real((isqrt(78) == 8),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              395, ("Integer square root of 78 should be 8"));
}


x86 assembly (clang, -O0):
<t_sqrt_78>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e,%edi
call   1030 <isqrt@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x18b,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_78>:
push   %rax
mov    $0x4e,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x18b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 78 should be 8\00"
define void @t_sqrt_78() {
%1 = call i32 @isqrt(i32 78)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 78 should be 8\00"
define void @t_sqrt_78() {
%1 = tail call i32 @isqrt(i32 78)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ctest_test_assert_add(int, char *);
int ctest_assert_null(void *avalue, char *message) {
  if (avalue == NULL) {
    ctest_test_assert_add(0, message);
    return 0;
  }
  ctest_test_assert_add(1, message);
  return -1;
}


x86 assembly (clang, -O0):
<ctest_assert_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <ctest_assert_null+0x32>
mov    -0x18(%rbp),%rsi
xor    %edi,%edi
call   1030 <ctest_test_assert_add@plt>
movl   $0x0,-0x4(%rbp)
jmp    1157 <ctest_assert_null+0x47>
mov    -0x18(%rbp),%rsi
mov    $0x1,%edi
call   1030 <ctest_test_assert_add@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctest_assert_null>:
push   %rbx
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%ebx
neg    %ebx
mov    %eax,%edi
call   1030 <ctest_test_assert_add@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ctest_assert_null(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = call i32 @ctest_test_assert_add(i32 0, i8* %9)
store i32 0, i32* %3
br label %14
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i32 @ctest_test_assert_add(i32 1, i8* %12)
store i32 -1, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @ctest_assert_null(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
%6 = xor i1 %3, true
%7 = sext i1 %6 to i32
%8 = tail call i32 @ctest_test_assert_add(i32 %5, i8* %1)
ret i32 %7
}
void null_stabinit(char *file, int argc, char *argv[]) {}


x86 assembly (clang, -O0):
<null_stabinit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @null_stabinit(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
ret void
}

LLVM IR (-O2):
define void @null_stabinit(i8* nocapture %0, i32 %1, i8** nocapture %2) {
ret void
}
__attribute__((no)) int max_reg_num(void) { return 100; }


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

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

LLVM IR (-O0):
define i32 @max_reg_num() {
ret i32 100
}

LLVM IR (-O2):
define i32 @max_reg_num() {
ret i32 100
}