xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ is_blankchar(char);
char *ignore_blankchar(char *s) {
  while (is_blankchar(*s))
    s++;
  return s;
}


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

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

LLVM IR (-O0):
define i8* @ignore_blankchar(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 @is_blankchar(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* @ignore_blankchar(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 @is_blankchar(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
}
/* Variables and functions */
scalar_t__ createRGBSurface(unsigned int, unsigned int, unsigned int, int,
                            unsigned int, unsigned int, unsigned int,
                            unsigned int);
void *new_surface(unsigned int width, unsigned int height, unsigned int flags) {
  unsigned int rmask, gmask, bmask, amask;
  rmask = 0xff000000;
  gmask = 0x00ff0000;
  bmask = 0x0000ff00;
  amask = 0x000000ff;
  return (void *)createRGBSurface(flags, width, height, 32, rmask, gmask, bmask,
                                  amask);
}


x86 assembly (clang, -O0):
<new_surface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0xff000000,-0x10(%rbp)
movl   $0xff0000,-0x14(%rbp)
movl   $0xff00,-0x18(%rbp)
movl   $0xff,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%r10d
mov    -0x1c(%rbp),%eax
mov    $0x20,%ecx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <createRGBSurface@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_surface>:
push   %rax
mov    %edx,%eax
mov    %esi,%edx
mov    %edi,%esi
mov    %eax,%edi
mov    $0x20,%ecx
mov    $0xff000000,%r8d
mov    $0xff0000,%r9d
push   $0xff
push   $0xff00
call   1030 <createRGBSurface@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i8* @new_surface(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 -16777216, i32* %7
store i32 16711680, i32* %8
store i32 65280, i32* %9
store i32 255, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = call i64 @createRGBSurface(i32 %11, i32 %12, i32 %13, i32 32, i32 %14, i32 %15, i32 %16, i32 %17)
%19 = inttoptr i64 %18 to i8*
ret i8* %19
}

LLVM IR (-O2):
define i8* @new_surface(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @createRGBSurface(i32 %2, i32 %0, i32 %1, i32 32, i32 -16777216, i32 16711680, i32 65280, i32 255)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_append();
int test_container_of();
int main() {
  int test_result = 1;
  test_result &= test_container_of();
  test_result &= test_append();
  if (test_result)
    printf("All tests passed.\n");
  else
    printf("A test failed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test_container_of@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_append@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117b <main+0x4b>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <main+0x57>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <test_container_of@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <test_append@plt>
and    %ebx,%eax
test   $0x1,%al
lea    0xeb4(%rip),%rax
lea    0xebc(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"All tests passed.\0A\00"
@.str.1 = [16 x i8] c"A test failed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = call i32 (...) @test_container_of()
%4 = load i32, i32* %2
%5 = and i32 %4, %3
store i32 %5, i32* %2
%6 = call i32 (...) @test_append()
%7 = load i32, i32* %2
%8 = and i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"A test failed.\00"
@str.2 = [18 x i8] c"All tests passed.\00"
define i32 @main() {
%1 = tail call i32 (...) @test_container_of()
%2 = and i32 %1, 1
%3 = tail call i32 (...) @test_append()
%4 = and i32 %2, %3
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_number_of_multprec_polynomials(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(442, length, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_multprec_polynomials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1ba,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_multprec_polynomials>:
mov    %rdi,%rsi
mov    $0x1ba,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_number_of_multprec_polynomials(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 442, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_number_of_multprec_polynomials(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 442, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *JLI_MemRealloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (p == 0) {
    perror("realloc");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<JLI_MemRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <JLI_MemRealloc+0x42>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JLI_MemRealloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <JLI_MemRealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
define noalias i8* @JLI_MemRealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long timems() {
  struct timeval ts;
  gettimeofday(&ts, NULL);
  return ts.tv_sec * 1000 + ts.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<timems>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timems>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @timems() {
%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 i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @timems() {
%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 i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x43() {
  Assert_real((isdigit(67) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              340, ("isdigit should be 0 for C"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x43>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x154,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x43>:
push   %rax
mov    $0x43,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x154,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for C\00"
define void @t_isdigit_0x43() {
%1 = call i64 @isdigit(i32 67)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for C\00"
define void @t_isdigit_0x43() {
%1 = tail call i64 @isdigit(i32 67)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void CNonNull(const volatile void *p, const char *text, const char *file,
              int line, const char *func) {
  if (!(p != 0) || 0) {
    deputy_fail_mayreturn("non-null check", text, file, line, func);
  };
}


x86 assembly (clang, -O0):
<CNonNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <CNonNull+0x43>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <deputy_fail_mayreturn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CNonNull>:
test   %rdi,%rdi
je     1116 <CNonNull+0x6>
ret
lea    0xee3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <deputy_fail_mayreturn@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"non-null check\00"
define void @CNonNull(i8* readnone %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = icmp eq i8* %0, null
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (i8*, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @deputy_fail_mayreturn to i32 (i8*, i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i32 %3, i8* %4)
br label %9
9: ; preds = %7, %5
ret void
}
void gamma_dummy_restore(void *state) {}


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

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

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

LLVM IR (-O2):
define void @gamma_dummy_restore(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printStart() {
  printf("/* do not edit -- autogenerated from b85gen */\n");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"/* do not edit -- autogenerated from b85gen */\0A\00"
define void @printStart() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"/* do not edit -- autogenerated from b85gen */\00"
define void @printStart() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_settype(pthread_mutexattr_t *mattr, int kind) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_settype(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
int cache_transferring(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cache_transferring() {
ret i32 0
}
/* Variables and functions */
char *getBraceParam();
int /*<<< orphan*/ safe_free(char *);
void DiscardBraceParam(void) {
  char *s;
  s = getBraceParam();
  if (s)
    safe_free(s);
}


x86 assembly (clang, -O0):
<DiscardBraceParam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getBraceParam@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <DiscardBraceParam+0x27>
mov    -0x8(%rbp),%rdi
call   1040 <safe_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DiscardBraceParam>:
push   %rax
xor    %eax,%eax
call   1030 <getBraceParam@plt>
test   %rax,%rax
je     1136 <DiscardBraceParam+0x16>
mov    %rax,%rdi
pop    %rax
jmp    1040 <safe_free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @DiscardBraceParam() {
%1 = alloca i8*
%2 = call i8* (...) @getBraceParam()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @safe_free(i8* %6)
br label %8
8: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @DiscardBraceParam() {
%1 = tail call i8* (...) @getBraceParam()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @safe_free(i8* %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void on_alarm(int signo) { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @on_alarm(i32 %0) {
%2 = tail call i32 (...) @glutPostRedisplay()
ret void
}
void foo_1_1_2_1_2_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_2_1_1_2() {
ret void
}
/* Variables and functions */
int test_func(int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  int i = test_func(0);
  return !(i == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <test_func@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <test_func@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @test_func(i32 0)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_func(i32 0)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void NclAddUserFuncs() { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_sysinfo(struct sysinfo *);
int sysinfo(struct sysinfo *);
int main(int argc, char **argv) {
  int rv = 0;
  struct sysinfo info;
  rv = sysinfo(&info);
  if (rv != 0) {
    perror("sysinfo");
  }
  print_sysinfo(&info);
  return rv;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <sysinfo@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116f <main+0x3f>
lea    0xe96(%rip),%rdi
call   1040 <perror@plt>
lea    -0x18(%rbp),%rdi
call   1030 <print_sysinfo@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
call   1050 <sysinfo@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1157 <main+0x27>
lea    0x8(%rsp),%rdi
call   1030 <print_sysinfo@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
jmp    1145 <main+0x15>

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

LLVM IR (-O2):
%struct.sysinfo = type { i32 }
@.str = [8 x i8] c"sysinfo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sysinfo
%4 = bitcast %struct.sysinfo* %3 to i8*
%5 = call i32 @sysinfo(%struct.sysinfo* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = call i32 @print_sysinfo(%struct.sysinfo* %3)
ret i32 %5
}
/* Type definitions */
struct gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int cmdline_parser_required(struct gengetopt_args_info *args_info,
                            const char *prog_name) {
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.gengetopt_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @cmdline_parser_required(%struct.gengetopt_args_info* %0, i8* %1) {
%3 = alloca %struct.gengetopt_args_info*
%4 = alloca i8*
store %struct.gengetopt_args_info* %0, %struct.gengetopt_args_info** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @cmdline_parser_required(%struct.gengetopt_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pool_debug_value(void) {
  printf("debug %d\n", 2);
  printf("debug %d\n", (16 + 1));
  printf("debug %d\n", 2);
}


x86 assembly (clang, -O0):
<pool_debug_value>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x11,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_debug_value>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"debug %d\0A\00"
define void @pool_debug_value() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 17)
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"debug %d\0A\00"
define void @pool_debug_value() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 17)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
void display_puts(char *s) {}


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

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

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

LLVM IR (-O2):
define void @display_puts(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_header(void) {
  printf("No. Problem name            Pos. Neg.\n");
  printf("=== ======================= ==== ====\n");
}


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

x86 assembly (clang, -O2):
<print_header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"No. Problem name Pos. Neg.\0A\00"
@.str.1 = [39 x i8] c"=== ======================= ==== ====\0A\00"
define void @print_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"No. Problem name Pos. Neg.\00"
@str.2 = [38 x i8] c"=== ======================= ==== ====\00"
define void @print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_str(char *);
int /*<<< orphan*/ syscall();
void usertask(void) {
  print_str("usertask: 1st call of usertask!\n");
  print_str("usertask: Now, return to kernel mode\n");
  syscall();
  print_str("usertask: 2nd call of usertask!\n");
  print_str("usertask: Now, return to kernel mode\n");
  syscall();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<usertask>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <print_str@plt>
lea    0xeea(%rip),%rdi
call   1030 <print_str@plt>
mov    $0x0,%al
call   1040 <syscall@plt>
lea    0xefd(%rip),%rdi
call   1030 <print_str@plt>
lea    0xecb(%rip),%rdi
call   1030 <print_str@plt>
mov    $0x0,%al
call   1040 <syscall@plt>
jmp    1162 <usertask+0x42>

x86 assembly (clang, -O2):
<usertask>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <print_str@plt>
lea    0xeed(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_str@plt>
xor    %eax,%eax
call   1040 <syscall@plt>
lea    0xefd(%rip),%rdi
call   1030 <print_str@plt>
mov    %rbx,%rdi
call   1030 <print_str@plt>
xor    %eax,%eax
call   1040 <syscall@plt>
xchg   %ax,%ax
jmp    1160 <usertask+0x40>

LLVM IR (-O0):
@.str = [33 x i8] c"usertask: 1st call of usertask!\0A\00"
@.str.1 = [38 x i8] c"usertask: Now, return to kernel mode\0A\00"
@.str.2 = [33 x i8] c"usertask: 2nd call of usertask!\0A\00"
define void @usertask() {
%1 = call i32 @print_str(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_str(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @syscall()
%4 = call i32 @print_str(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @print_str(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @syscall()
br label %7
7: ; preds = %0, %7
br label %7
}

LLVM IR (-O2):
@.str = [33 x i8] c"usertask: 1st call of usertask!\0A\00"
@.str.1 = [38 x i8] c"usertask: Now, return to kernel mode\0A\00"
@.str.2 = [33 x i8] c"usertask: 2nd call of usertask!\0A\00"
define void @usertask() {
%1 = tail call i32 @print_str(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_str(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @syscall()
%4 = tail call i32 @print_str(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @print_str(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @syscall()
br label %7
7: ; preds = %0, %7
br label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ crc32_add_byte(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t crc32(uint8_t *data, size_t size) {
  uint32_t crc = 0;
  size_t i;
  for (i = 0; i < size; i++) {
    crc = crc32_add_byte(crc, data[i]);
  }
  return crc;
}


x86 assembly (clang, -O0):
<crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1164 <crc32+0x54>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <crc32_add_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112f <crc32+0x1f>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1146 <crc32+0x36>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbx,4),%esi
mov    %eax,%edi
call   1030 <crc32_add_byte@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <crc32+0x20>
jmp    1148 <crc32+0x38>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @crc32(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i32 0, i32* %5
store i64 0, i64* %6
br label %7
7: ; preds = %18, %2
%8 = load i64, i64* %6
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32, i32* %5
%13 = load i32*, i32** %3
%14 = load i64, i64* %6
%15 = getelementptr inbounds i32, i32* %13, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @crc32_add_byte(i32 %12, i32 %16)
store i32 %17, i32* %5
br label %18
18: ; preds = %11
%19 = load i64, i64* %6
%20 = add i64 %19, 1
store i64 %20, i64* %6
br label %7
21: ; preds = %7
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @crc32(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ 0, %2 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %5
%8 = load i32, i32* %7
%9 = tail call i32 @crc32_add_byte(i32 %6, i32 %8)
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char a[100];
  char *p = a + 10;
  printf("a addr: %p\n", a);
  printf("p addr: %p\n", p);
  memcpy(a, p, 50);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rax
add    $0xa,%rax
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x78(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    $0x32,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xa(%rsp),%r14
lea    0xecd(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x32,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"a addr: %p\0A\00"
@.str.1 = [12 x i8] c"p addr: %p\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 10
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 @memcpy(i8* %2, i8* %3, i32 50)
ret i32 0
}
int test_fitsBits(int x, int n) {
  int TMin_n = -(1 << (n - 1));
  int TMax_n = (1 << (n - 1)) - 1;
  return x >= TMin_n && x <= TMax_n;
}


x86 assembly (clang, -O0):
<test_fitsBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jl     1150 <test_fitsBits+0x50>
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fitsBits>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
neg    %ecx
cmp    %edi,%ecx
setle  %cl
cmp    %edi,%eax
setg   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @test_fitsBits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
%10 = sub nsw i32 0, %9
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = shl i32 1, %12
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = icmp sge i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i32, i32* %3
%20 = load i32, i32* %6
%21 = icmp sle i32 %19, %20
br label %22
22: ; preds = %18, %2
%23 = phi i1 [ false, %2 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @test_fitsBits(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = sub nsw i32 0, %4
%6 = icmp sle i32 %5, %0
%7 = icmp sgt i32 %4, %0
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
int test_imm_5Aint64_highword_reg(long long val) {
  return ((val >> 32) & (0x5A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Aint64_highword_reg>:
movabs $0x5a00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Aint64_highword_reg(i64 %0) {
%2 = and i64 %0, 386547056640
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memrev32(int /*<<< orphan*/ *);
uint32_t intrev32(uint32_t v) {
  memrev32(&v);
  return v;
}


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

x86 assembly (clang, -O2):
<intrev32>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <memrev32@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @intrev32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @memrev32(i32* %2)
%4 = load i32, i32* %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int init_monitor(int, char **);
int /*<<< orphan*/ ui_mainloop(int);
int main(int argc, char *argv[]) {
  int is_batch_mode = init_monitor(argc, argv);
  ui_mainloop(is_batch_mode);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <init_monitor@plt>
mov    %eax,%edi
call   1030 <ui_mainloop@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**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @init_monitor(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @ui_mainloop(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init_monitor(i32 %0, i8** %1)
%4 = tail call i32 @ui_mainloop(i32 %3)
ret i32 0
}
int double_compare(const void *a, const void *b) {
  if (*((double *)a) > *((double *)b))
    return 1;
  else if (*((double *)a) < *((double *)b))
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<double_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112e <double_compare+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    115b <double_compare+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1154 <double_compare+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <double_compare+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_compare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @double_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp ogt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp olt double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 -1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @double_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
adr0indreg1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*((short *)10000000)) = (*p1); }


x86 assembly (clang, -O0):
<adr0indreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cx
mov    $0x989680,%eax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0indreg1_set>:
movzwl (%r9),%eax
mov    %ax,0x989680
ret

LLVM IR (-O0):
define i32 @adr0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = load i16, i16* %16
store i16 %17, i16* inttoptr (i64 10000000 to i16*)
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @adr0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = load i16, i16* %5
store i16 %7, i16* inttoptr (i64 10000000 to i16*)
ret i32 undef
}
adrx0imm1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (((int *)10000000)[x0]) = 33; }


x86 assembly (clang, -O0):
<adrx0imm1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
movl   $0x21,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0imm1_set>:
movslq %edx,%rax
movl   $0x21,0x989680(,%rax,4)
ret

LLVM IR (-O0):
define i32 @adrx0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %15
store i32 33, i32* %16
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @adrx0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
store i32 33, i32* %8
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void bitwise(int n, int b) { printf("%d & %d = %d\n", n, b, (n & b)); }


x86 assembly (clang, -O0):
<bitwise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitwise>:
mov    %esi,%edx
mov    %edi,%esi
mov    %edx,%ecx
and    %edi,%ecx
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d & %d = %d\0A\00"
define void @bitwise(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 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d & %d = %d\0A\00"
define void @bitwise(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
void SumSquareError_NEON() {}


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

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

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

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