xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "usage: %s file\n", argv[0]);
    exit(1);
  }
  printf("processing %s\n", argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     116f <main+0x3f>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    114a <main+0x1a>
mov    0x8(%rsi),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"usage: %s file\0A\00"
@.str.1 = [15 x i8] c"processing %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}
/* Variables and functions */
int minuscula(char *);
int /*<<< orphan*/ printf(char *);
main() {
  if (minuscula("DAVI") == 1) {
    printf("Minusculo");
  } else {
    printf("Maiusculo");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <minuscula@plt>
cmp    $0x1,%eax
jne    1155 <main+0x35>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1161 <main+0x41>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <minuscula@plt>
cmp    $0x1,%eax
lea    0xece(%rip),%rax
lea    0xed1(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"DAVI\00"
@.str.1 = [10 x i8] c"Minusculo\00"
@.str.2 = [10 x i8] c"Maiusculo\00"
define i32 @main() {
%1 = tail call i32 @minuscula(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
int tl_free(void *ptr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tl_free(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
void *kzalloc(unsigned int, unsigned int);
void *devm_kzalloc(struct device *dev, unsigned int size, unsigned int flags) {
  return kzalloc(size, flags);
}


x86 assembly (clang, -O0):
<devm_kzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <kzalloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devm_kzalloc>:
mov    %esi,%edi
mov    %edx,%esi
jmp    1030 <kzalloc@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
define i8* @devm_kzalloc(%struct.device* %0, i32 %1, i32 %2) {
%4 = alloca %struct.device*
%5 = alloca i32
%6 = alloca i32
store %struct.device* %0, %struct.device** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i8* @kzalloc(i32 %7, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.device = type { i32 }
define i8* @devm_kzalloc(%struct.device* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i8* @kzalloc(i32 %1, i32 %2)
ret i8* %4
}
/* Type definitions */
struct cirTreeFile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freez(struct cirTreeFile **);
void cirTreeFileDetach(struct cirTreeFile **pCrt) { freez(pCrt); }


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

x86 assembly (clang, -O2):
<cirTreeFileDetach>:
jmp    1030 <freez@plt>

LLVM IR (-O0):
%struct.cirTreeFile = type { i32 }
define void @cirTreeFileDetach(%struct.cirTreeFile** %0) {
%2 = alloca %struct.cirTreeFile**
store %struct.cirTreeFile** %0, %struct.cirTreeFile*** %2
%3 = load %struct.cirTreeFile**, %struct.cirTreeFile*** %2
%4 = call i32 @freez(%struct.cirTreeFile** %3)
ret void
}

LLVM IR (-O2):
%struct.cirTreeFile = type { i32 }
define void @cirTreeFileDetach(%struct.cirTreeFile** %0) {
%2 = tail call i32 @freez(%struct.cirTreeFile** %0)
ret void
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 1373777115UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      local1++;
    }
    output[0UL] = ((state[0UL] >> 13UL) | (state[0UL] << 51UL)) * 269947149UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x51e22cdb,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1141 <RandomFunc+0x41>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rax
shr    $0xd,%rax
mov    -0x18(%rbp),%rcx
shl    $0x33,%rcx
or     %rcx,%rax
imul   $0x1017110d,%rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x51e22cdb,%eax
add    (%rdi),%rax
rol    $0x33,%rax
imul   $0x1017110d,%rax,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, 1373777115
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i64, i64* %6
%17 = add i64 %16, 1
store i64 %17, i64* %6
br label %12
18: ; preds = %12
%19 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%20 = load i64, i64* %19
%21 = lshr i64 %20, 13
%22 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%23 = load i64, i64* %22
%24 = shl i64 %23, 51
%25 = or i64 %21, %24
%26 = mul i64 %25, 269947149
%27 = load i64*, i64** %4
%28 = getelementptr inbounds i64, i64* %27, i64 0
store i64 %26, i64* %28
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 1373777115
%5 = tail call i64 @llvm.fshl.i64(i64 %4, i64 %4, i64 51)
%6 = mul i64 %5, 269947149
store i64 %6, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ voronoi(float, float, float, float *, float *, int,
                           int /*<<< orphan*/);
float voronoi_F3(float x, float y, float z) {
  float da[4], pa[12];
  voronoi(x, y, z, da, pa, 1, 0);
  return da[2];
}


x86 assembly (clang, -O0):
<voronoi_F3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  -0x18(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voronoi_F3>:
sub    $0x48,%rsp
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  0x8(%rsp),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define float @voronoi_F3(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca [4 x float]
%8 = alloca [12 x float]
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = load float, float* %6
%12 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%13 = getelementptr inbounds [12 x float], [12 x float]* %8, i64 0, i64 0
%14 = call i32 @voronoi(float %9, float %10, float %11, float* %12, float* %13, i32 1, i32 0)
%15 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 2
%16 = load float, float* %15
ret float %16
}

LLVM IR (-O2):
define float @voronoi_F3(float %0, float %1, float %2) {
%4 = alloca [4 x float]
%5 = alloca [12 x float]
%6 = bitcast [4 x float]* %4 to i8*
%7 = bitcast [12 x float]* %5 to i8*
%8 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
%9 = getelementptr inbounds [12 x float], [12 x float]* %5, i64 0, i64 0
%10 = call i32 @voronoi(float %0, float %1, float %2, float* %8, float* %9, i32 1, i32 0)
%11 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 2
%12 = load float, float* %11
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void SayHello(char *str) { puts(str); }


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

x86 assembly (clang, -O2):
<SayHello>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @SayHello(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_perf_simple(int, int);
int main(void) {
  test_perf_simple(0, 100000);
  test_perf_simple(0, 1000000);
  test_perf_simple(0x0040, 100000);
  test_perf_simple(0x0040, 1000000);
  test_perf_simple(0x0200, 100000);
  test_perf_simple(0x0200, 1000000);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x186a0,%esi
call   1030 <test_perf_simple@plt>
xor    %edi,%edi
mov    $0xf4240,%esi
call   1030 <test_perf_simple@plt>
mov    $0x40,%edi
mov    $0x186a0,%esi
call   1030 <test_perf_simple@plt>
mov    $0x40,%edi
mov    $0xf4240,%esi
call   1030 <test_perf_simple@plt>
mov    $0x200,%edi
mov    $0x186a0,%esi
call   1030 <test_perf_simple@plt>
mov    $0x200,%edi
mov    $0xf4240,%esi
call   1030 <test_perf_simple@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_perf_simple(i32 0, i32 100000)
%3 = call i32 @test_perf_simple(i32 0, i32 1000000)
%4 = call i32 @test_perf_simple(i32 64, i32 100000)
%5 = call i32 @test_perf_simple(i32 64, i32 1000000)
%6 = call i32 @test_perf_simple(i32 512, i32 100000)
%7 = call i32 @test_perf_simple(i32 512, i32 1000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_perf_simple(i32 0, i32 100000)
%2 = tail call i32 @test_perf_simple(i32 0, i32 1000000)
%3 = tail call i32 @test_perf_simple(i32 64, i32 100000)
%4 = tail call i32 @test_perf_simple(i32 64, i32 1000000)
%5 = tail call i32 @test_perf_simple(i32 512, i32 100000)
%6 = tail call i32 @test_perf_simple(i32 512, i32 1000000)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *const, char *);
FILE *read_file(const char *const filename) {
  if (filename == NULL)
    return NULL;
  FILE *fp = fopen(filename, "r");
  if (fp == NULL)
    return NULL;
  return fp;
}


x86 assembly (clang, -O0):
<read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <read_file+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1168 <read_file+0x58>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <read_file+0x50>
movq   $0x0,-0x8(%rbp)
jmp    1168 <read_file+0x58>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_file>:
test   %rdi,%rdi
je     1121 <read_file+0x11>
lea    0xee4(%rip),%rsi
jmp    1030 <fopen@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @read_file(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32* [ %4, %3 ], [ null, %1 ]
ret i32* %6
}
unsigned xrop3_203_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @InitPlatformDependentStuff() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CrestInit();
void __globinit_heapsort(void) {
  { __CrestInit(); }
}


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

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

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

LLVM IR (-O2):
define void @__globinit_heapsort() {
%1 = tail call i32 (...) @__CrestInit()
ret void
}
/* Variables and functions */
long strtol(char *, char **, int);
int safe_atoi(char *s, int *val) {
  long l;
  char *endp;
  l = strtol(s, &endp, 10);
  if (s != endp && *endp == '\0') {
    *val = l;
    return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<safe_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     116c <safe_atoi+0x5c>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116c <safe_atoi+0x5c>
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1173 <safe_atoi+0x63>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_atoi>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,%rcx
mov    (%rsp),%rdx
mov    $0xffffffff,%eax
cmp    %rbx,%rdx
je     1142 <safe_atoi+0x32>
cmpb   $0x0,(%rdx)
jne    1142 <safe_atoi+0x32>
mov    %ecx,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @safe_atoi(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtol(i8* %0, i8** %3, i32 10)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = trunc i64 %5 to i32
store i32 %12, i32* %1
br label %13
13: ; preds = %2, %8, %11
%14 = phi i32 [ 0, %11 ], [ -1, %8 ], [ -1, %2 ]
ret i32 %14
}
/* Variables and functions */
char *SDL_ltoa(long, char *, int);
char *SDL_itoa(int value, char *string, int radix) {
  return SDL_ltoa((long)value, string, radix);
}


x86 assembly (clang, -O0):
<SDL_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x4(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <SDL_ltoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_itoa>:
movslq %edi,%rdi
jmp    1030 <SDL_ltoa@plt>

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

LLVM IR (-O2):
define i8* @SDL_itoa(i32 %0, i8* %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = tail call i8* @SDL_ltoa(i64 %4, i8* %1, i32 %2)
ret i8* %5
}
void ERR_set_error_data(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_set_error_data() {
ret void
}
int g2(int a) { return a + 256; }


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

x86 assembly (clang, -O2):
<g2>:
lea    0x100(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @g2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 256
ret i32 %4
}

LLVM IR (-O2):
define i32 @g2(i32 %0) {
%2 = add nsw i32 %0, 256
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XUnregisterIMInstantiateCallback() {
  printf("XUnregisterIMInstantiateCallback called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"XUnregisterIMInstantiateCallback called\0A\00"
define i32 @XUnregisterIMInstantiateCallback() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [40 x i8] c"XUnregisterIMInstantiateCallback called\00"
define i32 @XUnregisterIMInstantiateCallback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned char getc(void) {
  while (!((*(volatile unsigned long *)0x50000010) & (1)))
    ;
  return (*(volatile unsigned char *)0x50000024);
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <getc+0x9>
mov    $0x50000010,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <getc+0x2b>
jmp    1130 <getc+0x30>
jmp    1109 <getc+0x9>
mov    $0x50000024,%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
testq  $0x1,0x50000010
je     1100 <getc>
mov    0x50000024,%al
ret

LLVM IR (-O0):
define zeroext i8 @getc() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%3 = and i64 %2, 1
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i8, i8* inttoptr (i64 1342177316 to i8*)
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 1342177316 to i8*)
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ expression();
int /*<<< orphan*/ init();
int main(int argc, const char *argv[]) {
  init();
  expression();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init@plt>
xor    %eax,%eax
call   1040 <expression@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init()
%7 = call i32 (...) @expression()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @expression()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello() {
  printf("Hello!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Hello!\0A\00"
define i32 @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
define i32 @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct server_process {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct server_process *);
void delete_server_process(struct server_process *ptr_sp) { free(ptr_sp); }


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

x86 assembly (clang, -O2):
<delete_server_process>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.server_process = type { i32 }
define void @delete_server_process(%struct.server_process* %0) {
%2 = alloca %struct.server_process*
store %struct.server_process* %0, %struct.server_process** %2
%3 = load %struct.server_process*, %struct.server_process** %2
%4 = call i32 @free(%struct.server_process* %3)
ret void
}

LLVM IR (-O2):
%struct.server_process = type { i32 }
define void @delete_server_process(%struct.server_process* nocapture %0) {
%2 = tail call i32 @free(%struct.server_process* %0)
ret void
}
/* Variables and functions */
int expf(int);
float sigmoidFunc(float input) { return 1 / (1 + expf(-1 * input)); }


x86 assembly (clang, -O0):
<sigmoidFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <expf@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoidFunc>:
push   %rax
xorps  0xee8(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1030 <expf@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sigmoidFunc(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float -1.000000e+00, %3
%5 = fptosi float %4 to i32
%6 = call i32 @expf(i32 %5)
%7 = add nsw i32 1, %6
%8 = sdiv i32 1, %7
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @sigmoidFunc(float %0) {
%2 = fneg float %0
%3 = fptosi float %2 to i32
%4 = tail call i32 @expf(i32 %3)
%5 = add nsw i32 %4, 1
%6 = add i32 %4, 2
%7 = icmp ult i32 %6, 3
%8 = select i1 %7, i32 %5, i32 0
%9 = sitofp i32 %8 to float
ret float %9
}
void test_100(volatile float *x, unsigned int y, float z) { x[y] = z; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%eax
movss  %xmm0,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @test_100(float* %0, i32 %1, float %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca float
store float* %0, float** %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
store volatile float %7, float* %11
ret void
}

LLVM IR (-O2):
define void @test_100(float* %0, i32 %1, float %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
store volatile float %2, float* %5
ret void
}
void f3(void) {
#pragma omp critical
  {
#pragma omp ordered
    ;
  }
}


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

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

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

LLVM IR (-O2):
define void @f3() {
ret void
}
int more(int a, int b) { return a > b; }


x86 assembly (clang, -O0):
<more>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<more>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @more(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @more(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skipblanks(char *p) {
  while (isspace(*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skipblanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipblanks+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipblanks+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipblanks>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipblanks+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipblanks(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
int test_imm_17uint16_mem(unsigned short *val) {
  return ((*val) & (-0x17 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_17uint16_mem>:
movzwl (%rdi),%eax
test   $0xffe9,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_17uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -23
%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_17uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -23
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ err(char *);
scalar_t__ putchar(int);
void write(int c) {
  if (putchar(c) == EOF)
    err("putchar()");
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
jne    114f <write+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rax
call   1030 <putchar@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jne    113f <write+0x1f>
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <err@plt>
pop    %rax
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [10 x i8] c"putchar()\00"
define void @write(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @putchar(i32 %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [10 x i8] c"putchar()\00"
define void @write(i32 %0) {
%2 = tail call i64 @putchar(i32 %0)
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
int isfixable(name)
char *name;
{
  char buffer[1000];
  strcpy(buffer, "_");
  strcat(buffer, name);
  strcat(buffer, "ptr");
  return istype(buffer);
}


x86 assembly (clang, -O0):
<isfixable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x3f0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
lea    -0x3f0(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1040 <strcat@plt>
lea    -0x3f0(%rbp),%rdi
mov    $0x0,%al
call   1050 <istype@plt>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfixable>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rdi,%rsi
movw   $0x5f,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movl   $0x727470,(%rsp,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <istype@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"_\00"
@.str.1 = [4 x i8] c"ptr\00"
define i32 @isfixable(i8* %0) {
%2 = alloca i8*
%3 = alloca [1000 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i8* @strcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i8* @strcat(i8* %6, i8* %7)
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = call i8* @strcat(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @istype to i32 (i8*, ...)*)(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @isfixable(i8* nocapture %0) {
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = bitcast [1000 x i8]* %2 to i16*
store i16 95, i16* %4
%5 = call i8* @strcat(i8* %3, i8* dereferenceable(1) %0)
%6 = call i64 @strlen(i8* %3)
%7 = getelementptr [1000 x i8], [1000 x i8]* %2, i64 0, i64 %6
%8 = bitcast i8* %7 to i32*
store i32 7500912, i32* %8
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @istype to i32 (i8*, ...)*)(i8* %3)
ret i32 %9
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("!!!Hello World!!!");
  printf("hello\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"!!!Hello World!!!\00"
@.str.1 = [7 x i8] c"hello\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"!!!Hello World!!!\00"
@EXIT_SUCCESS = global i32 0
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void sayarch(x) char *x;
{ printf("This architecture %s procedure descriptors\n", x); }


x86 assembly (clang, -O0):
<sayarch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sayarch>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"This architecture %s procedure descriptors\0A\00"
define void @sayarch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"This architecture %s procedure descriptors\0A\00"
define void @sayarch(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) bar(int k) {
  int n = k % 2;
  if (n == 0)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113a <bar+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   $0x1,%dil
je     1117 <bar+0x7>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ removeCommand(char const *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
void removeMonitor(const char *command) {
  char *buf;
  removeCommand(command);
  buf = (char *)malloc(strlen(command) + 2);
  strcpy(buf, command);
  strcat(buf, "?");
  removeCommand(buf);
  free(buf);
}


x86 assembly (clang, -O0):
<removeMonitor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1080 <removeCommand@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x2,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x10(%rbp),%rdi
call   1080 <removeCommand@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeMonitor>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1080 <removeCommand@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0x2(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
mov    %rbx,%rdi
call   1080 <removeCommand@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
define void @removeMonitor(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @removeCommand(i8* %4)
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 2
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @strcat(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %3
%17 = call i32 @removeCommand(i8* %16)
%18 = load i8*, i8** %3
%19 = call i32 @free(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define void @removeMonitor(i8* %0) {
%2 = tail call i32 @removeCommand(i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 2
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
%8 = tail call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @removeCommand(i8* %6)
%10 = tail call i32 @free(i8* %6)
ret void
}
void ble_rsp_attributes_read(const struct ble_msg_attributes_read_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attributes_read_rsp_t = type opaque
define void @ble_rsp_attributes_read(%struct.ble_msg_attributes_read_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
double fmod(double, double);
double r_fmod(double x, double y) { return fmod(x, y); }


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

x86 assembly (clang, -O2):
<r_fmod>:
jmp    1030 <fmod@plt>

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

LLVM IR (-O2):
define double @r_fmod(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
ret double %3
}