xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ F_DUPFD;
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int dup(int fd1) { return (fcntl(fd1, F_DUPFD, 0)); }


x86 assembly (clang, -O0):
<dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_DUPFD = global i32 0
define i32 @dup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_DUPFD
%5 = call i32 @fcntl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@F_DUPFD = global i32 0
define i32 @dup(i32 %0) {
%2 = load i32, i32* @F_DUPFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
void CameraDMAEnable(unsigned long ulBase) {
  (*((volatile unsigned long *)(ulBase + 0x00000044))) |= 0x00000100;
}


x86 assembly (clang, -O0):
<CameraDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%rcx
or     $0x100,%rcx
mov    %rcx,0x44(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CameraDMAEnable>:
orq    $0x100,0x44(%rdi)
ret

LLVM IR (-O0):
define void @CameraDMAEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 68
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 256
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @CameraDMAEnable(i64 %0) {
%2 = add i64 %0, 68
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 256
store volatile i64 %5, i64* %3
ret void
}
int do_995() { return 995; }


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

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

LLVM IR (-O0):
define i32 @do_995() {
ret i32 995
}

LLVM IR (-O2):
define i32 @do_995() {
ret i32 995
}
/* Variables and functions */
int /*<<< orphan*/ piramide(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  while (n < 2) {
    printf("Escreva um número, senhor Lívio: ");
    scanf("%d", &n);
  }
  piramide(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1171 <main+0x41>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1146 <main+0x16>
mov    -0x8(%rbp),%edi
call   1050 <piramide@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeb8(%rip),%r14
lea    0xed5(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
cmp    $0x2,%edi
jl     1160 <main+0x30>
call   1050 <piramide@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Escreva um n\C3\BAmero, senhor L\C3\ADvio: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = call i32 @piramide(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Escreva um n\C3\BAmero, senhor L\C3\ADvio: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 2
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = call i32 @piramide(i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
main() {
  printf("hello,world\c");
  printf("hello,world\7");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello,worldc\00"
@.str.1 = [13 x i8] c"hello,world\07\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int xerror(Display *dpy, XErrorEvent *e) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xerror(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World");
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t dcf_decode_bcd(uint8_t input) {
  uint8_t result;
  result = (input & 0x0F);
  result += ((input >> 4) & 0x0F) * 10;
  return result;
}


x86 assembly (clang, -O0):
<dcf_decode_bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
imul   $0xa,%eax,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcf_decode_bcd>:
mov    %edi,%eax
and    $0xf,%eax
shr    $0x4,%edi
and    $0xf,%edi
lea    (%rdi,%rdi,4),%ecx
lea    (%rax,%rcx,2),%eax
ret

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

LLVM IR (-O2):
define i32 @dcf_decode_bcd(i32 %0) {
%2 = and i32 %0, 15
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = mul nuw nsw i32 %4, 10
%6 = add nuw nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ UartTxPutChar(int /*<<< orphan*/);
void UartTxPutsf(const char *s) {
  while (*s) {
    UartTxPutChar(*s++);
  }
}


x86 assembly (clang, -O0):
<UartTxPutsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <UartTxPutsf+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <UartTxPutChar@plt>
jmp    111c <UartTxPutsf+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UartTxPutsf>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <UartTxPutsf+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <UartTxPutChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <UartTxPutsf+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @UartTxPutsf(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @UartTxPutChar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
double LONG_MIN;
extern double cmin_long() { return LONG_MIN; }


x86 assembly (clang, -O0):
<cmin_long>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmin_long>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@LONG_MIN = global double 0.000000e+00
define double @cmin_long() {
%1 = load double, double* @LONG_MIN
ret double %1
}

LLVM IR (-O2):
@LONG_MIN = global double 0.000000e+00
define double @cmin_long() {
%1 = load double, double* @LONG_MIN
ret double %1
}
char *langDbgDevSviPrn() { return "SVI Printer"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"SVI Printer\00"
define i8* @langDbgDevSviPrn() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"SVI Printer\00"
define i8* @langDbgDevSviPrn() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
void _XtIsSubclassOf() {}


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

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

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

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

/* Variables and functions */
int iswdigit(int /*<<< orphan*/);
int __iswdigit_l(wint_t c, locale_t l) { return iswdigit(c); }


x86 assembly (clang, -O0):
<__iswdigit_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <iswdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iswdigit_l>:
jmp    1030 <iswdigit@plt>

LLVM IR (-O0):
define i32 @__iswdigit_l(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 = call i32 @iswdigit(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__iswdigit_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswdigit(i32 %0)
ret i32 %3
}
int min(int x, int y) { return (x < y) ? x : y; }


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

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

LLVM IR (-O0):
define i32 @min(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 @min(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 __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = 23;
  while (x >= 0) {
    x = x - y;
    y = y + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x17,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1151 <main+0x41>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
store i32 23, i32* %3
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %5
14: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int bitcount(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, int);
main() {
  unsigned x;
  for (x = 0; x < 100; ++x)
    printf("x=%x, bitcount=%u\n", x, bitcount(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jae    116d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <bitcount@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <bitcount@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"x=%x, bitcount=%u\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @bitcount(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Type definitions */
struct session {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ free(struct session *);
void onShutdown(void *context, int32_t way) {
  struct session *s = (struct session *)context;
  free(s);
}


x86 assembly (clang, -O0):
<onShutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.session = type { i32 }
define void @onShutdown(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.session*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.session*
store %struct.session* %7, %struct.session** %5
%8 = load %struct.session*, %struct.session** %5
%9 = call i32 @free(%struct.session* %8)
ret void
}

LLVM IR (-O2):
%struct.session = type { i32 }
define void @onShutdown(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to %struct.session*
%4 = tail call i32 @free(%struct.session* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ creat(char *, int /*<<< orphan*/);
void stop_daemon() { close(creat("/home/ted/.rwpcd", O_RDWR)); }


x86 assembly (clang, -O0):
<stop_daemon>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <creat@plt>
mov    %eax,%edi
call   1030 <close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_daemon>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <creat@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <close@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/home/ted/.rwpcd\00"
@O_RDWR = global i32 0
define void @stop_daemon() {
%1 = load i32, i32* @O_RDWR
%2 = call i32 @creat(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @close(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/home/ted/.rwpcd\00"
@O_RDWR = global i32 0
define void @stop_daemon() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @creat(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @close(i32 %2)
ret void
}
int myHashCodeInt(void *a) {
  int *aa = (int *)a;
  return *aa;
}


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

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

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

LLVM IR (-O2):
define i32 @myHashCodeInt(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dump_status();
void sig_dump_status(int i) { dump_status(); }


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

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

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

LLVM IR (-O2):
define void @sig_dump_status(i32 %0) {
%2 = tail call i32 (...) @dump_status()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
void set_XEnterWindowEvent_serial(void *_p, unsigned long _v) {
  ((XEnterWindowEvent *)_p)->serial = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEnterWindowEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int COLS;
int LINES;
void advance_pos(int *y, int *x) {
  if ((++*x) > COLS) {
    *x = 0;
    if ((++*y) > LINES)
      *y = 0;
  }
  return;
}


x86 assembly (clang, -O0):
<advance_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
mov    0x2ec2(%rip),%rcx
cmp    (%rcx),%eax
jle    1159 <advance_pos+0x59>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
jle    1154 <advance_pos+0x54>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    1159 <advance_pos+0x59>
pop    %rbp
ret

x86 assembly (clang, -O2):
<advance_pos>:
mov    (%rsi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
mov    0x2ed2(%rip),%rcx
cmp    (%rcx),%eax
jl     112f <advance_pos+0x2f>
movl   $0x0,(%rsi)
mov    (%rdi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rdi)
mov    0x2ec2(%rip),%rdx
xor    %esi,%esi
cmp    (%rdx),%eax
cmovl  %ecx,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
@COLS = global i32 0
@LINES = global i32 0
define void @advance_pos(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 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32, i32* @COLS
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i32*, i32** %4
store i32 0, i32* %11
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
%15 = load i32, i32* @LINES
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = load i32*, i32** %3
store i32 0, i32* %18
br label %19
19: ; preds = %17, %10
br label %20
20: ; preds = %19, %2
ret void
}

LLVM IR (-O2):
@COLS = global i32 0
@LINES = global i32 0
define void @advance_pos(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* @COLS
%6 = icmp slt i32 %3, %5
br i1 %6, label %13, label %7
7: ; preds = %2
store i32 0, i32* %1
%8 = load i32, i32* %0
%9 = add nsw i32 %8, 1
store i32 %9, i32* %0
%10 = load i32, i32* @LINES
%11 = icmp slt i32 %8, %10
%12 = select i1 %11, i32 %9, i32 0
store i32 %12, i32* %0
br label %13
13: ; preds = %7, %2
ret void
}
void S_TouchSound(char *sample) {}


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

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

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

LLVM IR (-O2):
define void @S_TouchSound(i8* nocapture %0) {
ret void
}
to_upper(str) char *str;
{
  char *cp;
  for (cp = str; *cp; cp++) {
    if (islower(*cp))
      *cp -= ('a' - 'A');
  }
}


x86 assembly (clang, -O0):
<to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <to_upper+0x58>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     1152 <to_upper+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
jmp    1157 <to_upper+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <to_upper+0x14>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upper>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%bpl
test   %bpl,%bpl
je     1153 <to_upper+0x43>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    113c <to_upper+0x2c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%ebp
add    $0x1,%rbx
test   %bpl,%bpl
je     1153 <to_upper+0x43>
movsbl %bpl,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     1130 <to_upper+0x20>
add    $0xe0,%bpl
mov    %bpl,-0x1(%rbx)
jmp    1130 <to_upper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @to_upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @islower(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = add i8 %5, -32
store i8 %11, i8* %6
br label %12
12: ; preds = %4, %10
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int semctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int remove_semaphore(int id) { return semctl(id, 0, IPC_RMID); }


x86 assembly (clang, -O0):
<remove_semaphore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <semctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_semaphore>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <semctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @remove_semaphore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @semctl(i32 %3, i32 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @remove_semaphore(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @semctl(i32 %0, i32 0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void fail(char *str) {
  printf(str);
  exit(-1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @fail(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void az_list_destroy_(int *num, int *max, void **items) {
  free(*items);
  *num = 0;
  *max = 0;
  *items = NULL;
}


x86 assembly (clang, -O0):
<az_list_destroy_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_list_destroy_>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdx),%rdi
call   1030 <free@plt>
movl   $0x0,(%r15)
movl   $0x0,(%r14)
movq   $0x0,(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @az_list_destroy_(i32* %0, i32* %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8**
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = load i8*, i8** %7
%9 = call i32 @free(i8* %8)
%10 = load i32*, i32** %4
store i32 0, i32* %10
%11 = load i32*, i32** %5
store i32 0, i32* %11
%12 = load i8**, i8*** %6
store i8* null, i8** %12
ret void
}

LLVM IR (-O2):
define void @az_list_destroy_(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @free(i8* %4)
store i32 0, i32* %0
store i32 0, i32* %1
store i8* null, i8** %2
ret void
}
int fn3(unsigned short a) { return ((int)a) | ((int)~a); }


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x2(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn3(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = xor i32 %6, -1
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @fn3(i16 zeroext %0) {
ret i32 -1
}
void digest_clean() {}


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

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

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

LLVM IR (-O2):
define void @digest_clean() {
ret void
}
int psnip_cpu_count(void) {
  static int count = 0;
  int c;
  if (count != 0)
    return count;
  count = (c > 0) ? c : -1;
  return count;
}


x86 assembly (clang, -O0):
<psnip_cpu_count>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
je     111f <psnip_cpu_count+0x1f>
mov    0x2f0d(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <psnip_cpu_count+0x53>
cmpl   $0x0,-0x8(%rbp)
jle    1134 <psnip_cpu_count+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <psnip_cpu_count+0x41>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <psnip_cpu_count+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,0x2eda(%rip)
mov    0x2ed4(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<psnip_cpu_count>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <psnip_cpu_count+0x10>
movb   $0x1,0x2f14(%rip)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@psnip_cpu_count.count = internal global i32 0
define i32 @psnip_cpu_count() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @psnip_cpu_count.count
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @psnip_cpu_count.count
store i32 %6, i32* %1
br label %16
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i32, i32* %2
br label %13
12: ; preds = %7
br label %13
13: ; preds = %12, %10
%14 = phi i32 [ %11, %10 ], [ -1, %12 ]
store i32 %14, i32* @psnip_cpu_count.count
%15 = load i32, i32* @psnip_cpu_count.count
store i32 %15, i32* %1
br label %16
16: ; preds = %13, %5
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@psnip_cpu_count.count = internal unnamed_addr global i1 false
define i32 @psnip_cpu_count() {
%1 = load i1, i1* @psnip_cpu_count.count
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @psnip_cpu_count.count
br label %3
3: ; preds = %0, %2
ret i32 -1
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 != 0 && *s1 == *s2) {
    s1++;
    s2++;
  }
  return (*(unsigned char *)s1) - (*(unsigned char *)s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void usage() { exit(1); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @usage() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @usage() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
long fli_freelist(char **);
long FLIFreeList(char **names) { return fli_freelist(names); }


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

x86 assembly (clang, -O2):
<FLIFreeList>:
jmp    1030 <fli_freelist@plt>

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

LLVM IR (-O2):
define i64 @FLIFreeList(i8** %0) {
%2 = tail call i64 @fli_freelist(i8** %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strlen(char *);
void cmdline_parser_print_version(void) {
  printf("%s %s\n", (strlen("configurator") ? "configurator" : "configurator"),
         "4.02");
}


x86 assembly (clang, -O0):
<cmdline_parser_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xedc(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed0(%rip),%rsi
cmp    $0x0,%rax
cmovne %rsi,%rsi
lea    0xeba(%rip),%rdi
lea    0xec7(%rip),%rdx
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_parser_print_version>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xeef(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [13 x i8] c"configurator\00"
@.str.2 = [5 x i8] c"4.02\00"
define void @cmdline_parser_print_version() {
%1 = call i64 @strlen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [13 x i8] c"configurator\00"
@.str.2 = [5 x i8] c"4.02\00"
define void @cmdline_parser_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
double Modulus(double arg1, double arg2) {
  int i;
  double ret_val;
  ret_val = arg1;
  i = ret_val / arg2;
  ret_val -= i * arg2;
  if (ret_val < 0.0)
    ret_val += arg2;
  return ret_val;
}


x86 assembly (clang, -O0):
<Modulus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1179 <Modulus+0x79>
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Modulus>:
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
movsd  0xecf(%rip),%xmm2
andnpd %xmm2,%xmm3
orpd   %xmm1,%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @Modulus(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
store double %7, double* %6
%8 = load double, double* %6
%9 = load double, double* %4
%10 = fdiv double %8, %9
%11 = fptosi double %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = load double, double* %4
%15 = load double, double* %6
%16 = fneg double %13
%17 = call double @llvm.fmuladd.f64(double %16, double %14, double %15)
store double %17, double* %6
%18 = load double, double* %6
%19 = fcmp olt double %18, 0.000000e+00
br i1 %19, label %20, label %24
20: ; preds = %2
%21 = load double, double* %4
%22 = load double, double* %6
%23 = fadd double %22, %21
store double %23, double* %6
br label %24
24: ; preds = %20, %2
%25 = load double, double* %6
ret double %25
}

LLVM IR (-O2):
define double @Modulus(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fneg double %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %0)
%8 = fcmp olt double %7, 0.000000e+00
%9 = select i1 %8, double %1, double -0.000000e+00
%10 = fadd double %7, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x41() {
  Assert_real((ispunct(65) == 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_ispunct.c",
              330, ("ispunct should be 0 for A"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x41>:
push   %rax
mov    $0x41,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14a,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for A\00"
define void @t_ispunct_0x41() {
%1 = call i64 @ispunct(i32 65)
%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 330, 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for A\00"
define void @t_ispunct_0x41() {
%1 = tail call i64 @ispunct(i32 65)
%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 330, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int libclut_eq__(double a, double b) { return a == b; }


x86 assembly (clang, -O0):
<libclut_eq__>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libclut_eq__>:
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @libclut_eq__(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @libclut_eq__(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MON_3;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_mon_3() { return nl_langinfo(MON_3); }


x86 assembly (clang, -O0):
<langinfo_mon_3>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_mon_3>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@MON_3 = global i32 0
define i8* @langinfo_mon_3() {
%1 = load i32, i32* @MON_3
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@MON_3 = global i32 0
define i8* @langinfo_mon_3() {
%1 = load i32, i32* @MON_3
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int test_ais_19(void) {
  fprintf(stderr, "test_ais_19() failed: Not Written\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_ais_19>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ais_19>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_19() failed: Not Written\0A\00"
define i32 @test_ais_19() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_19() failed: Not Written\0A\00"
define i32 @test_ais_19() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}