xunge/DecIR huggingface dataset:
/* Variables and functions */
double remainer(double, double);
double remquo(double x, double y, int *quo) {
  *quo = (int)x / (int)y;
  return remainer(x, y);
}


x86 assembly (clang, -O0):
<remquo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvttsd2si -0x10(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <remainer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remquo>:
cvttsd2si %xmm0,%eax
cvttsd2si %xmm1,%ecx
cltd
idiv   %ecx
mov    %eax,(%rdi)
jmp    1030 <remainer@plt>

LLVM IR (-O0):
define double @remquo(double %0, double %1, i32* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32*
store double %0, double* %4
store double %1, double* %5
store i32* %2, i32** %6
%7 = load double, double* %4
%8 = fptosi double %7 to i32
%9 = load double, double* %5
%10 = fptosi double %9 to i32
%11 = sdiv i32 %8, %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load double, double* %4
%14 = load double, double* %5
%15 = call double @remainer(double %13, double %14)
ret double %15
}

LLVM IR (-O2):
define double @remquo(double %0, double %1, i32* nocapture writeonly %2) {
%4 = fptosi double %0 to i32
%5 = fptosi double %1 to i32
%6 = sdiv i32 %4, %5
store i32 %6, i32* %2
%7 = tail call double @remainer(double %0, double %1)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int next_token(int /*<<< orphan*/ *);
int expect(FILE *fp, int tok) {
  if (next_token(fp) != tok) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<expect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <next_token@plt>
cmp    -0x14(%rbp),%eax
je     113d <expect+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <expect+0x34>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect>:
push   %rbx
mov    %esi,%ebx
call   1030 <next_token@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @expect(i32* %0, i32 %1) {
%3 = tail call i32 @next_token(i32* %0)
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cgsynand();
int /*<<< orphan*/ gentext();
void genand(void) {
  gentext();
  cgsynand();
}


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

x86 assembly (clang, -O2):
<genand>:
push   %rax
xor    %eax,%eax
call   1040 <gentext@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cgsynand@plt>

LLVM IR (-O0):
define void @genand() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @cgsynand()
ret void
}

LLVM IR (-O2):
define void @genand() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @cgsynand()
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double MPI_Wtime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec + (t.tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<MPI_Wtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Wtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @MPI_Wtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @MPI_Wtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ assert_true_(char *, int, int);
void test_truth_pass() {
  assert_true_("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/"
               "heads/master/test/pass_test.c",
               5, (1));
}


x86 assembly (clang, -O0):
<test_truth_pass>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1030 <assert_true_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_truth_pass>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
jmp    1030 <assert_true_@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_truth_pass() {
%1 = call i32 @assert_true_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 5, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_truth_pass() {
%1 = tail call i32 @assert_true_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 5, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) { nrerror("usage: tinoco [-l #helixlength] [-w] < vie-file"); }


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"usage: tinoco [-l #helixlength] [-w] < vie-file\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"usage: tinoco [-l #helixlength] [-w] < vie-file\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "Version: 0.4, 2009/10/18\n");
  fprintf(stderr, "Usage: %s <host ip> <host mac> <user name> [password]\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xed1(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Version: 0.4, 2009/10/18\0A\00"
@.str.1 = [55 x i8] c"Usage: %s <host ip> <host mac> <user name> [password]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Version: 0.4, 2009/10/18\0A\00"
@.str.1 = [55 x i8] c"Usage: %s <host ip> <host mac> <user name> [password]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _assert_string_equal(char const *, char const *, char *,
                                        int);
scalar_t__ disemvowel(char *);
void test_only_vowels(void) {
  _assert_string_equal(
      (const char *)"", (const char *)disemvowel("aeiouAEIOUOIEAuoiea"),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/"
      "master/disemvowel/disemvowel_test.c",
      17);
}


x86 assembly (clang, -O0):
<test_only_vowels>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <disemvowel@plt>
mov    %rax,%rsi
lea    0xed9(%rip),%rdi
lea    0xed3(%rip),%rdx
mov    $0x11,%ecx
call   1040 <_assert_string_equal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_only_vowels>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <disemvowel@plt>
lea    0xedf(%rip),%rdi
lea    0xed9(%rip),%rdx
mov    %rax,%rsi
mov    $0x11,%ecx
pop    %rax
jmp    1040 <_assert_string_equal@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [20 x i8] c"aeiouAEIOUOIEAuoiea\00"
@.str.2 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/master/disemvowel/disemvowel_test.c\00"
define void @test_only_vowels() {
%1 = call i64 @disemvowel(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = call i32 @_assert_string_equal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.2, i64 0, i64 0), i32 17)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [20 x i8] c"aeiouAEIOUOIEAuoiea\00"
@.str.2 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/master/disemvowel/disemvowel_test.c\00"
define void @test_only_vowels() {
%1 = tail call i64 @disemvowel(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @_assert_string_equal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.2, i64 0, i64 0), i32 17)
ret void
}
/* Variables and functions */
void *realloc(void *, int);
void *sn_realloc(void *ptr, int size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<sn_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define i8* @sn_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
ret i8* %3
}
char *pskip(p)
register char *p;
{
  while (*p && *p != ' ')
    ++p;
  while (*p && *p == ' ')
    *p++ = 0;
  return p;
}


x86 assembly (clang, -O0):
<pskip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <pskip+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <pskip+0x3d>
jmp    114e <pskip+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <pskip+0x8>
jmp    1153 <pskip+0x53>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1178 <pskip+0x78>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1188 <pskip+0x88>
jmp    119f <pskip+0x9f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    1153 <pskip+0x53>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pskip>:
movzbl (%rdi),%eax
test   %al,%al
je     1131 <pskip+0x31>
cmp    $0x20,%al
je     1120 <pskip+0x20>
add    $0x1,%rdi
jmp    1100 <pskip>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rdi),%rax
movb   $0x0,(%rdi)
cmpb   $0x20,0x1(%rdi)
mov    %rax,%rdi
je     1120 <pskip+0x20>
ret
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @pskip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 32
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
br label %19
19: ; preds = %31, %18
%20 = load i8*, i8** %2
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %19
%25 = load i8*, i8** %2
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 32
br label %29
29: ; preds = %24, %19
%30 = phi i1 [ false, %19 ], [ %28, %24 ]
br i1 %30, label %31, label %34
31: ; preds = %29
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %2
store i8 0, i8* %32
br label %19
34: ; preds = %29
%35 = load i8*, i8** %2
ret i8* %35
}

LLVM IR (-O2):
define i8* @pskip(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 32, label %7
i8 0, label %12
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %7
%8 = phi i8* [ %9, %7 ], [ %3, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 32
br i1 %11, label %7, label %12
12: ; preds = %2, %7
%13 = phi i8* [ %9, %7 ], [ %3, %2 ]
ret i8* %13
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int pthread_rwlock_destroy(pthread_rwlock_t *rwlock) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ addrange(struct cstate *, char, int);
void addranges_D(struct cstate *g) {
  addrange(g, 0, '0' - 1);
  addrange(g, '9' + 1, 0xFFFF);
}


x86 assembly (clang, -O0):
<addranges_D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2f,%edx
call   1030 <addrange@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
mov    $0xffff,%edx
call   1030 <addrange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addranges_D>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x2f,%edx
call   1030 <addrange@plt>
mov    %rbx,%rdi
mov    $0x3a,%esi
mov    $0xffff,%edx
pop    %rbx
jmp    1030 <addrange@plt>

LLVM IR (-O0):
%struct.cstate = type { i32 }
define void @addranges_D(%struct.cstate* %0) {
%2 = alloca %struct.cstate*
store %struct.cstate* %0, %struct.cstate** %2
%3 = load %struct.cstate*, %struct.cstate** %2
%4 = call i32 @addrange(%struct.cstate* %3, i8 signext 0, i32 47)
%5 = load %struct.cstate*, %struct.cstate** %2
%6 = call i32 @addrange(%struct.cstate* %5, i8 signext 58, i32 65535)
ret void
}

LLVM IR (-O2):
%struct.cstate = type { i32 }
define void @addranges_D(%struct.cstate* %0) {
%2 = tail call i32 @addrange(%struct.cstate* %0, i8 signext 0, i32 47)
%3 = tail call i32 @addrange(%struct.cstate* %0, i8 signext 58, i32 65535)
ret void
}
/* Variables and functions */
int *getNull();
int *retNull(char cond) {
  static int x;
  return cond ? &x : getNull();
}


x86 assembly (clang, -O0):
<retNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     113b <retNull+0x2b>
lea    0x2efa(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1146 <retNull+0x36>
mov    $0x0,%al
call   1030 <getNull@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retNull>:
test   %dil,%dil
je     111d <retNull+0xd>
lea    0x2f10(%rip),%rax
ret
xor    %eax,%eax
jmp    1030 <getNull@plt>

LLVM IR (-O0):
@retNull.x = internal global i32 0
define i32* @retNull(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = call i32* (...) @getNull()
br label %9
9: ; preds = %7, %6
%10 = phi i32* [ @retNull.x, %6 ], [ %8, %7 ]
ret i32* %10
}

LLVM IR (-O2):
@retNull.x = internal global i32 0
define i32* @retNull(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32* (...) @getNull()
br label %5
5: ; preds = %1, %3
%6 = phi i32* [ %4, %3 ], [ @retNull.x, %1 ]
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ test_nsblk(int);
void test_nsblk_all(void) {
  test_nsblk(0);
  test_nsblk(1);
}


x86 assembly (clang, -O0):
<test_nsblk_all>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <test_nsblk@plt>
mov    $0x1,%edi
call   1030 <test_nsblk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nsblk_all>:
push   %rax
xor    %edi,%edi
call   1030 <test_nsblk@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <test_nsblk@plt>

LLVM IR (-O0):
define void @test_nsblk_all() {
%1 = call i32 @test_nsblk(i32 0)
%2 = call i32 @test_nsblk(i32 1)
ret void
}

LLVM IR (-O2):
define void @test_nsblk_all() {
%1 = tail call i32 @test_nsblk(i32 0)
%2 = tail call i32 @test_nsblk(i32 1)
ret void
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
struct dirent *readdir(DIR *dirp) {
  fputs("readdir\n", stderr);
  return 0;
}


x86 assembly (clang, -O0):
<readdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readdir>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [9 x i8] c"readdir\0A\00"
@stderr = global i32 0
define %struct.dirent* @readdir(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret %struct.dirent* null
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [9 x i8] c"readdir\0A\00"
@stderr = global i32 0
define noalias %struct.dirent* @readdir(i32* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret %struct.dirent* null
}
int array_count(void *array) { return *(int *)(array - sizeof(int)); }


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

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

LLVM IR (-O0):
define i32 @array_count(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @array_count(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cons_putc(int);
void putchar(int c) {
  if (c == '\n')
    cons_putc('\r');
  cons_putc(c);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112f <putchar+0x1f>
mov    $0xd,%edi
call   1030 <cons_putc@plt>
mov    -0x4(%rbp),%edi
call   1030 <cons_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jne    1122 <putchar+0x12>
mov    $0xd,%edi
call   1030 <cons_putc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <cons_putc@plt>

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

LLVM IR (-O2):
define void @putchar(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @cons_putc(i32 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @cons_putc(i32 %0)
ret void
}
int lower(int c) { return (c >= 'A' && c <= 'Z') ? (c + 'a' - 'A') : c; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <lower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <lower+0x2c>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <lower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 97
%11 = sub nsw i32 %10, 65
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long card32;
};
typedef TYPE_1__ XFontProp;

/* Variables and functions */
void set_XFontProp_card32(void *_p, unsigned long _v) {
  ((XFontProp *)_p)->card32 = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XFontProp_card32>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XFontProp_card32(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int foo(void) {
  return 23;
  return 0b1101;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 23
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 23
}
void *GetThunkingHandle() { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @GetThunkingHandle() {
ret i8* null
}
void UnlockBrowse() {}


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

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

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

LLVM IR (-O2):
define void @UnlockBrowse() {
ret void
}
unsigned long hash_func(char *string, unsigned long num_buckets) {
  unsigned long i;
  char *p;
  for (i = 0, p = string; *p; p++)
    i = (9 * i) + *p;
  return i % num_buckets;
}


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <hash_func+0x4e>
imul   $0x9,-0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <hash_func+0x1c>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_func+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,8),%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_func+0x10>
jmp    112a <hash_func+0x2a>
xor    %eax,%eax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     113f <hash_func+0x3f>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_func(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i64 [ %11, %5 ], [ 0, %2 ]
%9 = mul i64 %8, 9
%10 = sext i8 %6 to i64
%11 = add i64 %9, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %11, %5 ]
%17 = urem i64 %16, %1
ret i64 %17
}
void SwapVLine(int index1, int index2, double *v) {
  double temp = v[index1];
  v[index1] = v[index2];
  v[index2] = temp;
}


x86 assembly (clang, -O0):
<SwapVLine>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapVLine>:
movslq %edi,%rax
movsd  (%rdx,%rax,8),%xmm0
movslq %esi,%rcx
movsd  (%rdx,%rcx,8),%xmm1
movsd  %xmm1,(%rdx,%rax,8)
movsd  %xmm0,(%rdx,%rcx,8)
ret

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

LLVM IR (-O2):
define void @SwapVLine(i32 %0, i32 %1, double* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds double, double* %2, i64 %4
%6 = load double, double* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = load double, double* %8
store double %9, double* %5
store double %6, double* %8
ret void
}
int genRGB(int r, int g, int b) {
  return (r & 0xff) | ((g & 0xff) << 8) | ((b & 0xff) << 16);
}


x86 assembly (clang, -O0):
<genRGB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genRGB>:
movzbl %dil,%eax
shl    $0x8,%esi
movzwl %si,%ecx
or     %eax,%ecx
movzbl %dl,%eax
shl    $0x10,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @genRGB(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %0, 255
%5 = shl i32 %1, 8
%6 = and i32 %5, 65280
%7 = or i32 %6, %4
%8 = shl i32 %2, 16
%9 = and i32 %8, 16711680
%10 = or i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ PTRACE_ARCH_PRCTL;
int ptrace(int /*<<< orphan*/, int, unsigned long, int);
int os_arch_prctl(int pid, int option, unsigned long *arg2) {
  return ptrace(PTRACE_ARCH_PRCTL, pid, (unsigned long)arg2, option);
}


x86 assembly (clang, -O0):
<os_arch_prctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%ecx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_arch_prctl>:
mov    %esi,%ecx
mov    %edi,%esi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_ARCH_PRCTL = global i32 0
define i32 @os_arch_prctl(i32 %0, i32 %1, i64* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i32, i32* @PTRACE_ARCH_PRCTL
%8 = load i32, i32* %4
%9 = load i64*, i64** %6
%10 = ptrtoint i64* %9 to i64
%11 = load i32, i32* %5
%12 = call i32 @ptrace(i32 %7, i32 %8, i64 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@PTRACE_ARCH_PRCTL = global i32 0
define i32 @os_arch_prctl(i32 %0, i32 %1, i64* %2) {
%4 = load i32, i32* @PTRACE_ARCH_PRCTL
%5 = ptrtoint i64* %2 to i64
%6 = tail call i32 @ptrace(i32 %4, i32 %0, i64 %5, i32 %1)
ret i32 %6
}
int isIdentChar(int ch) {
  return (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') ||
         (ch >= 'A' && ch <= 'Z') || ch == '_';
}


x86 assembly (clang, -O0):
<isIdentChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isIdentChar+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115c <isIdentChar+0x5c>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <isIdentChar+0x39>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115c <isIdentChar+0x5c>
cmpl   $0x41,-0x4(%rbp)
jl     1152 <isIdentChar+0x52>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115c <isIdentChar+0x5c>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isIdentChar>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
mov    %edi,%ecx
and    $0xffffffdf,%ecx
add    $0xffffffbf,%ecx
cmp    $0x1a,%ecx
setb   %cl
cmp    $0x5f,%edi
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @isIdentChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %23, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br i1 %13, label %23, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 90
br i1 %19, label %23, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 95
br label %23
23: ; preds = %20, %17, %11, %5
%24 = phi i1 [ true, %17 ], [ true, %11 ], [ true, %5 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @isIdentChar(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = icmp eq i32 %0, 95
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
int main() {
  struct PHONE_NUMBER {
    short area;
    short exchange;
    short station;
  };
  struct LONG_DISTANCE_BILL {
    short month;
    short day;
    short year;
    int time;
    struct PHONE_NUMBER called;
    struct PHONE_NUMBER calling;
    struct PHONE_NUMBER billed;
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UARTprintf(char *, ...);
int testUARTstdio(void) {
  UARTprintf("String test: %s\n", "This is a string");
  UARTprintf("Int test: %i\n", 5);
  int i = 6;
  UARTprintf("Pointer test: %p\n", &i);
  return 1;
}


x86 assembly (clang, -O0):
<testUARTstdio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <UARTprintf@plt>
lea    0xeee(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <UARTprintf@plt>
movl   $0x6,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <UARTprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testUARTstdio>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %eax,%eax
call   1030 <UARTprintf@plt>
lea    0xef5(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <UARTprintf@plt>
movl   $0x6,0x4(%rsp)
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <UARTprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"String test: %s\0A\00"
@.str.1 = [17 x i8] c"This is a string\00"
@.str.2 = [14 x i8] c"Int test: %i\0A\00"
@.str.3 = [18 x i8] c"Pointer test: %p\0A\00"
define i32 @testUARTstdio() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @UARTprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @UARTprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 5)
store i32 6, i32* %1
%4 = call i32 (i8*, ...) @UARTprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32* %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"String test: %s\0A\00"
@.str.1 = [17 x i8] c"This is a string\00"
@.str.2 = [14 x i8] c"Int test: %i\0A\00"
@.str.3 = [18 x i8] c"Pointer test: %p\0A\00"
define i32 @testUARTstdio() {
%1 = alloca i32
%2 = tail call i32 (i8*, ...) @UARTprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @UARTprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 5)
%4 = bitcast i32* %1 to i8*
store i32 6, i32* %1
%5 = call i32 (i8*, ...) @UARTprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32* %1)
ret i32 1
}
void f(void) {
  int a;
  a = 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
long telldir(int /*<<< orphan*/ *);
long zfs_telldir(DIR *dirp) { return telldir(dirp); }


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

x86 assembly (clang, -O2):
<zfs_telldir>:
jmp    1030 <telldir@plt>

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

LLVM IR (-O2):
define i64 @zfs_telldir(i32* %0) {
%2 = tail call i64 @telldir(i32* %0)
ret i64 %2
}
void rop3_7_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_7_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_7_0_1>:
mov    (%rdi),%al
mov    %eax,%ecx
and    %sil,%cl
or     %dl,%cl
not    %cl
not    %sil
and    %dl,%sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_7_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %5, %2
%7 = xor i8 %6, -1
%8 = xor i8 %1, -1
%9 = and i8 %8, %2
%10 = and i8 %9, %4
%11 = or i8 %10, %7
store i8 %11, i8* %0
ret void
}
void startWindowsServer(void) {}


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

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

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

LLVM IR (-O2):
define void @startWindowsServer() {
ret void
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};
struct Cyc_IOEffect_Fenv {
  int dummy;
};
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_IOEffect_register_exp_succs_generic(
    struct Cyc_IOEffect_Fenv *, struct Cyc_Absyn_Exp *, struct Cyc_List_List *,
    int /*<<< orphan*/);
void Cyc_IOEffect_register_exp_succs(struct Cyc_IOEffect_Fenv *env,
                                     struct Cyc_Absyn_Exp *e,
                                     struct Cyc_List_List *ql) {
  ({ Cyc_IOEffect_register_exp_succs_generic(env, e, ql, 0); });
}


x86 assembly (clang, -O0):
<Cyc_IOEffect_register_exp_succs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <Cyc_IOEffect_register_exp_succs_generic@plt>
mov    %eax,-0x1c(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_IOEffect_register_exp_succs>:
xor    %ecx,%ecx
jmp    1030 <Cyc_IOEffect_register_exp_succs_generic@plt>

LLVM IR (-O0):
%struct.Cyc_IOEffect_Fenv = type { i32 }
%struct.Cyc_Absyn_Exp = type { i32 }
%struct.Cyc_List_List = type { i32 }
define void @Cyc_IOEffect_register_exp_succs(%struct.Cyc_IOEffect_Fenv* %0, %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_List_List* %2) {
%4 = alloca %struct.Cyc_IOEffect_Fenv*
%5 = alloca %struct.Cyc_Absyn_Exp*
%6 = alloca %struct.Cyc_List_List*
%7 = alloca i32
store %struct.Cyc_IOEffect_Fenv* %0, %struct.Cyc_IOEffect_Fenv** %4
store %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_Absyn_Exp** %5
store %struct.Cyc_List_List* %2, %struct.Cyc_List_List** %6
%8 = load %struct.Cyc_IOEffect_Fenv*, %struct.Cyc_IOEffect_Fenv** %4
%9 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %5
%10 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %6
%11 = call i32 @Cyc_IOEffect_register_exp_succs_generic(%struct.Cyc_IOEffect_Fenv* %8, %struct.Cyc_Absyn_Exp* %9, %struct.Cyc_List_List* %10, i32 0)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret void
}

LLVM IR (-O2):
%struct.Cyc_IOEffect_Fenv = type { i32 }
%struct.Cyc_Absyn_Exp = type { i32 }
%struct.Cyc_List_List = type { i32 }
define void @Cyc_IOEffect_register_exp_succs(%struct.Cyc_IOEffect_Fenv* %0, %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_List_List* %2) {
%4 = tail call i32 @Cyc_IOEffect_register_exp_succs_generic(%struct.Cyc_IOEffect_Fenv* %0, %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_List_List* %2, i32 0)
ret void
}
int compare(const void *arg1, const void *arg2) {
  return *(int *)arg1 - *(int *)arg2;
}


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

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

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int main(void) {
  int a;
  &a - 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = getelementptr inbounds i32, i32* %2, i64 -1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}