xunge/DecIR huggingface dataset:
/* Type definitions */
struct rcsfile {
  int dummy;
};

/* Variables and functions */
int expecttok(struct rcsfile *, int);
int opttok(struct rcsfile *rcs, int type) { return expecttok(rcs, type) + 1; }


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

x86 assembly (clang, -O2):
<opttok>:
push   %rax
call   1030 <expecttok@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rcsfile = type { i32 }
define i32 @opttok(%struct.rcsfile* %0, i32 %1) {
%3 = alloca %struct.rcsfile*
%4 = alloca i32
store %struct.rcsfile* %0, %struct.rcsfile** %3
store i32 %1, i32* %4
%5 = load %struct.rcsfile*, %struct.rcsfile** %3
%6 = load i32, i32* %4
%7 = call i32 @expecttok(%struct.rcsfile* %5, i32 %6)
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
%struct.rcsfile = type { i32 }
define i32 @opttok(%struct.rcsfile* %0, i32 %1) {
%3 = tail call i32 @expecttok(%struct.rcsfile* %0, i32 %1)
%4 = add nsw i32 %3, 1
ret i32 %4
}
void copy(char to[], char from[]) {
  int i;
  for (i = 0; from[i] != '\0'; ++i)
    to[i] = from[i];
  to[i] = '\0';
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <copy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    (%rsi),%al
test   %al,%al
je     1127 <copy+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <copy+0x10>
mov    %ecx,%eax
movb   $0x0,(%rdi,%rax,1)
ret
xor    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret void
}
void *ERR_PTR(long error) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @ERR_PTR(i64 %0) {
ret i8* null
}
int go() {
  int i = 1;
  i++;
  i *= 233;
  i--;
  i = i - 1;
  i = i >> 2;
  i = ~i;
  float c = 2.12;
  float z = 2;
  char *s = "233\t";
  char cc = 'B';
  return 0;
}


x86 assembly (clang, -O0):
<go>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
imul   $0xe9,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
movss  0xeba(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xea9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xea5(%rip),%rax
mov    %rax,-0x18(%rbp)
movb   $0x42,-0x19(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"233\09\00"
define i32 @go() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i8*
%5 = alloca i8
store i32 1, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 233
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -1
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = ashr i32 %14, 2
store i32 %15, i32* %1
%16 = load i32, i32* %1
%17 = xor i32 %16, -1
store i32 %17, i32* %1
store float 0x4000F5C280000000, float* %2
store float 2.000000e+00, float* %3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %4
store i8 66, i8* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @go() {
ret i32 0
}
unsigned xrop3_63_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T & S;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_63_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_63_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_63_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = and i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = xor i32 %24, -1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = xor i32 %27, -1
%29 = and i32 %26, %28
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = and i32 %30, %31
%33 = or i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @xrop3_63_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = xor i32 %4, -1
ret i32 %5
}
void put_short_be(short data, unsigned char **bufptr) {
  *(*bufptr)++ = (unsigned char)((data >> 8) & 0xff);
  *(*bufptr)++ = (unsigned char)(data & 0xff);
}


x86 assembly (clang, -O0):
<put_short_be>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
movswl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_short_be>:
mov    %edi,%eax
mov    (%rsi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rsi)
mov    %ah,(%rcx)
mov    (%rsi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rsi)
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define void @put_short_be(i16 signext %0, i8** %1) {
%3 = alloca i16
%4 = alloca i8**
store i16 %0, i16* %3
store i8** %1, i8*** %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
store i8 %9, i8* %11
%13 = load i16, i16* %3
%14 = sext i16 %13 to i32
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8**, i8*** %4
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %17
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @put_short_be(i16 signext %0, i8** nocapture %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %1
store i8 %4, i8* %5
%7 = trunc i16 %0 to i8
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %1
store i8 %7, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, unsigned long long);
int /*<<< orphan*/ trap_me();
int main() {
  double a, b, c, d;
  unsigned long long cc;
  a = 1;
  b = 3;
  c = 0;
  d = a / b;
  c = 1 / c;
  trap_me();
  cc = *(unsigned long long *)&c;
  printf("d: %.6f c: 0x%llx\n", d, cc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe98(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <trap_me@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x30(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <trap_me@plt>
lea    0xed9(%rip),%rdi
movsd  0xec9(%rip),%xmm0
movabs $0x7ff0000000000000,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"d: %.6f c: 0x%llx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i64
store i32 0, i32* %1
store double 1.000000e+00, double* %2
store double 3.000000e+00, double* %3
store double 0.000000e+00, double* %4
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fdiv double %7, %8
store double %9, double* %5
%10 = load double, double* %4
%11 = fdiv double 1.000000e+00, %10
store double %11, double* %4
%12 = call i32 (...) @trap_me()
%13 = bitcast double* %4 to i64*
%14 = load i64, i64* %13
store i64 %14, i64* %6
%15 = load double, double* %5
%16 = load i64, i64* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %15, i64 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"d: %.6f c: 0x%llx\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @trap_me()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 0x3FD5555555555555, i64 9218868437227405312)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, unsigned char *, int);
char *substring(unsigned char *in, int from, int length) {
  char *result = (char *)malloc(length + 1);
  memcpy(result, &in[from], length);
  result[length] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<substring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substring>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @substring(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i32, i32* %6
%18 = call i32 @memcpy(i8* %12, i8* %16, i32 %17)
%19 = load i8*, i8** %7
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 0, i8* %22
%23 = load i8*, i8** %7
ret i8* %23
}

LLVM IR (-O2):
define i8* @substring(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @memcpy(i8* %6, i8* %8, i32 %2)
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8 0, i8* %11
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdout;
int vfwscanf(int /*<<< orphan*/, int /*<<< orphan*/ const *,
             int /*<<< orphan*/);
int vwscanf(const wchar_t *restrict format, va_list args) {
  return vfwscanf(stdout, format, args);
}


x86 assembly (clang, -O0):
<vwscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfwscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vwscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfwscanf@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @vwscanf(i32* noalias %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @vfwscanf(i32 %5, i32* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @vwscanf(i32* noalias %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfwscanf(i32 %3, i32* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usage();
void cli_help(int argc, char **argv) { usage(); }


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

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

LLVM IR (-O0):
define void @cli_help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @usage()
ret void
}

LLVM IR (-O2):
define void @cli_help(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @usage()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fen_board(char *);
int /*<<< orphan*/ play(int, int /*<<< orphan*/);
void test(void) {
  char *fen = "8/8/2p5/8/8/4k3/2p1q3/7K w - - 0 2";
  fen_board(fen);
  play(4, 0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fen_board@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <play@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <fen_board@plt>
mov    $0x4,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <play@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"8/8/2p5/8/8/4k3/2p1q3/7K w - - 0 2\00"
define void @test() {
%1 = alloca i8*
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @fen_board(i8* %2)
%4 = call i32 @play(i32 4, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"8/8/2p5/8/8/4k3/2p1q3/7K w - - 0 2\00"
define void @test() {
%1 = tail call i32 @fen_board(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @play(i32 4, i32 0)
ret void
}
extern int _read(int file, char *ptr, int len) { return 0; }


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

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

LLVM IR (-O0):
define i32 @_read(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
ret i32 0
}

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fmod(double, double);
int /*<<< orphan*/ fmodf(float, float);
int /*<<< orphan*/ fmodl(long double, long double);
void uninitvar_fmod(void) {
  float f1, f2;
  (void)fmodf(f1, f2);
  double d1, d2;
  (void)fmod(d1, d2);
  long double ld1, ld2;
  (void)fmodl(ld1, ld2);
}


x86 assembly (clang, -O0):
<uninitvar_fmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1050 <fmodf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <fmod@plt>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmodl@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fmod>:
sub    $0x28,%rsp
call   1050 <fmodf@plt>
call   1040 <fmod@plt>
call   1030 <fmodl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_fmod() {
%1 = alloca float
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = load float, float* %1
%8 = load float, float* %2
%9 = call i32 @fmodf(float %7, float %8)
%10 = load double, double* %3
%11 = load double, double* %4
%12 = call i32 @fmod(double %10, double %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load x86_fp80, x86_fp80* %6
%15 = call i32 @fmodl(x86_fp80 %13, x86_fp80 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fmod() {
%1 = tail call i32 @fmodf(float undef, float undef)
%2 = tail call i32 @fmod(double undef, double undef)
%3 = tail call i32 @fmodl(x86_fp80 undef, x86_fp80 undef)
ret void
}
float absol(float in) {
  float new = in;
  if (in < 0) {
    new = 0 - in;
  }
  return new;
}


x86 assembly (clang, -O0):
<absol>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <absol+0x2d>
xorps  %xmm0,%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absol>:
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
cmpltss %xmm2,%xmm1
subss  %xmm0,%xmm2
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @absol(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
store float %4, float* %3
%5 = load float, float* %2
%6 = fcmp olt float %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %2
%9 = fsub float 0.000000e+00, %8
store float %9, float* %3
br label %10
10: ; preds = %7, %1
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @absol(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fsub float 0.000000e+00, %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, unsigned char const *, int const);
void put_rdata(const int rdlen, const unsigned char *rdata, char **ptr) {
  memcpy(*ptr, rdata, rdlen);
  *ptr += rdlen;
}


x86 assembly (clang, -O0):
<put_rdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_rdata>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
mov    (%rdx),%rdi
mov    %ebp,%edx
call   1030 <memcpy@plt>
movslq %ebp,%rax
add    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @put_rdata(i32 %0, i8* %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i32 %0)
%6 = load i8*, i8** %2
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %2
ret void
}
void next_MRIState(_loc, _Base_MRIState, _loc_0, _Base_MRIState_0) int *_loc,
    *_Base_MRIState, _loc_0, _Base_MRIState_0;
{ MRIState_NEXT_FNC_OBJ(_loc, _Base_MRIState, _loc_0, _Base_MRIState_0); }


x86 assembly (clang, -O0):
<next_MRIState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x0,%al
call   1030 <MRIState_NEXT_FNC_OBJ@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @next_MRIState(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @MRIState_NEXT_FNC_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %9, i32* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @next_MRIState(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @MRIState_NEXT_FNC_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %0, i32* %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x1c() {
  Assert_real((isodigit(28) == 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_isodigit.c",
              145, ("isodigit should be 0 for 0x1c"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x1c>:
push   %rax
mov    $0x1c,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x91,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x1c\00"
define void @t_isodigit_0x1c() {
%1 = call i64 @isodigit(i32 28)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x1c\00"
define void @t_isodigit_0x1c() {
%1 = tail call i64 @isodigit(i32 28)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_usage(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void help_and_exit() {
  print_usage(stdout);
  printf("\nOptions:\n"
         "  -s, --symbolic-only       Only delete symbolic links.\n"
         "  -l, --hard-only           Only delete hard links.\n"
         "  -i, --interactive         Prompt before every removal.\n"
         "  -f, --force               Ignore errors or missing files.\n"
         "  -r, --recrusive           Recursively enter directories and delete "
         "any links inside.\n"
         "  -v, --verbose             Print the name of every file being "
         "removed.\n"
         "  -h, --help                Print this help message.\n"
         "  -V, --version             Print the version and exit.\n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help_and_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <print_usage@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help_and_exit>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1050 <print_usage@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [505 x i8] c"\0AOptions:\0A -s, --symbolic-only Only delete symbolic links.\0A -l, --hard-only Only delete hard links.\0A -i, --interactive Prompt before every removal.\0A -f, --force Ignore errors or missing files.\0A -r, --recrusive Recursively enter directories and delete any links inside.\0A -v, --verbose Print the name of every file being removed.\0A -h, --help Print this help message.\0A -V, --version Print the version and exit.\0A\0A\00"
define void @help_and_exit() {
%1 = load i32, i32* @stdout
%2 = call i32 @print_usage(i32 %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([505 x i8], [505 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [504 x i8] c"\0AOptions:\0A -s, --symbolic-only Only delete symbolic links.\0A -l, --hard-only Only delete hard links.\0A -i, --interactive Prompt before every removal.\0A -f, --force Ignore errors or missing files.\0A -r, --recrusive Recursively enter directories and delete any links inside.\0A -v, --verbose Print the name of every file being removed.\0A -h, --help Print this help message.\0A -V, --version Print the version and exit.\0A\00"
define void @help_and_exit() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @print_usage(i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([504 x i8], [504 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
void gtk_icon_set_get_sizes() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_set_get_sizes() {
ret void
}
__attribute__((weak)) void junk() {}


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

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

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

LLVM IR (-O2):
define weak void @junk() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(unsigned long);
int /*<<< orphan*/ printf(char *);
unsigned long xmalloc(unsigned long size) {
  unsigned long p = (unsigned long)malloc(size);
  if (p == 0) {
    printf("Not enough memory");
    exit(-1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <xmalloc+0x3a>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"Not enough memory\00"
define i64 @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *filename) {
  printf("Usage:\n\n"
         "%s <filename>\n",
         filename);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage:\0A\0A%s <filename>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage:\0A\0A%s <filename>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_F7uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xF7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F7uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 247
%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_F7uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1060856922112
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void testClosureLLSBrV(void (*closure)(long long, short, char), long long a1,
                       short a2, char a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureLLSBrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dx,%cx
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cx,-0x12(%rbp)
mov    %al,-0x13(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x12(%rbp),%cx
movswl %cx,%esi
movsbl -0x13(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLSBrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
jmp    *%rax

LLVM IR (-O0):
define void @testClosureLLSBrV(void (i64, i16, i8)* %0, i64 %1, i16 signext %2, i8 signext %3) {
%5 = alloca void (i64, i16, i8)*
%6 = alloca i64
%7 = alloca i16
%8 = alloca i8
store void (i64, i16, i8)* %0, void (i64, i16, i8)** %5
store i64 %1, i64* %6
store i16 %2, i16* %7
store i8 %3, i8* %8
%9 = load void (i64, i16, i8)*, void (i64, i16, i8)** %5
%10 = load i64, i64* %6
%11 = load i16, i16* %7
%12 = load i8, i8* %8
ret void
}

LLVM IR (-O2):
define void @testClosureLLSBrV(void (i64, i16, i8)* nocapture %0, i64 %1, i16 signext %2, i8 signext %3) {
tail call void %0(i64 %1, i16 signext %2, i8 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ system(char *);
int main(void) {
  char buffer[4096];
  sprintf(buffer, "grep \"select \"| sql.e");
  system(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1010(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x1010(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x1008,%rsp
movups 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x652e6c7173207c,%rax
mov    %rax,0xe(%rsp)
mov    %rsp,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x1008,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"grep \22select \22| sql.e\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4096 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"grep \22select \22| sql.e\00"
define i32 @main() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = call i32 @system(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtss_si32(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_load_ss(float const *);
__attribute__((always_)) int32_t Blrintf(const float x) {
  __m128 xx = _mm_load_ss(&x);
  return _mm_cvtss_si32(xx);
}


x86 assembly (clang, -O0):
<Blrintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <_mm_load_ss@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_mm_cvtss_si32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Blrintf>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <_mm_load_ss@plt>
mov    %eax,%edi
call   1030 <_mm_cvtss_si32@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Blrintf(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = call i32 @_mm_load_ss(float* %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @_mm_cvtss_si32(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @Blrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 @_mm_load_ss(float* %2)
%4 = call i32 @_mm_cvtss_si32(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int spi_write(int, int *, int);
int do_write_status_reg(int fd, uint8_t val) {
  uint8_t buf[2] = {0x01, val};
  return spi_write(fd, buf, 2);
}


x86 assembly (clang, -O0):
<do_write_status_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <spi_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_write_status_reg>:
push   %rax
movl   $0x1,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edx
call   1030 <spi_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @do_write_status_reg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 1, i32* %6
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%11 = call i32 @spi_write(i32 %9, i32* %10, i32 2)
ret i32 %11
}

LLVM IR (-O2):
define i32 @do_write_status_reg(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 1, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %6
%7 = call i32 @spi_write(i32 %0, i32* %5, i32 2)
ret i32 %7
}
void foo569(int p) {}


x86 assembly (clang, -O0):
<foo569>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo569(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_dec_a(void) { op_write1(0x3d); }


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

x86 assembly (clang, -O2):
<op_enc_dec_a>:
mov    $0x3d,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_dec_a() {
%1 = call i32 @op_write1(i32 61)
ret void
}

LLVM IR (-O2):
define void @op_enc_dec_a() {
%1 = tail call i32 @op_write1(i32 61)
ret void
}
char *strchr(const char *str, int c) {
  for (; *str; str++)
    if (*str == c)
      return (char *)++str;
  return (char *)0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113d <strchr+0x3d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    115b <strchr+0x5b>
jmp    1142 <strchr+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <strchr+0x22>
mov    %rdi,%rax
add    $0x1,%rax
nopl   (%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1124 <strchr+0x24>
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %12, %11 ], [ %3, %2 ]
%7 = phi i8* [ %10, %11 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
%10 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %9, label %14, label %11
11: ; preds = %5
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %11, %5, %2
%15 = phi i8* [ null, %2 ], [ null, %11 ], [ %10, %5 ]
ret i8* %15
}
/* Variables and functions */
double M_PI;
double rtod(double r) { return r * (180.0 / M_PI); }


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

x86 assembly (clang, -O2):
<rtod>:
mov    0x2ee1(%rip),%rax
movsd  0xef1(%rip),%xmm1
divsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @rtod(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fdiv double 1.800000e+02, %4
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @rtod(double %0) {
%2 = load double, double* @M_PI
%3 = fdiv double 1.800000e+02, %2
%4 = fmul double %3, %0
ret double %4
}
void imap_unexpected(struct imapmsg *msg, struct server *sptr,
                     struct folder *fptr) {}


x86 assembly (clang, -O0):
<imap_unexpected>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.imapmsg = type opaque
%struct.server = type opaque
%struct.folder = type opaque
define void @imap_unexpected(%struct.imapmsg* %0, %struct.server* %1, %struct.folder* %2) {
%4 = alloca %struct.imapmsg*
%5 = alloca %struct.server*
%6 = alloca %struct.folder*
store %struct.imapmsg* %0, %struct.imapmsg** %4
store %struct.server* %1, %struct.server** %5
store %struct.folder* %2, %struct.folder** %6
ret void
}

LLVM IR (-O2):
%struct.imapmsg = type opaque
%struct.server = type opaque
%struct.folder = type opaque
define void @imap_unexpected(%struct.imapmsg* nocapture %0, %struct.server* nocapture %1, %struct.folder* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void semver_private_print(const char *str, size_t len) {
  size_t i;
  for (i = 0; i < len; ++i) {
    printf("%c", str[i]);
  }
}


x86 assembly (clang, -O0):
<semver_private_print>:
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    115f <semver_private_print+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
lea    0xebb(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <semver_private_print+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semver_private_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1146 <semver_private_print+0x36>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <semver_private_print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @semver_private_print(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 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %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):
@.str = [3 x i8] c"%c\00"
define void @semver_private_print(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 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %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
}
/* Variables and functions */
char toupper(unsigned char);
char nat_toupper(const char a) { return toupper((unsigned char)a); }


x86 assembly (clang, -O0):
<nat_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nat_toupper>:
movzbl %dil,%edi
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define signext i8 @nat_toupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @toupper(i8 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @nat_toupper(i8 signext %0) {
%2 = tail call signext i8 @toupper(i8 zeroext %0)
ret i8 %2
}