xunge/DecIR huggingface dataset:
float dremf(x, y)
float x, y;
{ return remainderf(x, y); }


x86 assembly (clang, -O0):
<dremf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm1,-0x10(%rbp)
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <remainderf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dremf>:
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
jmp    1030 <remainderf@plt>

LLVM IR (-O0):
define float @dremf(double %0, double %1) {
%3 = alloca float
%4 = alloca float
%5 = fptrunc double %0 to float
%6 = fptrunc double %1 to float
store float %5, float* %3
store float %6, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = call float @remainderf(float %7, float %8)
ret float %9
}

LLVM IR (-O2):
define float @dremf(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = tail call float @remainderf(float %3, float %4)
ret float %5
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
intptr_t rst_pop(struct forth_instance *);
int /*<<< orphan*/ rst_push(struct forth_instance *, intptr_t);
int /*<<< orphan*/ st_push(struct forth_instance *, intptr_t);
void r_to(struct forth_instance *fi) {
  intptr_t tp = rst_pop(fi);
  st_push(fi, rst_pop(fi));
  rst_push(fi, tp);
}


x86 assembly (clang, -O0):
<r_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rst_pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rst_pop@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
call   1050 <st_push@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rst_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_to>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <rst_pop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <rst_pop@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <st_push@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <rst_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @r_to(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
%3 = alloca i64
store %struct.forth_instance* %0, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i64 @rst_pop(%struct.forth_instance* %4)
store i64 %5, i64* %3
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = load %struct.forth_instance*, %struct.forth_instance** %2
%8 = call i64 @rst_pop(%struct.forth_instance* %7)
%9 = call i32 @st_push(%struct.forth_instance* %6, i64 %8)
%10 = load %struct.forth_instance*, %struct.forth_instance** %2
%11 = load i64, i64* %3
%12 = call i32 @rst_push(%struct.forth_instance* %10, i64 %11)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @r_to(%struct.forth_instance* %0) {
%2 = tail call i64 @rst_pop(%struct.forth_instance* %0)
%3 = tail call i64 @rst_pop(%struct.forth_instance* %0)
%4 = tail call i32 @st_push(%struct.forth_instance* %0, i64 %3)
%5 = tail call i32 @rst_push(%struct.forth_instance* %0, i64 %2)
ret void
}
void nseel_asm_sqr_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_sqr_end() {
ret void
}
/* Variables and functions */
int sfd_strlen(char const *);
char *sfd_strtok(char *s, const char *d) {
  int i = sfd_strlen(d);
  i += 2;
  return s;
}


x86 assembly (clang, -O0):
<sfd_strtok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sfd_strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_strtok>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <sfd_strlen@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sfd_strtok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @sfd_strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 2
store i32 %9, i32* %5
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @sfd_strtok(i8* readnone returned %0, i8* %1) {
%3 = tail call i32 @sfd_strlen(i8* %1)
ret i8* %0
}
/* Variables and functions */
float sqrt(int);
float dis(int x1, int y1, int x2, int y2) {
  float a;
  a = sqrt((x1 - x2) ^ 2 + (y1 - y2) ^ 2);
  return a;
}


x86 assembly (clang, -O0):
<dis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
add    $0x2,%eax
xor    %eax,%edi
xor    $0x2,%edi
call   1030 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dis>:
sub    %edx,%edi
sub    %ecx,%esi
lea    0x2(%rsi),%eax
xor    %eax,%edi
xor    $0x2,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @dis(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %7
%12 = sub nsw i32 %10, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = add nsw i32 2, %15
%17 = xor i32 %12, %16
%18 = xor i32 %17, 2
%19 = call float @sqrt(i32 %18)
store float %19, float* %9
%20 = load float, float* %9
ret float %20
}

LLVM IR (-O2):
define float @dis(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = add i32 %1, 2
%7 = sub i32 %6, %3
%8 = xor i32 %5, %7
%9 = xor i32 %8, 2
%10 = tail call float @sqrt(i32 %9)
ret float %10
}
unsigned xrop3_97_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = D & S;
  stk3 = T | stk4;
  stk2 = S ^ stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_97_0_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    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_97_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    %ecx,%eax
not    %edi
and    %edi,%eax
xor    $0xffffff00,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_97_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %3, -1
%8 = xor i32 %6, %4
%9 = and i32 %8, %7
%10 = xor i32 %9, -256
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a;
  int b;
  int sum;
  scanf("%d %d", &a, &b);
  sum = a + b;
  printf("The result is %d + %d = %d\n", a, b, sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    (%rdx,%rsi,1),%ecx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [28 x i8] c"The result is %d + %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [28 x i8] c"The result is %d + %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
void ta_print_spaces(int ct) {
  char buf[ct + 1];
  memset(buf, ' ', ct);
  buf[ct] = '\0';
  printf("%s", buf);
}


x86 assembly (clang, -O0):
<ta_print_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x20,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rsi
movslq -0x4(%rbp),%rax
movb   $0x0,(%rsi,%rax,1)
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ta_print_spaces>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %edi,%r14d
lea    0x1(%r14),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
movslq %r14d,%rax
movb   $0x0,(%rax,%rbx,1)
lea    0xea3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @ta_print_spaces(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = load i32, i32* %2
%11 = call i32 @memset(i8* %9, i8 signext 32, i32 %10)
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %9, i64 %13
store i8 0, i8* %14
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%16 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @ta_print_spaces(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @memset(i8* %4, i8 signext 32, i32 %0)
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
int sim_tolower(int c) {
  return ((c >= 'A') && (c <= 'Z')) ? ((c - 'A') + 'a') : c;
}


x86 assembly (clang, -O0):
<sim_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <sim_tolower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <sim_tolower+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <sim_tolower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @sim_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 97
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @sim_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal(char errstr[]) {
  fprintf(stderr, "ERROR::  %s\n", errstr);
  exit(0);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"ERROR:: %s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"ERROR:: %s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char **, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void nothing() {
  char *buf0[50];
  fgets(buf0, 300, stdin);
}


x86 assembly (clang, -O0):
<nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
lea    -0x190(%rbp),%rdi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
mov    $0x12c,%esi
call   1030 <fgets@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nothing>:
sub    $0x198,%rsp
mov    0x2eca(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x12c,%esi
call   1030 <fgets@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @nothing() {
%1 = alloca [50 x i8*]
%2 = getelementptr inbounds [50 x i8*], [50 x i8*]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8** %2, i32 300, i32 %3)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @nothing() {
%1 = alloca [50 x i8*]
%2 = bitcast [50 x i8*]* %1 to i8*
%3 = getelementptr inbounds [50 x i8*], [50 x i8*]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8** %3, i32 300, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void sigterm_handler(int signo) {
  printf("Entering SIGTERM handler ...\n");
  sleep(10);
  printf("Exiting SIGTERM handler ...\n");
}


x86 assembly (clang, -O0):
<sigterm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigterm_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
lea    0xedf(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Entering SIGTERM handler ...\0A\00"
@.str.1 = [29 x i8] c"Exiting SIGTERM handler ...\0A\00"
define void @sigterm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Entering SIGTERM handler ...\00"
@str.2 = [28 x i8] c"Exiting SIGTERM handler ...\00"
define void @sigterm_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showversion(void) {
  printf("\n testbanner version 1.0.0 - test linux banner output\n");
  printf(" copyright (c) 2004 by <THS <tositrino@hanskult.de>\n\n");
}


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

x86 assembly (clang, -O2):
<showversion>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf12(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"\0A testbanner version 1.0.0 - test linux banner output\0A\00"
@.str.1 = [54 x i8] c" copyright (c) 2004 by <THS <tositrino@hanskult.de>\0A\0A\00"
define void @showversion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [54 x i8] c"\0A testbanner version 1.0.0 - test linux banner output\00"
@str.2 = [53 x i8] c" copyright (c) 2004 by <THS <tositrino@hanskult.de>\0A\00"
define void @showversion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x34() {
  Assert_real((isalnum(52)),
              "/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_isalnum.c",
              265, ("isalnum should be 1 for 4"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x34>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x109,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x34>:
push   %rax
mov    $0x34,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x109,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for 4\00"
define void @t_isalnum_0x34() {
%1 = call i32 @isalnum(i32 52)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for 4\00"
define void @t_isalnum_0x34() {
%1 = tail call i32 @isalnum(i32 52)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  int a = 0;
  float f = a + 1;
  return f == a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = sitofp i32 %5 to float
store float %6, float* %3
%7 = load float, float* %3
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to float
%10 = fcmp oeq float %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_usmatrix(ushort **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m[nrl] + ncl - 0));
  free((char *)(m + nrl - 0));
}


x86 assembly (clang, -O0):
<free_usmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_usmatrix>:
push   %rbx
lea    (%rdi,%rsi,8),%rbx
lea    0x0(,%rcx,4),%rax
add    (%rdi,%rsi,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_usmatrix(i32** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 %1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 %3
%9 = bitcast i32* %8 to i8*
%10 = tail call i32 @free(i8* %9)
%11 = bitcast i32** %6 to i8*
%12 = tail call i32 @free(i8* %11)
ret void
}
int jnb_io_read_gz(char *in_filename, char **out_data) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @jnb_io_read_gz(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 -1
}
void ai(void) {}


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

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

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

LLVM IR (-O2):
define void @ai() {
ret void
}
/* Variables and functions */
double estimate(size_t remaining, double rate) {
  if (rate > 0)
    return (double)remaining / rate;
  return 0.;
}


x86 assembly (clang, -O0):
<estimate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1155 <estimate+0x55>
movaps 0xeda(%rip),%xmm1
movq   -0x10(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xed9(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115d <estimate+0x5d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimate>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112f <estimate+0x2f>
movq   %rdi,%xmm2
punpckldq 0xee9(%rip),%xmm2
subpd  0xef1(%rip),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @estimate(i64 %0, double %1) {
%3 = alloca double
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i64, i64* %4
%10 = uitofp i64 %9 to double
%11 = load double, double* %5
%12 = fdiv double %10, %11
store double %12, double* %3
br label %14
13: ; preds = %2
store double 0.000000e+00, double* %3
br label %14
14: ; preds = %13, %8
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @estimate(i64 %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = uitofp i64 %0 to double
%6 = fdiv double %5, %1
br label %7
7: ; preds = %2, %4
%8 = phi double [ %6, %4 ], [ 0.000000e+00, %2 ]
ret double %8
}
/* Type definitions */
struct soap {
  int dummy;
};

/* Variables and functions */
int soap_element_end_in(struct soap *, char *);
int soap_body_end_in(struct soap *soap) {
  return soap_element_end_in(soap, "SOAP-ENV:Body");
}


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

x86 assembly (clang, -O2):
<soap_body_end_in>:
lea    0xee9(%rip),%rsi
jmp    1030 <soap_element_end_in@plt>

LLVM IR (-O0):
%struct.soap = type { i32 }
@.str = [14 x i8] c"SOAP-ENV:Body\00"
define i32 @soap_body_end_in(%struct.soap* %0) {
%2 = alloca %struct.soap*
store %struct.soap* %0, %struct.soap** %2
%3 = load %struct.soap*, %struct.soap** %2
%4 = call i32 @soap_element_end_in(%struct.soap* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
%struct.soap = type { i32 }
@.str = [14 x i8] c"SOAP-ENV:Body\00"
define i32 @soap_body_end_in(%struct.soap* %0) {
%2 = tail call i32 @soap_element_end_in(%struct.soap* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ unload_filemap();
void htags_unload_filemap(void) { unload_filemap(); }


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

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

LLVM IR (-O0):
define void @htags_unload_filemap() {
%1 = call i32 (...) @unload_filemap()
ret void
}

LLVM IR (-O2):
define void @htags_unload_filemap() {
%1 = tail call i32 (...) @unload_filemap()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *p = (int *)malloc(sizeof(int));
  *p = 42;
  printf("%d\n", *p);
  free(p);
  p = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x2a,(%rax)
lea    0xeb5(%rip),%rdi
mov    $0x2a,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 42, i32* %5
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %2
%10 = call i32 @free(i32* %9)
store i32* null, i32** %2
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 42, i32* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 42)
%4 = tail call i32 @free(i32* %2)
ret i32 0
}
unsigned int get_module_rev(void) { return 123109; }


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

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

LLVM IR (-O0):
define i32 @get_module_rev() {
ret i32 123109
}

LLVM IR (-O2):
define i32 @get_module_rev() {
ret i32 123109
}
void gdk_spawn_on_screen() {}


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

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

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

LLVM IR (-O2):
define void @gdk_spawn_on_screen() {
ret void
}
/* Variables and functions */
char *stripnslashes(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *stripslashes(char *str) { return stripnslashes(str, strlen(str)); }


x86 assembly (clang, -O0):
<stripslashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <stripnslashes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripslashes>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <stripnslashes@plt>

LLVM IR (-O0):
define i8* @stripslashes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @stripnslashes(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @stripslashes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @stripnslashes(i8* %0, i32 %2)
ret i8* %3
}
int argdevider(char c) {
  switch (c) {
  case '\0':
  case ',':
    return 1;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<argdevider>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     112f <argdevider+0x2f>
jmp    111e <argdevider+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x2c,%eax
jne    113b <argdevider+0x3b>
jmp    112f <argdevider+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1147 <argdevider+0x47>
jmp    1140 <argdevider+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argdevider>:
test   %dil,%dil
sete   %al
cmp    $0x2c,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @argdevider(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 0, label %6
i32 44, label %6
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %9
7: ; preds = %1
br label %8
8: ; preds = %7
store i32 0, i32* %2
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @argdevider(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = icmp eq i8 %0, 44
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int opponent_feature(int l, int d) {
  const int o[] = {1, 0, 2};
  int f = o[l % 3];
  if (d > 1)
    f += opponent_feature(l / 3, d - 1) * 3;
  return f;
}


x86 assembly (clang, -O0):
<opponent_feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x14(%rbp,%rax,4),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1172 <opponent_feature+0x62>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1030 <opponent_feature@plt>
imul   $0x3,%eax,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opponent_feature>:
push   %rbx
movslq %edi,%rax
imul   $0x55555556,%rax,%rdi
mov    %rdi,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdi
add    %ecx,%edi
lea    (%rdi,%rdi,2),%ecx
sub    %ecx,%eax
cltq
lea    0xeca(%rip),%rcx
mov    (%rcx,%rax,4),%ebx
cmp    $0x1,%esi
jle    114b <opponent_feature+0x3b>
add    $0xffffffff,%esi
call   1030 <opponent_feature@plt>
lea    (%rax,%rax,2),%eax
add    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.opponent_feature.o = [3 x i32] [i32 1, i32 0, i32 2]
define i32 @opponent_feature(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x i32]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = bitcast [3 x i32]* %5 to i8*
%8 = load i32, i32* %3
%9 = srem i32 %8, 3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %24
15: ; preds = %2
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 3
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = call i32 @opponent_feature(i32 %17, i32 %19)
%21 = mul nsw i32 %20, 3
%22 = load i32, i32* %6
%23 = add nsw i32 %22, %21
store i32 %23, i32* %6
br label %24
24: ; preds = %15, %2
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
@__const.opponent_feature.o = [3 x i32] [i32 1, i32 0, i32 2]
define i32 @opponent_feature(i32 %0, i32 %1) {
%3 = srem i32 %0, 3
%4 = sdiv i32 %0, 3
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @__const.opponent_feature.o, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = icmp sgt i32 %1, 1
br i1 %8, label %11, label %9
9: ; preds = %2, %11
%10 = phi i32 [ %15, %11 ], [ %7, %2 ]
ret i32 %10
11: ; preds = %2
%12 = add nsw i32 %1, -1
%13 = tail call i32 @opponent_feature(i32 %4, i32 %12)
%14 = mul nsw i32 %13, 3
%15 = add nsw i32 %14, %7
br label %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("toto"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [5 x i8] c"toto\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"toto\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int ld_eq_rc2(long double a1) { return !(((a1) == (100))); }


x86 assembly (clang, -O0):
<ld_eq_rc2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_eq_rc2>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ld_eq_rc2(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp oeq x86_fp80 %3, 0xK4005C800000000000000
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ld_eq_rc2(x86_fp80 %0) {
%2 = fcmp une x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
void tegra_tsc_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra_tsc_resume() {
ret void
}
/* Variables and functions */
scalar_t__ ascii_strcmp_icase(char const *, char const *);
__attribute__((__nonnull__)) bool ascii_streq_icase(const char *s1,
                                                    const char *s2) {
  return ascii_strcmp_icase(s1, s2) == 0;
}


x86 assembly (clang, -O0):
<ascii_streq_icase>:
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 <ascii_strcmp_icase@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_streq_icase>:
push   %rax
call   1030 <ascii_strcmp_icase@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ascii_streq_icase(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 i64 @ascii_strcmp_icase(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ascii_streq_icase(i8* %0, i8* %1) {
%3 = tail call i64 @ascii_strcmp_icase(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
double pent(double v) {
  return (quad(v)) * v;
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<pent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <quad@plt>
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pent>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x1,%al
call   1030 <quad@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pent(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (double, ...) bitcast (i32 (...)* @quad to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @pent(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @quad to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ randomByte();
int /*<<< orphan*/ sqlite3UnixEnterMutex();
int /*<<< orphan*/ sqlite3UnixLeaveMutex();
void sqlite3Randomness(int N, void *pBuf) {
  unsigned char *zBuf = pBuf;
  sqlite3UnixEnterMutex();
  while (N--) {
    *(zBuf++) = randomByte();
  }
  sqlite3UnixLeaveMutex();
}


x86 assembly (clang, -O0):
<sqlite3Randomness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <sqlite3UnixEnterMutex@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1181 <sqlite3Randomness+0x51>
mov    $0x0,%al
call   1050 <randomByte@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    114e <sqlite3Randomness+0x1e>
mov    $0x0,%al
call   1030 <sqlite3UnixLeaveMutex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3Randomness>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <sqlite3UnixEnterMutex@plt>
test   %ebp,%ebp
je     1163 <sqlite3Randomness+0x33>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <randomByte@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1150 <sqlite3Randomness+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sqlite3UnixLeaveMutex@plt>

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

LLVM IR (-O2):
define void @sqlite3Randomness(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 (...) @sqlite3UnixEnterMutex()
%4 = icmp eq i32 %0, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %11, %5 ], [ %1, %2 ]
%7 = phi i32 [ %8, %5 ], [ %0, %2 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 (...) @randomByte()
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %10, i8* %6
%12 = icmp eq i32 %8, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = tail call i32 (...) @sqlite3UnixLeaveMutex()
ret void
}
/* Variables and functions */
unsigned short ___swab16(unsigned short);
unsigned short __arch__swab16(unsigned short x) { return ___swab16(x); }


x86 assembly (clang, -O0):
<__arch__swab16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <___swab16@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__arch__swab16>:
jmp    1030 <___swab16@plt>

LLVM IR (-O0):
define zeroext i16 @__arch__swab16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @___swab16(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @__arch__swab16(i16 zeroext %0) {
%2 = tail call zeroext i16 @___swab16(i16 zeroext %0)
ret i16 %2
}
int misdigit(int c) { return c >= '0' && c <= '9'; }


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

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

LLVM IR (-O0):
define i32 @misdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @misdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ getc(int /*<<< orphan*/ *);
uint16_t readBigShort(FILE *file) {
  uint16_t c1 = (uint16_t)getc(file) << 8;
  uint16_t c2 = (uint16_t)getc(file);
  return (uint16_t)(c1 | c2);
}


x86 assembly (clang, -O0):
<readBigShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readBigShort>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <getc@plt>
mov    %rax,%rbx
shl    $0x8,%ebx
mov    %r14,%rdi
call   1030 <getc@plt>
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @readBigShort(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @getc(i32* %5)
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = call i64 @getc(i32* %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = or i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @readBigShort(i32* nocapture %0) {
%2 = tail call i64 @getc(i32* %0)
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 8
%5 = tail call i64 @getc(i32* %0)
%6 = trunc i64 %5 to i32
%7 = or i32 %4, %6
ret i32 %7
}