xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EVT_exit();
int /*<<< orphan*/ PM_fatalError(char *);
void _EVT_abort(int signal) {
  (void)signal;
  EVT_exit();
  PM_fatalError("Unhandled exception!");
}


x86 assembly (clang, -O0):
<_EVT_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <EVT_exit@plt>
lea    0xec7(%rip),%rdi
call   1030 <PM_fatalError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EVT_abort>:
push   %rax
xor    %eax,%eax
call   1040 <EVT_exit@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <PM_fatalError@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Unhandled exception!\00"
define void @_EVT_abort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @EVT_exit()
%5 = call i32 @PM_fatalError(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Unhandled exception!\00"
define void @_EVT_abort(i32 %0) {
%2 = tail call i32 (...) @EVT_exit()
%3 = tail call i32 @PM_fatalError(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int calc_padding(unsigned int orig_size, unsigned int block_size) {
  unsigned int remainder, padding;
  remainder = orig_size % block_size;
  if (remainder == 0) {
    padding = 0;
  } else {
    padding = block_size - remainder;
  }
  return (padding);
}


x86 assembly (clang, -O0):
<calc_padding>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112b <calc_padding+0x2b>
movl   $0x0,-0x10(%rbp)
jmp    1134 <calc_padding+0x34>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_padding>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%esi
test   %edx,%edx
cmove  %edx,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @calc_padding(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* %3
%8 = load i32, i32* %4
%9 = urem i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %6
br label %17
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = sub i32 %14, %15
store i32 %16, i32* %6
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @calc_padding(i32 %0, i32 %1) {
%3 = urem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = sub i32 %1, %3
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
long double longdouble_ignoring_longlongint(long double x, long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_longlongint>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_longlongint>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @longdouble_ignoring_longlongint(x86_fp80 %0, i64 %1) {
%3 = alloca x86_fp80
%4 = alloca i64
store x86_fp80 %0, x86_fp80* %3
store i64 %1, i64* %4
%5 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_longlongint(x86_fp80 returned %0, i64 %1) {
ret x86_fp80 %0
}
void IntAssign(void *array1, void *array2, int i, int j) {
  ((int *)array1)[i] = ((int *)array2)[j];
}


x86 assembly (clang, -O0):
<IntAssign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntAssign>:
movslq %ecx,%rax
mov    (%rsi,%rax,4),%eax
movslq %edx,%rcx
mov    %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @IntAssign(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %8
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = load i8*, i8** %5
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %14, i32* %19
ret void
}

LLVM IR (-O2):
define void @IntAssign(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = bitcast i8* %1 to i32*
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = load i32, i32* %7
%9 = bitcast i8* %0 to i32*
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i32, i32* %9, i64 %10
store i32 %8, i32* %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ WIFSIGNALED(int /*<<< orphan*/);
int WTERMSIG(int /*<<< orphan*/);
int Signal(uint32_t *w) {
  if (!WIFSIGNALED(*w))
    return -1;
  return WTERMSIG(*w);
}


x86 assembly (clang, -O0):
<Signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <WIFSIGNALED@plt>
cmp    $0x0,%eax
jne    114c <Signal+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <Signal+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <WTERMSIG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Signal>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <WIFSIGNALED@plt>
test   %eax,%eax
je     1137 <Signal+0x17>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <WTERMSIG@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Signal(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @WIFSIGNALED(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %0
%7 = tail call i32 @WTERMSIG(i32 %6)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ shellout(char const *, int, int);
void display_help(const char cmd[]) { (void)shellout(cmd, -1, 1); }


x86 assembly (clang, -O0):
<display_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1030 <shellout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_help>:
mov    $0xffffffff,%esi
mov    $0x1,%edx
jmp    1030 <shellout@plt>

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

LLVM IR (-O2):
define void @display_help(i8* %0) {
%2 = tail call i32 @shellout(i8* %0, i32 -1, i32 1)
ret void
}
/* Variables and functions */
double sin(double);
double m_sin(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<m_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @m_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ test_float();
int /*<<< orphan*/ test_int();
int main(void) {
  test_int();
  test_float();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_int()
%2 = tail call i32 (...) @test_float()
ret i32 0
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char *argv[]) {
  int c, n = 0;
  while ((c = getchar()) != 'Q')
    printf("char %3d is %c (%d)\n", ++n, c, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x51,%eax
je     1170 <main+0x50>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x18(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x51,%eax
je     115d <main+0x3d>
mov    $0x1,%ebx
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0x51,%eax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"char %3d is %c (%d)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
br label %8
8: ; preds = %11, %2
%9 = call i32 (...) @getchar()
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 81
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %7
%13 = add nsw i32 %12, 1
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
br label %8
17: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"char %3d is %c (%d)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, 81
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %6, i32 %6)
%10 = tail call i32 (...) @getchar()
%11 = icmp eq i32 %10, 81
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i32 0
}
unsigned long long foo(unsigned long long a, unsigned char *b,
                       unsigned short *c) {
  return a + *b * *c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
mov    -0x18(%rbp),%rdx
movzwl (%rdx),%edx
imul   %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movzbl (%rsi),%ecx
movzwl (%rdx),%eax
imul   %rcx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0, i8* %1, i16* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i16*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i16* %2, i16** %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i16*, i16** %6
%12 = load i16, i16* %11
%13 = zext i16 %12 to i32
%14 = mul nsw i32 %10, %13
%15 = sext i32 %14 to i64
%16 = add i64 %7, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i8* nocapture %1, i16* nocapture %2) {
%4 = load i8, i8* %1
%5 = zext i8 %4 to i64
%6 = load i16, i16* %2
%7 = zext i16 %6 to i64
%8 = mul nuw nsw i64 %7, %5
%9 = add i64 %8, %0
ret i64 %9
}
char *a() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @a() {
ret i8* undef
}
int mini(int x, int y) { return (x < y ? x : y); }


x86 assembly (clang, -O0):
<mini>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <mini+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <mini+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mini>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @mini(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int);
int /*<<< orphan*/ usleep(unsigned int);
void internal_sleep(unsigned int usecs) {
  sleep(usecs / 1000000);
  usleep(usecs % 1000000);
}


x86 assembly (clang, -O0):
<internal_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <sleep@plt>
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_sleep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %edi,%eax
imul   $0x431bde83,%rax,%rbx
shr    $0x32,%rbx
mov    %ebx,%edi
call   1030 <sleep@plt>
imul   $0xf4240,%ebx,%eax
sub    %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @internal_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 %3, 1000000
%5 = call i32 @sleep(i32 %4)
%6 = load i32, i32* %2
%7 = urem i32 %6, 1000000
%8 = call i32 @usleep(i32 %7)
ret void
}

LLVM IR (-O2):
define void @internal_sleep(i32 %0) {
%2 = udiv i32 %0, 1000000
%3 = tail call i32 @sleep(i32 %2)
%4 = urem i32 %0, 1000000
%5 = tail call i32 @usleep(i32 %4)
ret void
}
void DefaultVICHandler(void) {
  (*(volatile unsigned long *)(0xFFFFF000 + 0x030)) = 0;
  while (1)
    ;
}


x86 assembly (clang, -O0):
<DefaultVICHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff030,%eax
movq   $0x0,(%rax)
jmp    1110 <DefaultVICHandler+0x10>

x86 assembly (clang, -O2):
<DefaultVICHandler>:
mov    $0xfffff030,%eax
movq   $0x0,(%rax)
nopl   0x0(%rax)
jmp    1110 <DefaultVICHandler+0x10>

LLVM IR (-O0):
define void @DefaultVICHandler() {
store volatile i64 0, i64* inttoptr (i64 4294963248 to i64*)
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @DefaultVICHandler() {
store volatile i64 0, i64* inttoptr (i64 4294963248 to i64*)
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xi_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @xi_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int pthread_kill(int /*<<< orphan*/, int);
int /*<<< orphan*/ pthread_self();
int raise(int sig) { return pthread_kill(pthread_self(), sig); }


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <pthread_kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <pthread_kill@plt>

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_self()
%4 = load i32, i32* %2
%5 = call i32 @pthread_kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_kill(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ do_output_WAVfile(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ unknown_com();
void setSaveWAV(char *rel, char *filename) {
  if (strcmp(rel, "=") == 0) {
    do_output_WAVfile(filename);
  } else {
    unknown_com();
  }
}


x86 assembly (clang, -O0):
<setSaveWAV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <setSaveWAV+0x38>
mov    -0x10(%rbp),%rdi
call   1040 <do_output_WAVfile@plt>
jmp    116f <setSaveWAV+0x3f>
mov    $0x0,%al
call   1030 <unknown_com@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSaveWAV>:
push   %rbx
mov    %rsi,%rbx
lea    0xec5(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     114d <setSaveWAV+0x1d>
xor    %eax,%eax
pop    %rbx
jmp    1030 <unknown_com@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <do_output_WAVfile@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
define void @setSaveWAV(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 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @do_output_WAVfile(i8* %9)
br label %13
11: ; preds = %2
%12 = call i32 (...) @unknown_com()
br label %13
13: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define void @setSaveWAV(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @do_output_WAVfile(i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @unknown_com()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ line();
int /*<<< orphan*/ name(char const *);
int /*<<< orphan*/ string(char *);
void log_cachednxdomain(const char *dn) {
  string("     cc nxdomain ");
  name(dn);
  line();
}


x86 assembly (clang, -O0):
<log_cachednxdomain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <string@plt>
mov    -0x8(%rbp),%rdi
call   1040 <name@plt>
mov    $0x0,%al
call   1050 <line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_cachednxdomain>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <string@plt>
mov    %rbx,%rdi
call   1040 <name@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <line@plt>

LLVM IR (-O0):
@.str = [18 x i8] c" cc nxdomain \00"
define void @log_cachednxdomain(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @string(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @name(i8* %4)
%6 = call i32 (...) @line()
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c" cc nxdomain \00"
define void @log_cachednxdomain(i8* %0) {
%2 = tail call i32 @string(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @name(i8* %0)
%4 = tail call i32 (...) @line()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
FILE *efopen(const char *fname, const char *mode) {
  FILE *fp;
  if ((fp = fopen(fname, mode)) == NULL) {
    fprintf(stderr, "Err: could not open file \"%s\"\n", fname);
    exit(EXIT_FAILURE);
  }
  return fp;
}


x86 assembly (clang, -O0):
<efopen>:
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   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1182 <efopen+0x52>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efopen>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <efopen+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Err: could not open file \22%s\22\0A\00"
@EXIT_FAILURE = global i32 0
define i32* @efopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Err: could not open file \22%s\22\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i32* @efopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void press_key() { system("read -p \"Press [Enter] key to continue...\""); }


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"read -p \22Press [Enter] key to continue...\22\00"
define void @press_key() {
%1 = call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"read -p \22Press [Enter] key to continue...\22\00"
define void @press_key() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
int post_increment(int *x) { return (*x)++; }


x86 assembly (clang, -O0):
<post_increment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<post_increment>:
mov    (%rdi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @post_increment(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret i32 %2
}
/* Variables and functions */
int atoi(char const *);
int safe_atoi(const char *str) {
  if (str)
    return atoi(str);
  else
    return 0;
}


x86 assembly (clang, -O0):
<safe_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <safe_atoi+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    113f <safe_atoi+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_atoi>:
test   %rdi,%rdi
je     111a <safe_atoi+0xa>
jmp    1030 <atoi@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @safe_atoi(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @atoi(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x33() {
  Assert_real((islower(51) == 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_islower.c",
              260, ("islower should be 0 for 3"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x33>:
push   %rax
mov    $0x33,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x104,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for 3\00"
define void @t_islower_0x33() {
%1 = call i64 @islower(i32 51)
%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 260, 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for 3\00"
define void @t_islower_0x33() {
%1 = tail call i64 @islower(i32 51)
%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 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getpid();
int my_gettid(void) { return getpid(); }


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

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

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

LLVM IR (-O2):
define i32 @my_gettid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void yyerror(const char *format, ...) { fputs("", stderr); }


x86 assembly (clang, -O0):
<yyerror>:
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>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
define void @yyerror(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@stderr = global i32 0
define void @yyerror(i8* nocapture readnone %0, ...) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ast_unregister_file_version(char *);
void __attribute__((destructor)) __unregister_file_version(void) {
  ast_unregister_file_version(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/"
      "master/plc.c");
}


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

x86 assembly (clang, -O2):
<__unregister_file_version>:
lea    0xee9(%rip),%rdi
jmp    1030 <ast_unregister_file_version@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/tpenguin/solarisvoip-asterisk/refs/heads/master/plc.c\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__unregister_file_version, i8* null }]
define void @__unregister_file_version() {
%1 = call i32 @ast_unregister_file_version(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0))
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/tpenguin/solarisvoip-asterisk/refs/heads/master/plc.c\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__unregister_file_version, i8* null }]
define void @__unregister_file_version() {
%1 = tail call i32 @ast_unregister_file_version(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int time(int /*<<< orphan*/);
void waitFor(unsigned int secs) {
  unsigned int retTime = time(0) + secs;
  while (time(0) < retTime)
    ;
}


x86 assembly (clang, -O0):
<waitFor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <time@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <time@plt>
cmp    -0x8(%rbp),%eax
jae    113d <waitFor+0x2d>
jmp    1128 <waitFor+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitFor>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %edi,%edi
call   1030 <time@plt>
cmp    %ebx,%eax
jb     1120 <waitFor+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @waitFor(i32 %0) {
%2 = tail call i32 @time(i32 0)
%3 = add i32 %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @time(i32 0)
%6 = icmp ult i32 %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
void *shmat(int shmid, const void *shmaddr, int shmflg) {
  return (void *)(long)shmid;
}


x86 assembly (clang, -O0):
<shmat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmat>:
movslq %edi,%rax
ret

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

LLVM IR (-O2):
define i8* @shmat(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
size_t atomic_add_size_t(size_t *, int);
size_t atomic_inc_size_t(size_t *var) { return atomic_add_size_t(var, 1); }


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

x86 assembly (clang, -O2):
<atomic_inc_size_t>:
mov    $0x1,%esi
jmp    1030 <atomic_add_size_t@plt>

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

LLVM IR (-O2):
define i64 @atomic_inc_size_t(i64* %0) {
%2 = tail call i64 @atomic_add_size_t(i64* %0, i32 1)
ret i64 %2
}
int modulo(int x, int m) {
  int r = x % m;
  return r < 0 ? r + m : r;
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    112c <modulo+0x2c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <modulo+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
int isdigit(int c) { return (c >= '0' && c <= '9' ? 1 : 0); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(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 label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float sqrtf(float);
float shape2(float x) { return x / sqrtf(1.0f + x * x); }


x86 assembly (clang, -O0):
<shape2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec3(%rip),%xmm1
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shape2>:
push   %rax
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm0
addss  0xee0(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112e <shape2+0x1e>
sqrtss %xmm0,%xmm0
jmp    113f <shape2+0x2f>
movss  %xmm2,0x4(%rsp)
call   1030 <sqrtf@plt>
movss  0x4(%rsp),%xmm2
divss  %xmm0,%xmm2
movaps %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @shape2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float %4, float %5, float 1.000000e+00)
%7 = call float @sqrtf(float %6)
%8 = fdiv float %3, %7
ret float %8
}

LLVM IR (-O2):
define float @shape2(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float %0, float 1.000000e+00)
%3 = tail call float @sqrtf(float %2)
%4 = fdiv float %0, %3
ret float %4
}
int test_imm_BBuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xBB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BBuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 187
%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_BBuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 803158884352
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double millimetresToMetres(double millimetres) { return millimetres / 1000.0; }


x86 assembly (clang, -O0):
<millimetresToMetres>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<millimetresToMetres>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @millimetresToMetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+03
ret double %4
}

LLVM IR (-O2):
define double @millimetresToMetres(double %0) {
%2 = fdiv double %0, 1.000000e+03
ret double %2
}
/* Variables and functions */
long long PAPI_get_real_cyc();
void PAPIF_GET_REAL_CYC(long long *real_cyc) {
  *real_cyc = PAPI_get_real_cyc();
}


x86 assembly (clang, -O0):
<PAPIF_GET_REAL_CYC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_get_real_cyc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_GET_REAL_CYC>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_get_real_cyc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_GET_REAL_CYC(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_get_real_cyc()
store i64 %2, i64* %0
ret void
}
int ia_times(int value, int index, int x) { return value * x; }


x86 assembly (clang, -O0):
<ia_times>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ia_times(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 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ia_times(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ panic(int);
void panic7() { panic(8); }


x86 assembly (clang, -O0):
<panic7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic7>:
mov    $0x8,%edi
jmp    1030 <panic@plt>

LLVM IR (-O0):
define void @panic7() {
%1 = call i32 @panic(i32 8)
ret void
}

LLVM IR (-O2):
define void @panic7() {
%1 = tail call i32 @panic(i32 8)
ret void
}
int parse(enum token *tok) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @parse(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printtokenlist(int);
int /*<<< orphan*/ stderr;
int Exit(int code) {
  fprintf(stderr, "The tokens remaining when aborting:\n");
  printtokenlist(10);
  exit(code);
}


x86 assembly (clang, -O0):
<Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xa,%edi
call   1030 <printtokenlist@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Exit>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xa,%edi
call   1030 <printtokenlist@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"The tokens remaining when aborting:\0A\00"
define i32 @Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printtokenlist(i32 10)
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"The tokens remaining when aborting:\0A\00"
define i32 @Exit(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printtokenlist(i32 10)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
int next_number(int n) { return n == 2 ? 0 : n + 1; }


x86 assembly (clang, -O0):
<next_number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    111b <next_number+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <next_number+0x24>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_number>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x2,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @next_number(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 0, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @next_number(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = add nsw i32 %0, 1
%4 = select i1 %2, i32 0, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clearscreen();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int administrator(char userid[4], int usertype, int weekends) {
  clearscreen();
  printf("\n\nAdministrator Functions");
  printf("\n\nPress <ENTER> to exit\n");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<administrator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clearscreen@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<administrator>:
push   %rax
xor    %eax,%eax
call   1040 <clearscreen@plt>
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0A\0AAdministrator Functions\00"
@.str.1 = [25 x i8] c"\0A\0APress <ENTER> to exit\0A\00"
define i32 @administrator(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (...) @clearscreen()
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0A\0AAdministrator Functions\00"
@str = [24 x i8] c"\0A\0APress <ENTER> to exit\00"
define i32 @administrator(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @clearscreen()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_rule() {
  printf("TODO: print_rulen\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"TODO: print_rulen\00"
define void @print_rule() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}