xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  double member_0;
  double member_1;
  double member_2;
  double member_3;
};
typedef TYPE_1__ __v4sf;

/* Variables and functions */
__v4sf setupb() {
  __v4sf t = {5.0, 6.0, 7.0, 8.0};
  return t;
}


x86 assembly (clang, -O0):
<setupb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,%rax
mov    0xef2(%rip),%rcx
mov    %rcx,(%rdi)
mov    0xef0(%rip),%rcx
mov    %rcx,0x8(%rdi)
mov    0xeed(%rip),%rcx
mov    %rcx,0x10(%rdi)
mov    0xeea(%rip),%rcx
mov    %rcx,0x18(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupb>:
mov    %rdi,%rax
movups 0xf06(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeeb(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { double, double, double, double }
@__const.setupb.t = %struct.TYPE_3__ { double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00 }
define void @setupb(%struct.TYPE_3__* noalias sret(%struct.TYPE_3__) align 8 %0) {
%2 = bitcast %struct.TYPE_3__* %0 to i8*
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { double, double, double, double }
@__const.setupb.t = %struct.TYPE_3__ { double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00 }
define void @setupb(%struct.TYPE_3__* noalias nocapture writeonly sret(%struct.TYPE_3__) align 8 %0) {
%2 = bitcast %struct.TYPE_3__* %0 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 dereferenceable(32) %2, i8* align 8 dereferenceable(32) bitcast (%struct.TYPE_3__* @__const.setupb.t to i8*), i64 32, i1 false)
ret void
}
/* Variables and functions */
int strlen(char const *);
int is_token_label(const char *token) {
  if (strlen(token) < 2)
    return 0;
  return token[0] == ':';
}


x86 assembly (clang, -O0):
<is_token_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jge    113a <is_token_label+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    114f <is_token_label+0x3f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_token_label>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
jl     112a <is_token_label+0x1a>
xor    %eax,%eax
cmpb   $0x3a,(%rbx)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_token_label(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %15
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 58
%14 = zext i1 %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %8, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_token_label(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 58
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int strcmp(char const *, char const *);
int string_comp_func(void *data1, void *data2) {
  return strcmp((const char *)data1, (const char *)data2);
}


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

x86 assembly (clang, -O2):
<string_comp_func>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @string_comp_func(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
unsigned short mus_char_to_ubshort(const unsigned char *inp) {
  unsigned short o;
  unsigned char *outp = (unsigned char *)&o;
  outp[0] = inp[1];
  outp[1] = inp[0];
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_ubshort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_char_to_ubshort>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @mus_char_to_ubshort(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i16* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @mus_char_to_ubshort(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = load i8, i8* %0
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %3 to i16
%8 = or i16 %6, %7
ret i16 %8
}
int base64_length_for_data_length(int n) {
  int numBlocks = (n - ((n + 2) % 3) + 2) / 3;
  return numBlocks * 4;
}


x86 assembly (clang, -O0):
<base64_length_for_data_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
sub    %edx,%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_length_for_data_length>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
shl    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @base64_length_for_data_length(i32 %0) {
%2 = add i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
ret i32 %4
}
int strip_lead(char **str) {
  while (**str == ' ')
    (*str)++;
  return 0;
}


x86 assembly (clang, -O0):
<strip_lead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    112e <strip_lead+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <strip_lead+0x8>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_lead>:
mov    (%rdi),%rax
cmpb   $0x20,(%rax)
jne    111c <strip_lead+0x1c>
add    $0x1,%rax
nopl   0x0(%rax)
mov    %rax,(%rdi)
cmpb   $0x20,(%rax)
lea    0x1(%rax),%rax
je     1110 <strip_lead+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strip_lead(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 32
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i8* [ %7, %5 ], [ %2, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned int f1(unsigned int x, unsigned int y) {
  unsigned int r = x - y;
  if (r > y)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    113a <f1+0x2a>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbx
mov    %edi,%ebx
sub    %esi,%ebx
cmp    %esi,%ebx
jbe    1120 <f1+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
%4 = icmp ugt i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fmtint(char *, unsigned long, int, int /*<<< orphan*/);
int fputs(char *, int /*<<< orphan*/ *);
int fputlx(long unsigned d, FILE *f) {
  char buff[32];
  fmtint(buff, d, 16, 0);
  return fputs(buff, f);
}


x86 assembly (clang, -O0):
<fputlx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
xor    %ecx,%ecx
call   1030 <fmtint@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputlx>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x10,%edx
xor    %ecx,%ecx
call   1030 <fmtint@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @fputlx(i64 %0, i32* nocapture %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @fmtint(i8* %4, i64 %0, i32 16, i32 0)
%6 = call i32 @fputs(i8* %4, i32* %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Tableta asta e a mamei mele");
  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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"Tableta asta e a mamei mele\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Tableta asta e a mamei mele\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ msg(int, char *, int /*<<< orphan*/);
char *strdup(char const *);
int /*<<< orphan*/ strlen(char const *);
char *xstrdup(const char *s) {
  char *result = strdup(s);
  if (!result) {
    msg(-4, "Failed to strdup %zu bytes\n", strlen(s));
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118e <xstrdup+0x4e>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    $0xfffffffc,%edi
lea    0xe85(%rip),%rsi
call   1060 <msg@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strdup@plt>
test   %rax,%rax
je     1150 <xstrdup+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea1(%rip),%rsi
mov    $0xfffffffc,%edi
mov    %eax,%edx
call   1060 <msg@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Failed to strdup %zu bytes\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @msg(i32 -4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [28 x i8] c"Failed to strdup %zu bytes\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xstrdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32 @msg(i32 -4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
main() {
  int myprintf(char *, ...);
  myprintf("%d %d %d", 2, 2, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%edx
mov    $0x5,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <myprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1030 <myprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 5)
ret i32 0
}
/* Variables and functions */
int premul_nozero(int /*<<< orphan*/, unsigned char);
int /*<<< orphan*/ qConvertRgb16To32(unsigned short);
unsigned short qConvertRgb32To16(int);
void argb32p_rgb16(unsigned short *dest, unsigned int src) {
  unsigned char alpha = src >> 24;
  alpha = 0xff - alpha;
  *dest = qConvertRgb32To16(
      (premul_nozero(qConvertRgb16To32(*dest), alpha) & 0xFFFFFF) + src);
}


x86 assembly (clang, -O0):
<argb32p_rgb16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%ecx
mov    $0xff,%eax
sub    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edi
call   1030 <qConvertRgb16To32@plt>
mov    %eax,%edi
movzbl -0xd(%rbp),%esi
call   1050 <premul_nozero@plt>
mov    %eax,%edi
and    $0xffffff,%edi
add    -0xc(%rbp),%edi
call   1040 <qConvertRgb32To16@plt>
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argb32p_rgb16>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%ebp
not    %ebp
shr    $0x18,%ebp
movzwl (%rdi),%edi
call   1030 <qConvertRgb16To32@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1050 <premul_nozero@plt>
and    $0xffffff,%eax
add    %eax,%ebx
mov    %ebx,%edi
call   1040 <qConvertRgb32To16@plt>
mov    %ax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @argb32p_rgb16(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
%5 = alloca i8
store i16* %0, i16** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = lshr i32 %6, 24
%8 = trunc i32 %7 to i8
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = sub nsw i32 255, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %5
%13 = load i16*, i16** %3
%14 = load i16, i16* %13
%15 = call i32 @qConvertRgb16To32(i16 zeroext %14)
%16 = load i8, i8* %5
%17 = call i32 @premul_nozero(i32 %15, i8 zeroext %16)
%18 = and i32 %17, 16777215
%19 = load i32, i32* %4
%20 = add i32 %18, %19
%21 = call zeroext i16 @qConvertRgb32To16(i32 %20)
%22 = load i16*, i16** %3
store i16 %21, i16* %22
ret void
}

LLVM IR (-O2):
define void @argb32p_rgb16(i16* nocapture %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = lshr i32 %3, 24
%5 = trunc i32 %4 to i8
%6 = load i16, i16* %0
%7 = tail call i32 @qConvertRgb16To32(i16 zeroext %6)
%8 = tail call i32 @premul_nozero(i32 %7, i8 zeroext %5)
%9 = and i32 %8, 16777215
%10 = add i32 %9, %1
%11 = tail call zeroext i16 @qConvertRgb32To16(i32 %10)
store i16 %11, i16* %0
ret void
}
char new_char(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @new_char() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @new_char() {
ret i8 0
}
void RTTarList(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarList() {
ret void
}
double _Complex mul_double_rr(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<mul_double_rr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_double_rr>:
mulsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ret

LLVM IR (-O0):
define { double, double } @mul_double_rr(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fmul double %6, %7
%9 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%10 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %8, double* %9
store double 0.000000e+00, double* %10
%11 = load { double, double }, { double, double }* %3
ret { double, double } %11
}

LLVM IR (-O2):
define { double, double } @mul_double_rr(double %0, double %1) {
%3 = fmul double %0, %1
%4 = insertvalue { double, double } poison, double %3, 0
%5 = insertvalue { double, double } %4, double 0.000000e+00, 1
ret { double, double } %5
}
/* Variables and functions */
char *getenv(char const *);
char *strdup(char *);
int getenv_str(const char *v, const char **y) {
  char *x = getenv(v);
  if (!x)
    return 0;
  *y = strdup(x);
  return 1;
}


x86 assembly (clang, -O0):
<getenv_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <getenv_str+0x34>
movl   $0x0,-0x4(%rbp)
jmp    116e <getenv_str+0x4e>
mov    -0x20(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_str>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1140 <getenv_str+0x20>
mov    %rax,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getenv_str(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
%7 = load i8*, i8** %4
%8 = call i8* @getenv(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 0, i32* %3
br label %16
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = call i8* @strdup(i8* %13)
%15 = load i8**, i8*** %5
store i8* %14, i8** %15
store i32 1, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @getenv_str(i8* nocapture %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @strdup(i8* %3)
store i8* %6, i8** %1
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int clearScreen() {
  system("@cls||clear");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"@cls||clear\00"
define i32 @clearScreen() {
%1 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"@cls||clear\00"
define i32 @clearScreen() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_type(void *_p, int _v) {
  ((XButtonReleasedEvent *)_p)->type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XButtonReleasedEvent_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XButtonReleasedEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonReleasedEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %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 i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA1_DriverIRQHandler();
__attribute__((weak)) void DMA1_IRQHandler(void) { DMA1_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DMA1_IRQHandler() {
%1 = call i32 (...) @DMA1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_IRQHandler() {
%1 = tail call i32 (...) @DMA1_DriverIRQHandler()
ret void
}
/* Variables and functions */
int lls_qr_determined(double *, double *, int, int, double *);
int lls_qr_undetermined(double *, double *, int, int, double *);
int lls_qr(double *Ai, double *bi, int M, int N, double *xo) {
  int ret;
  if (M >= N) {
    ret = lls_qr_determined(Ai, bi, M, N, xo);
  } else {
    ret = lls_qr_undetermined(Ai, bi, M, N, xo);
  }
  return ret;
}


x86 assembly (clang, -O0):
<lls_qr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     1165 <lls_qr+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <lls_qr_determined@plt>
mov    %eax,-0x24(%rbp)
jmp    117f <lls_qr+0x5f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1040 <lls_qr_undetermined@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lls_qr>:
cmp    %ecx,%edx
jge    1129 <lls_qr+0x9>
jmp    1040 <lls_qr_undetermined@plt>
jmp    1030 <lls_qr_determined@plt>

LLVM IR (-O0):
define i32 @lls_qr(double* %0, double* %1, i32 %2, i32 %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double* %4, double** %10
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %22
15: ; preds = %5
%16 = load double*, double** %6
%17 = load double*, double** %7
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = load double*, double** %10
%21 = call i32 @lls_qr_determined(double* %16, double* %17, i32 %18, i32 %19, double* %20)
store i32 %21, i32* %11
br label %29
22: ; preds = %5
%23 = load double*, double** %6
%24 = load double*, double** %7
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = load double*, double** %10
%28 = call i32 @lls_qr_undetermined(double* %23, double* %24, i32 %25, i32 %26, double* %27)
store i32 %28, i32* %11
br label %29
29: ; preds = %22, %15
%30 = load i32, i32* %11
ret i32 %30
}

LLVM IR (-O2):
define i32 @lls_qr(double* %0, double* %1, i32 %2, i32 %3, double* %4) {
%6 = icmp slt i32 %2, %3
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @lls_qr_determined(double* %0, double* %1, i32 %2, i32 %3, double* %4)
br label %11
9: ; preds = %5
%10 = tail call i32 @lls_qr_undetermined(double* %0, double* %1, i32 %2, i32 %3, double* %4)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_hour;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int getCurrentHour() {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  return timeinfo->tm_hour;
}


x86 assembly (clang, -O0):
<getCurrentHour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentHour>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @getCurrentHour() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @getCurrentHour() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
void use2(int *ptr, int val) { *ptr = val; }


x86 assembly (clang, -O0):
<use2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<use2>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @use2(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** %3
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @use2(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
inc(n) { return (++n); }


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @inc(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int checkUnique(int num) {
  const int lim = 20;
  for (int i = 2; i <= lim; i++) {
    if (num % i == 0) {
      continue;
    } else {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<checkUnique>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jg     114e <checkUnique+0x4e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1134 <checkUnique+0x34>
jmp    1140 <checkUnique+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1155 <checkUnique+0x55>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <checkUnique+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkUnique>:
xor    %eax,%eax
test   $0x1,%dil
jne    113d <checkUnique+0x3d>
mov    $0x4,%ecx
nopl   (%rax)
cmp    $0x16,%ecx
je     1132 <checkUnique+0x32>
lea    -0x1(%rcx),%esi
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1132 <checkUnique+0x32>
mov    %edi,%eax
cltd
idiv   %ecx
add    $0x2,%ecx
test   %edx,%edx
je     1110 <checkUnique+0x10>
add    $0xfffffffd,%ecx
jmp    1135 <checkUnique+0x35>
add    $0xfffffffe,%ecx
xor    %eax,%eax
cmp    $0x14,%ecx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @checkUnique(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %19
4: ; preds = %1, %11
%5 = phi i32 [ %12, %11 ], [ 2, %1 ]
%6 = or i32 %5, 1
%7 = icmp eq i32 %6, 21
br i1 %7, label %15, label %8
8: ; preds = %4
%9 = srem i32 %0, %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = add nuw nsw i32 %5, 2
%13 = srem i32 %0, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %15
15: ; preds = %11, %8, %4
%16 = phi i32 [ %5, %8 ], [ %5, %4 ], [ %6, %11 ]
%17 = icmp ugt i32 %16, 19
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %15, %1
%20 = phi i32 [ 0, %1 ], [ %18, %15 ]
ret i32 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ fibo(int /*<<< orphan*/);
int main(int argc, char **argv) {
  uint32_t limit = atoi(argv[1]);
  fibo(limit);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <fibo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @fibo(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @fibo(i32 %5)
ret i32 0
}
float erff(float x) {
  float gammp(float a, float x);
  return x < 0.0 ? -gammp(0.5, x * x) : gammp(0.5, x * x);
}


x86 assembly (clang, -O0):
<erff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1161 <erff+0x51>
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xebb(%rip),%xmm0
call   1030 <gammp@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    117d <erff+0x6d>
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xe8d(%rip),%xmm0
call   1030 <gammp@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erff>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  0xed9(%rip),%xmm0
call   1030 <gammp@plt>
movaps 0xedd(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
movaps (%rsp),%xmm3
cmpltss %xmm2,%xmm3
movaps %xmm3,%xmm2
andnps %xmm0,%xmm2
andps  %xmm1,%xmm3
orps   %xmm2,%xmm3
movaps %xmm3,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @erff(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = call float @gammp(float 5.000000e-01, float %9)
%11 = fneg float %10
br label %17
12: ; preds = %1
%13 = load float, float* %2
%14 = load float, float* %2
%15 = fmul float %13, %14
%16 = call float @gammp(float 5.000000e-01, float %15)
br label %17
17: ; preds = %12, %6
%18 = phi float [ %11, %6 ], [ %16, %12 ]
ret float %18
}

LLVM IR (-O2):
define float @erff(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fmul float %0, %0
%4 = tail call float @gammp(float 5.000000e-01, float %3)
%5 = fneg float %4
%6 = select i1 %2, float %5, float %4
ret float %6
}
int do_459() { return 459; }


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

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

LLVM IR (-O0):
define i32 @do_459() {
ret i32 459
}

LLVM IR (-O2):
define i32 @do_459() {
ret i32 459
}
void my_task_nowhere(int foo, char *bar) {}


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

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

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

LLVM IR (-O2):
define void @my_task_nowhere(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xfe() {
  Assert_real((isascii(254) == 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_isascii.c",
              1275, ("isascii should be 0 for 0xfe"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xfe>:
push   %rax
mov    $0xfe,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4fb,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xfe\00"
define void @t_isascii_0xfe() {
%1 = call i64 @isascii(i32 254)
%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 1275, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xfe\00"
define void @t_isascii_0xfe() {
%1 = tail call i64 @isascii(i32 254)
%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 1275, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
extern char *iff(int condition, char *iftrue, char *iffalse) {
  if (condition) {
    return iftrue;
  } else {
    return iffalse;
  }
}


x86 assembly (clang, -O0):
<iff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1126 <iff+0x26>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112e <iff+0x2e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iff>:
mov    %rsi,%rax
test   %edi,%edi
cmove  %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @iff(i32 %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* %2, i8* %1
ret i8* %5
}
int ssds_get_item_value_bin(int pcfd, char *full_def, char *reply, int len) {
  return -1;
}


x86 assembly (clang, -O0):
<ssds_get_item_value_bin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ssds_get_item_value_bin(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @ssds_get_item_value_bin(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
extern void outsb(unsigned short port, const void *addr, unsigned long count) {
  __asm__ __volatile__("rep ; outs"
                       "b"
                       : "=S"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
rep outsb %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsb>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsb %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
double *new_double(int);
double *cmaes_NewDouble(int n) { return new_double(n); }


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

x86 assembly (clang, -O2):
<cmaes_NewDouble>:
jmp    1030 <new_double@plt>

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

LLVM IR (-O2):
define double* @cmaes_NewDouble(i32 %0) {
%2 = tail call double* @new_double(i32 %0)
ret double* %2
}
short get2Dim(short x, short y, short fuzBb) {
  short outVal = 0;
  outVal = (fuzBb * x) + y;
  return outVal;
}


x86 assembly (clang, -O0):
<get2Dim>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movw   $0x0,-0x8(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x2(%rbp),%ecx
imul   %ecx,%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x8(%rbp)
movswl -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get2Dim>:
imul   %edx,%edi
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define signext i16 @get2Dim(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = mul i16 %2, %0
%5 = add i16 %4, %1
ret i16 %5
}
/* Variables and functions */
unsigned int sad_mx_n_c(unsigned char const *, int, unsigned char const *, int,
                        int, int);
unsigned int vp8_sad16x8_c(const unsigned char *src_ptr, int src_stride,
                           const unsigned char *ref_ptr, int ref_stride,
                           int max_sad) {
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 8);
}


x86 assembly (clang, -O0):
<vp8_sad16x8_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x10,%r8d
mov    $0x8,%r9d
call   1030 <sad_mx_n_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad16x8_c>:
mov    $0x10,%r8d
mov    $0x8,%r9d
jmp    1030 <sad_mx_n_c@plt>

LLVM IR (-O0):
define i32 @vp8_sad16x8_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = call i32 @sad_mx_n_c(i8* %11, i32 %12, i8* %13, i32 %14, i32 16, i32 8)
ret i32 %15
}

LLVM IR (-O2):
define i32 @vp8_sad16x8_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 16, i32 8)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SetComment(int /*<<< orphan*/ *);
void SetSystemComment() { SetComment(NULL); }


x86 assembly (clang, -O0):
<SetSystemComment>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <SetComment@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetSystemComment>:
xor    %edi,%edi
jmp    1030 <SetComment@plt>

LLVM IR (-O0):
define void @SetSystemComment() {
%1 = call i32 @SetComment(i32* null)
ret void
}

LLVM IR (-O2):
define void @SetSystemComment() {
%1 = tail call i32 @SetComment(i32* null)
ret void
}
void ECAPCaptureLoadingEnable(unsigned int baseAdd) {
  (*((volatile unsigned short *)(baseAdd + (0x28)))) |= (0x0100u);
}


x86 assembly (clang, -O0):
<ECAPCaptureLoadingEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
or     $0x100,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPCaptureLoadingEnable>:
add    $0x28,%edi
orw    $0x100,(%rdi)
ret

LLVM IR (-O0):
define void @ECAPCaptureLoadingEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 40
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
%8 = zext i16 %7 to i32
%9 = or i32 %8, 256
%10 = trunc i32 %9 to i16
store volatile i16 %10, i16* %6
ret void
}

LLVM IR (-O2):
define void @ECAPCaptureLoadingEnable(i32 %0) {
%2 = add i32 %0, 40
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i16*
%5 = load volatile i16, i16* %4
%6 = or i16 %5, 256
store volatile i16 %6, i16* %4
ret void
}