xunge/DecIR huggingface dataset:
int is_palindrome(const int candidate, const int base) {
  int num = candidate;
  int n = 0;
  while (num) {
    n = n * base + num % base;
    num /= base;
  }
  return candidate == n;
}


x86 assembly (clang, -O0):
<is_palindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114b <is_palindrome+0x4b>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1117 <is_palindrome+0x17>
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome>:
xor    %ecx,%ecx
test   %edi,%edi
je     111c <is_palindrome+0x1c>
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
cltd
idiv   %esi
imul   %esi,%ecx
add    %edx,%ecx
test   %eax,%eax
jne    1110 <is_palindrome+0x10>
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_palindrome(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
store i32 %7, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = add nsw i32 %14, %17
store i32 %18, i32* %6
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = sdiv i32 %20, %19
store i32 %21, i32* %5
br label %8
22: ; preds = %8
%23 = load i32, i32* %3
%24 = load i32, i32* %6
%25 = icmp eq i32 %23, %24
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_palindrome(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32 [ %10, %4 ], [ %0, %2 ]
%7 = mul nsw i32 %5, %1
%8 = srem i32 %6, %1
%9 = add nsw i32 %8, %7
%10 = sdiv i32 %6, %1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
%14 = icmp eq i32 %13, %0
%15 = zext i1 %14 to i32
ret i32 %15
}
unsigned int SquareOfSums(unsigned int num) {
  unsigned int sum = 0;
  sum = (num * (num + 1)) / 2;
  sum *= sum;
  return sum;
}


x86 assembly (clang, -O0):
<SquareOfSums>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SquareOfSums>:
lea    0x1(%rdi),%eax
imul   %edi,%eax
shr    %eax
imul   %eax,%eax
ret

LLVM IR (-O0):
define i32 @SquareOfSums(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = add i32 %5, 1
%7 = mul i32 %4, %6
%8 = udiv i32 %7, 2
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = mul i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @SquareOfSums(i32 %0) {
%2 = add i32 %0, 1
%3 = mul i32 %2, %0
%4 = lshr i32 %3, 1
%5 = mul i32 %4, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
main() {
  foo(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
ret i32 0
}
char *rng_name(void) { return "xorshift128+"; }


x86 assembly (clang, -O0):
<rng_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"xorshift128+\00"
define i8* @rng_name() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"xorshift128+\00"
define i8* @rng_name() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int DesenhaLinha(int n) {
  int i = 0;
  for (i = 0; i < n; i++) {
    printf("=");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<DesenhaLinha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114f <DesenhaLinha+0x3f>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <DesenhaLinha+0x19>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DesenhaLinha>:
push   %rbx
test   %edi,%edi
jle    112f <DesenhaLinha+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <DesenhaLinha+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @DesenhaLinha(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 61)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i32 10)
ret i32 0
}
void FaultISR(void) {
  {}
}


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

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

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

LLVM IR (-O2):
define void @FaultISR() {
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ eprintf(char *);
scalar_t__ ferror(int /*<<< orphan*/);
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int inputc(void) {
  int ch;
  ch = getc(stdin);
  if (ch == EOF && ferror(stdin))
    eprintf("getc <stdin>:");
  return ch;
}


x86 assembly (clang, -O0):
<inputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%eax
jne    117f <inputc+0x4f>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     117f <inputc+0x4f>
lea    0xe86(%rip),%rdi
call   1040 <eprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputc>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
call   1050 <getc@plt>
mov    %eax,%ebx
mov    0x2e94(%rip),%rax
cmp    (%rax),%ebx
jne    1169 <inputc+0x39>
mov    (%r14),%edi
call   1030 <ferror@plt>
test   %rax,%rax
je     1169 <inputc+0x39>
lea    0xe9c(%rip),%rdi
call   1040 <eprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
@.str = [14 x i8] c"getc <stdin>:\00"
define i32 @inputc() {
%1 = alloca i32
%2 = load i32, i32* @stdin
%3 = call i32 @getc(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* @stdin
%9 = call i64 @ferror(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @eprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %7, %0
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
@.str = [14 x i8] c"getc <stdin>:\00"
define i32 @inputc() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32, i32* @stdin
%7 = tail call i64 @ferror(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @eprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %5, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ uart_write_char(unsigned char const);
void uart_write_chars(const unsigned char *buffer, size_t size) {
  size_t i;
  for (i = 0; i < size; i++) {
    uart_write_char(buffer[i]);
  }
}


x86 assembly (clang, -O0):
<uart_write_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <uart_write_chars+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <uart_write_char@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <uart_write_chars+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_write_chars>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <uart_write_chars+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1030 <uart_write_char@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <uart_write_chars+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @uart_write_chars(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @uart_write_char(i8 zeroext %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
void teardown() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ClientDisconnect() {
ret void
}
int my_strlen(char *s) {
  int l;
  l = 0;
  while (*s++ != '\0')
    l++;
  return l;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <my_strlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
cmpb   $0x0,(%rdi)
je     111c <my_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
unsigned int H(unsigned int x, unsigned int y, unsigned int z) {
  return x ^ y ^ z;
}


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

x86 assembly (clang, -O2):
<H>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @H(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* %5
%9 = xor i32 %7, %8
%10 = load i32, i32* %6
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @H(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
void MergeUVRow_16_C() {}


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

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

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

LLVM IR (-O2):
define void @MergeUVRow_16_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compnum(int /*<<< orphan*/);
int /*<<< orphan*/ number();
void pound() { compnum(number()); }


x86 assembly (clang, -O0):
<pound>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <number@plt>
mov    %eax,%edi
call   1040 <compnum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pound>:
push   %rax
xor    %eax,%eax
call   1030 <number@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <compnum@plt>

LLVM IR (-O0):
define void @pound() {
%1 = call i32 (...) @number()
%2 = call i32 @compnum(i32 %1)
ret void
}

LLVM IR (-O2):
define void @pound() {
%1 = tail call i32 (...) @number()
%2 = tail call i32 @compnum(i32 %1)
ret void
}
void swaplong(long *along) {
  unsigned char *temp, temp2;
  temp = (unsigned char *)along;
  temp2 = temp[0];
  temp[0] = temp[3];
  temp[3] = temp2;
  temp2 = temp[1];
  temp[1] = temp[2];
  temp[2] = temp2;
}


x86 assembly (clang, -O0):
<swaplong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swaplong>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @swaplong(i64* nocapture %0) {
%2 = bitcast i64* %0 to i8*
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 3
%5 = load i8, i8* %4
store i8 %5, i8* %2
store i8 %3, i8* %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %2, i64 2
%9 = load i8, i8* %8
store i8 %9, i8* %6
store i8 %7, i8* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bitfn_swap64(int /*<<< orphan*/ const);
void store_be64_aligned(uint8_t *dst, const uint64_t v) {
  *((uint64_t *)dst) = bitfn_swap64(v);
}


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

x86 assembly (clang, -O2):
<store_be64_aligned>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <bitfn_swap64@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @store_be64_aligned(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @bitfn_swap64(i32 %1)
store i32 %3, i32* %0
ret void
}
void fill(void **arr, int length, void *(*func)()) {
  int i = 0;
  while (i < length)
    arr[i++] = func();
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <fill+0x49>
mov    $0x0,%al
call   *-0x18(%rbp)
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    111a <fill+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <fill+0x32>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   *%r14
mov    %rax,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1120 <fill+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fill(i8** nocapture writeonly %0, i32 %1, i8* (...)* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %10, %7 ]
%9 = tail call i8* (...) %2()
%10 = add nuw nsw i64 %8, 1
%11 = getelementptr inbounds i8*, i8** %0, i64 %8
store i8* %9, i8** %11
%12 = icmp eq i64 %10, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %3
ret void
}
int ft_any(char **tab, int (*f)(char *)) {
  int i;
  i = -1;
  while (tab && tab[++i])
    if (f(tab[i]) == 1)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x1d(%rbp)
je     1142 <ft_any+0x42>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1152 <ft_any+0x52>
jmp    117e <ft_any+0x7e>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rdi
call   *%rax
cmp    $0x1,%eax
jne    1179 <ft_any+0x79>
movl   $0x1,-0x4(%rbp)
jmp    1185 <ft_any+0x85>
jmp    1117 <ft_any+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_any>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
test   %rdi,%rdi
je     113a <ft_any+0x3a>
mov    %rsi,%rbx
mov    %rdi,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%rbp),%rdi
test   %rdi,%rdi
je     113a <ft_any+0x3a>
call   *%rbx
add    $0x8,%rbp
cmp    $0x1,%eax
jne    1120 <ft_any+0x20>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_any(i8** %0, i32 (i8*)* nocapture %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %13, label %4
4: ; preds = %2, %10
%5 = phi i64 [ %6, %10 ], [ -1, %2 ]
%6 = add nsw i64 %5, 1
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 %1(i8* %8)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %4
13: ; preds = %10, %4, %2
%14 = phi i32 [ 0, %2 ], [ 1, %10 ], [ 0, %4 ]
ret i32 %14
}
void repeat_outportsl(int port, void *addr, int cnt) {
  __asm__ volatile("cld \n"
                   "rep outsl"
                   : "=S"(addr), "=c"(cnt)
                   : "d"(port), "0"(addr), "1"(cnt)
                   : "cc");
}


x86 assembly (clang, -O0):
<repeat_outportsl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
cld
rep outsl %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeat_outportsl>:
mov    %edx,%ecx
mov    %edi,%edx
cld
rep outsl %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @repeat_outportsl(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 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call { i8*, i32 } asm sideeffect "cld \0Arep outsl", "={si},={cx},{dx},0,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %7, i8* %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @repeat_outportsl(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld \0Arep outsl", "={si},={cx},{dx},0,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}
void stats_buckets_init(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @reserve_memory_for_watchdog() {
ret void
}
const char *db_create_check_total_view_sql(void) {
  static const char *query = "CREATE VIEW check_total AS"
                             "  SELECT"
                             "    Entity,"
                             "    sum(Balance) AS 'Check Total'"
                             "    FROM current_trial_balance"
                             "    GROUP BY Entity"
                             "    ORDER BY Entity ASC";
  return query;
}


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

x86 assembly (clang, -O2):
<db_create_check_total_view_sql>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@db_create_check_total_view_sql.query = internal global i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i32 0, i32 0)
@.str = [151 x i8] c"CREATE VIEW check_total AS SELECT Entity, sum(Balance) AS 'Check Total' FROM current_trial_balance GROUP BY Entity ORDER BY Entity ASC\00"
define i8* @db_create_check_total_view_sql() {
%1 = load i8*, i8** @db_create_check_total_view_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [151 x i8] c"CREATE VIEW check_total AS SELECT Entity, sum(Balance) AS 'Check Total' FROM current_trial_balance GROUP BY Entity ORDER BY Entity ASC\00"
define i8* @db_create_check_total_view_sql() {
ret i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0)
}
void get_end_time(double *t) { *t = 10; }


x86 assembly (clang, -O0):
<get_end_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_end_time>:
movabs $0x4024000000000000,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @get_end_time(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
store double 1.000000e+01, double* %3
ret void
}

LLVM IR (-O2):
define void @get_end_time(double* nocapture writeonly %0) {
store double 1.000000e+01, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Arg_print();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
void errorNoArg(char *name, char *arg) {
  printf("no argument is given to switch: %s\n"
         "expects arg: %s\n",
         name, arg);
  Arg_print();
  exit(0);
}


x86 assembly (clang, -O0):
<errorNoArg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <Arg_print@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<errorNoArg>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <Arg_print@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"no argument is given to switch: %s\0Aexpects arg: %s\0A\00"
define void @errorNoArg(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 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 (...) @Arg_print()
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [52 x i8] c"no argument is given to switch: %s\0Aexpects arg: %s\0A\00"
define void @errorNoArg(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 (...) @Arg_print()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello world\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_CDuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xCD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CDuint64_midword_reg>:
test   $0xcd0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CDuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 205
%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_CDuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13434880
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int foo11(int c) {
  static int local1, local2;
  local1 = 0;
  local2 += c;
  local1 = 2;
  local2++;
  return local1 + local2;
}


x86 assembly (clang, -O0):
<foo11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,0x2f13(%rip)
mov    -0x4(%rbp),%eax
add    0x2f0e(%rip),%eax
mov    %eax,0x2f08(%rip)
movl   $0x2,0x2efa(%rip)
mov    0x2ef8(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eef(%rip)
mov    0x2ee5(%rip),%eax
add    0x2ee3(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo11>:
mov    0x2f1e(%rip),%eax
lea    (%rax,%rdi,1),%ecx
add    $0x1,%ecx
mov    %ecx,0x2f12(%rip)
add    %edi,%eax
add    $0x3,%eax
ret

LLVM IR (-O0):
@foo11.local1 = internal global i32 0
@foo11.local2 = internal global i32 0
define i32 @foo11(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* @foo11.local1
%3 = load i32, i32* %2
%4 = load i32, i32* @foo11.local2
%5 = add nsw i32 %4, %3
store i32 %5, i32* @foo11.local2
store i32 2, i32* @foo11.local1
%6 = load i32, i32* @foo11.local2
%7 = add nsw i32 %6, 1
store i32 %7, i32* @foo11.local2
%8 = load i32, i32* @foo11.local1
%9 = load i32, i32* @foo11.local2
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@foo11.local2 = internal unnamed_addr global i32 0
define i32 @foo11(i32 %0) {
%2 = load i32, i32* @foo11.local2
%3 = add nsw i32 %2, %0
%4 = add nsw i32 %3, 1
store i32 %4, i32* @foo11.local2
%5 = add nsw i32 %3, 3
ret i32 %5
}
int mg_b64idx(int c) {
  if (c < 26) {
    return c + 'A';
  } else if (c < 52) {
    return c - 26 + 'a';
  } else if (c < 62) {
    return c - 52 + '0';
  } else {
    return c == 62 ? '+' : '/';
  }
}


x86 assembly (clang, -O0):
<mg_b64idx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jge    111f <mg_b64idx+0x1f>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <mg_b64idx+0x6b>
cmpl   $0x34,-0x8(%rbp)
jge    113a <mg_b64idx+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x1a,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <mg_b64idx+0x6b>
cmpl   $0x3e,-0x8(%rbp)
jge    1155 <mg_b64idx+0x55>
mov    -0x8(%rbp),%eax
sub    $0x34,%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <mg_b64idx+0x6b>
mov    -0x8(%rbp),%edx
mov    $0x2f,%eax
mov    $0x2b,%ecx
cmp    $0x3e,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_b64idx>:
mov    %edi,%eax
cmp    $0x19,%edi
jg     110b <mg_b64idx+0xb>
add    $0x41,%eax
ret
cmp    $0x33,%eax
ja     1114 <mg_b64idx+0x14>
add    $0x47,%eax
ret
cmp    $0x3d,%eax
ja     111d <mg_b64idx+0x1d>
add    $0xfffffffc,%eax
ret
xor    %ecx,%ecx
cmp    $0x3e,%eax
setne  %cl
lea    0x2b(,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @mg_b64idx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 26
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 65
store i32 %8, i32* %2
br label %28
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 52
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 26
%15 = add nsw i32 %14, 97
store i32 %15, i32* %2
br label %28
16: ; preds = %9
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 62
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 52
%22 = add nsw i32 %21, 48
store i32 %22, i32* %2
br label %28
23: ; preds = %16
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 62
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 43, i32 47
store i32 %27, i32* %2
br label %28
28: ; preds = %23, %19, %12, %6
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @mg_b64idx(i32 %0) {
%2 = icmp slt i32 %0, 26
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nsw i32 %0, 65
br label %16
5: ; preds = %1
%6 = icmp ult i32 %0, 52
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = add nuw nsw i32 %0, 71
br label %16
9: ; preds = %5
%10 = icmp ult i32 %0, 62
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = add nsw i32 %0, -4
br label %16
13: ; preds = %9
%14 = icmp eq i32 %0, 62
%15 = select i1 %14, i32 43, i32 47
br label %16
16: ; preds = %13, %11, %7, %3
%17 = phi i32 [ %4, %3 ], [ %8, %7 ], [ %12, %11 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("The value of the macro EOF is: %d\n", EOF);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"The value of the macro EOF is: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @EOF
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The value of the macro EOF is: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/, char *);
int /*<<< orphan*/ run_wisp_test(char *);
void wisp_tests() {
  assert(run_wisp_test("test/stress.wisp"), "Wisp stress test");
  assert(run_wisp_test("test/eq-test.wisp"), "Wisp equality");
}


x86 assembly (clang, -O0):
<wisp_tests>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <run_wisp_test@plt>
mov    %eax,%edi
lea    0xed8(%rip),%rsi
call   1030 <assert@plt>
lea    0xedd(%rip),%rdi
call   1040 <run_wisp_test@plt>
mov    %eax,%edi
lea    0xee1(%rip),%rsi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wisp_tests>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <run_wisp_test@plt>
lea    0xedd(%rip),%rsi
mov    %eax,%edi
call   1030 <assert@plt>
lea    0xee0(%rip),%rdi
call   1040 <run_wisp_test@plt>
lea    0xee6(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"test/stress.wisp\00"
@.str.1 = [17 x i8] c"Wisp stress test\00"
@.str.2 = [18 x i8] c"test/eq-test.wisp\00"
@.str.3 = [14 x i8] c"Wisp equality\00"
define void @wisp_tests() {
%1 = call i32 @run_wisp_test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @assert(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @run_wisp_test(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @assert(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"test/stress.wisp\00"
@.str.1 = [17 x i8] c"Wisp stress test\00"
@.str.2 = [18 x i8] c"test/eq-test.wisp\00"
@.str.3 = [14 x i8] c"Wisp equality\00"
define void @wisp_tests() {
%1 = tail call i32 @run_wisp_test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @run_wisp_test(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @assert(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret void
}
float Minus(float a, float b) { return (a - b); }


x86 assembly (clang, -O0):
<Minus>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Minus>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Minus(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @Minus(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ quick_sort(int *, int);
int main() {
  int a[] = {7, 8, 4, 2, 7, 8, 6, 2, 6, 7, 6, 7, 4, 3};
  print_array(a, sizeof(a) / sizeof(a[0]));
  quick_sort(a, sizeof(a) / sizeof(int));
  print_array(a, sizeof(a) / sizeof(a[0]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0xe,%esi
call   1030 <print_array@plt>
lea    -0x40(%rbp),%rdi
mov    $0xe,%esi
call   1050 <quick_sort@plt>
lea    -0x40(%rbp),%rdi
mov    $0xe,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0xf04(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
call   1040 <quick_sort@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [14 x i32] [i32 7, i32 8, i32 4, i32 2, i32 7, i32 8, i32 6, i32 2, i32 6, i32 7, i32 6, i32 7, i32 4, i32 3]
define i32 @main() {
%1 = alloca [14 x i32]
%2 = bitcast [14 x i32]* %1 to i8*
%3 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 14)
%5 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%6 = call i32 @quick_sort(i32* %5, i32 14)
%7 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%8 = call i32 @print_array(i32* %7, i32 14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [14 x i32] [i32 7, i32 8, i32 4, i32 2, i32 7, i32 8, i32 6, i32 2, i32 6, i32 7, i32 6, i32 7, i32 4, i32 3]
define i32 @main() {
%1 = alloca [14 x i32]
%2 = bitcast [14 x i32]* %1 to i8*
%3 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 14)
%5 = call i32 @quick_sort(i32* %3, i32 14)
%6 = call i32 @print_array(i32* %3, i32 14)
ret i32 0
}
/* Variables and functions */
unsigned char rand_r(unsigned int *);
unsigned int time(int /*<<< orphan*/ *);
void genSaltBin(unsigned char *salt, unsigned int saltlen) {
  unsigned int seed = 0;
  unsigned long n = 0;
  seed = time(NULL);
  for (n = 0; n < saltlen; n++)
    salt[n] = rand_r(&seed);
}


x86 assembly (clang, -O0):
<genSaltBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmp    %rcx,%rax
jae    1189 <genSaltBin+0x69>
lea    -0x10(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <genSaltBin+0x32>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genSaltBin>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r15
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
test   %ebp,%ebp
je     1165 <genSaltBin+0x45>
mov    %ebp,%ebp
xor    %ebx,%ebx
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <rand_r@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <genSaltBin+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @genSaltBin(i8* nocapture writeonly %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = zext i32 %1 to i64
%7 = icmp eq i32 %1, 0
br i1 %7, label %14, label %8
8: ; preds = %2, %8
%9 = phi i64 [ %12, %8 ], [ 0, %2 ]
%10 = call zeroext i8 @rand_r(i32* %3)
%11 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 %10, i8* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %8
14: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xcc() {
  Assert_real((iscntrl(204) == 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_iscntrl.c",
              1025, ("iscntrl should be 0 for 0xcc"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xcc>:
push   %rax
mov    $0xcc,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x401,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xcc\00"
define void @t_iscntrl_0xcc() {
%1 = call i64 @iscntrl(i32 204)
%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 1025, i8* getelementptr inbounds ([29 x i8], [29 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xcc\00"
define void @t_iscntrl_0xcc() {
%1 = tail call i64 @iscntrl(i32 204)
%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 1025, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void on_pulse_distance_change(void) {}


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

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

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

LLVM IR (-O2):
define void @on_pulse_distance_change() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ banktitle(char *);
void obank() { banktitle("Welcome to the First National Bank of Ularn."); }


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"Welcome to the First National Bank of Ularn.\00"
define void @obank() {
%1 = call i32 @banktitle(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Welcome to the First National Bank of Ularn.\00"
define void @obank() {
%1 = tail call i32 @banktitle(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}