xunge/DecIR huggingface dataset:
int fy1(int y, int N, int fy) {
  double diff = N - 2 * y;
  double f = diff * (diff - 1.0);
  return (int)(f * fy / (y + 1.0) / (N - y));
}


x86 assembly (clang, -O0):
<fy1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xecd(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xea5(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fy1>:
mov    %esi,%ecx
sub    %edi,%ecx
sub    %edi,%ecx
cvtsi2sd %ecx,%xmm0
movsd  0xeee(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
cvtsi2sd %edi,%xmm2
addsd  0xedb(%rip),%xmm2
mulsd  %xmm1,%xmm0
sub    %edi,%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
divsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @fy1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = mul nsw i32 2, %10
%12 = sub nsw i32 %9, %11
%13 = sitofp i32 %12 to double
store double %13, double* %7
%14 = load double, double* %7
%15 = load double, double* %7
%16 = fsub double %15, 1.000000e+00
%17 = fmul double %14, %16
store double %17, double* %8
%18 = load double, double* %8
%19 = load i32, i32* %6
%20 = sitofp i32 %19 to double
%21 = fmul double %18, %20
%22 = load i32, i32* %4
%23 = sitofp i32 %22 to double
%24 = fadd double %23, 1.000000e+00
%25 = fdiv double %21, %24
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = sub nsw i32 %26, %27
%29 = sitofp i32 %28 to double
%30 = fdiv double %25, %29
%31 = fptosi double %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @fy1(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, -2
%5 = add i32 %4, %1
%6 = sitofp i32 %5 to double
%7 = fadd double %6, -1.000000e+00
%8 = fmul double %7, %6
%9 = sitofp i32 %2 to double
%10 = fmul double %8, %9
%11 = sitofp i32 %0 to double
%12 = fadd double %11, 1.000000e+00
%13 = fdiv double %10, %12
%14 = sub nsw i32 %1, %0
%15 = sitofp i32 %14 to double
%16 = fdiv double %13, %15
%17 = fptosi double %16 to i32
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M80_f(char *s) {
  debug("M80_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M80_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M80_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M80_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M80_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M80_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M80_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glColorTableParameterfv_size(int /*<<< orphan*/);
__attribute__((visibility("internal"))) __attribute__((pure)) GLint
__glColorTableParameteriv_size(GLenum e) {
  return __glColorTableParameterfv_size(e);
}


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

x86 assembly (clang, -O2):
<__glColorTableParameteriv_size>:
jmp    1030 <__glColorTableParameterfv_size@plt>

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

LLVM IR (-O2):
define hidden i32 @__glColorTableParameteriv_size(i32 %0) {
%2 = tail call i32 @__glColorTableParameterfv_size(i32 %0)
ret i32 %2
}
char escape(char *c) {
  switch (*c) {
  case 'a':
    return '\a';
  case 'b':
    return '\b';
  case 'f':
    return '\f';
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  case 'v':
    return '\v';
  default:
    return *c;
  }
}


x86 assembly (clang, -O0):
<escape>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x15,%eax
ja     1174 <escape+0x74>
mov    -0x18(%rbp),%rax
lea    0xed4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x7,-0x1(%rbp)
jmp    117d <escape+0x7d>
movb   $0x8,-0x1(%rbp)
jmp    117d <escape+0x7d>
movb   $0xc,-0x1(%rbp)
jmp    117d <escape+0x7d>
movb   $0xa,-0x1(%rbp)
jmp    117d <escape+0x7d>
movb   $0xd,-0x1(%rbp)
jmp    117d <escape+0x7d>
movb   $0x9,-0x1(%rbp)
jmp    117d <escape+0x7d>
movb   $0xb,-0x1(%rbp)
jmp    117d <escape+0x7d>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape>:
movsbl (%rdi),%ecx
lea    -0x61(%rcx),%edx
cmp    $0x15,%edx
ja     1120 <escape+0x20>
mov    $0x7,%al
lea    0xeec(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    $0x8,%al
ret
mov    %ecx,%eax
ret
mov    $0xc,%al
ret
mov    $0xa,%al
ret
mov    $0x9,%al
ret
mov    $0xb,%al
ret
mov    $0xd,%al
ret

LLVM IR (-O0):
define signext i8 @escape(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %14 [
i32 97, label %7
i32 98, label %8
i32 102, label %9
i32 110, label %10
i32 114, label %11
i32 116, label %12
i32 118, label %13
]
7: ; preds = %1
store i8 7, i8* %2
br label %17
8: ; preds = %1
store i8 8, i8* %2
br label %17
9: ; preds = %1
store i8 12, i8* %2
br label %17
10: ; preds = %1
store i8 10, i8* %2
br label %17
11: ; preds = %1
store i8 13, i8* %2
br label %17
12: ; preds = %1
store i8 9, i8* %2
br label %17
13: ; preds = %1
store i8 11, i8* %2
br label %17
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
store i8 %16, i8* %2
br label %17
17: ; preds = %14, %13, %12, %11, %10, %9, %8, %7
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @escape(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %10 [
i32 97, label %11
i32 98, label %4
i32 102, label %5
i32 110, label %6
i32 114, label %7
i32 116, label %8
i32 118, label %9
]
4: ; preds = %1
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5, %4
%12 = phi i8 [ %2, %10 ], [ 11, %9 ], [ 9, %8 ], [ 13, %7 ], [ 10, %6 ], [ 12, %5 ], [ 8, %4 ], [ 7, %1 ]
ret i8 %12
}
int MPI_Error_string(int errcode, char *string, int *len) {
  *string = 0;
  *len = 0;
  return 1;
}


x86 assembly (clang, -O0):
<MPI_Error_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Error_string>:
movb   $0x0,(%rsi)
movl   $0x0,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @MPI_Error_string(i32 %0, i8* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i8 0, i8* %1
store i32 0, i32* %2
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ BNCHz();
int /*<<< orphan*/ BNCIO(int);
int PulseF2(int iduty) {
  char com1, data;
  int stat = 0, ii, jj;
  ii = iduty / 10;
  jj = iduty - (ii * 10);
  BNCIO(46);
  BNCIO(2);
  BNCIO(ii);
  BNCIO(jj);
  BNCHz();
  return (stat);
}


x86 assembly (clang, -O0):
<PulseF2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   $0xa,-0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x2e,%edi
call   1030 <BNCIO@plt>
mov    $0x2,%edi
call   1030 <BNCIO@plt>
mov    -0x10(%rbp),%edi
call   1030 <BNCIO@plt>
mov    -0x14(%rbp),%edi
call   1030 <BNCIO@plt>
mov    $0x0,%al
call   1040 <BNCHz@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PulseF2>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%r14
imul   $0x66666667,%r14,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x22,%rbx
add    %eax,%ebx
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%r14d
mov    $0x2e,%edi
call   1030 <BNCIO@plt>
mov    $0x2,%edi
call   1030 <BNCIO@plt>
mov    %ebx,%edi
call   1030 <BNCIO@plt>
mov    %r14d,%edi
call   1030 <BNCIO@plt>
xor    %eax,%eax
call   1040 <BNCHz@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @PulseF2(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %5
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
store i32 %9, i32* %6
%10 = load i32, i32* %2
%11 = load i32, i32* %6
%12 = mul nsw i32 %11, 10
%13 = sub nsw i32 %10, %12
store i32 %13, i32* %7
%14 = call i32 @BNCIO(i32 46)
%15 = call i32 @BNCIO(i32 2)
%16 = load i32, i32* %6
%17 = call i32 @BNCIO(i32 %16)
%18 = load i32, i32* %7
%19 = call i32 @BNCIO(i32 %18)
%20 = call i32 (...) @BNCHz()
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @PulseF2(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = mul nsw i32 %2, -10
%4 = add i32 %3, %0
%5 = tail call i32 @BNCIO(i32 46)
%6 = tail call i32 @BNCIO(i32 2)
%7 = tail call i32 @BNCIO(i32 %2)
%8 = tail call i32 @BNCIO(i32 %4)
%9 = tail call i32 (...) @BNCHz()
ret i32 0
}
void BIO_write(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_write() {
ret void
}
void nseel_asm_or(void) {
  __asm__("fistpll (%esi)\n"
          "fistpll 8(%esi)\n"
          "movl 8(%esi), %edi\n"
          "movl 12(%esi), %ecx\n"
          "orl %edi, (%esi)\n"
          "orl %ecx, 4(%esi)\n"
          "fildll (%esi)\n");
}


x86 assembly (clang, -O0):
<nseel_asm_or>:
push   %rbp
mov    %rsp,%rbp
fistpll (%esi)
fistpll 0x8(%esi)
mov    0x8(%esi),%edi
mov    0xc(%esi),%ecx
or     %edi,(%esi)
or     %ecx,0x4(%esi)
fildll (%esi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_or>:
fistpll (%esi)
fistpll 0x8(%esi)
mov    0x8(%esi),%edi
mov    0xc(%esi),%ecx
or     %edi,(%esi)
or     %ecx,0x4(%esi)
fildll (%esi)
ret

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

LLVM IR (-O2):
define void @nseel_asm_or() {
tail call void asm sideeffect "fistpll (%esi)\0Afistpll 8(%esi)\0Amovl 8(%esi), %edi\0Amovl 12(%esi), %ecx\0Aorl %edi, (%esi)\0Aorl %ecx, 4(%esi)\0Afildll (%esi)\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
char *__aeabi_memclr8(char *s, unsigned int n) {
  for (unsigned int i = 0; i < n; i++) {
    *(s + i) = 0;
  }
}


x86 assembly (clang, -O0):
<__aeabi_memclr8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1137 <__aeabi_memclr8+0x37>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <__aeabi_memclr8+0x12>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memclr8>:
test   %esi,%esi
je     1122 <__aeabi_memclr8+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define noalias i8* @__aeabi_memclr8(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret i8* undef
}
int test_imm_E4uint8_mem(unsigned char *val) {
  return ((*val) & (0xE4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E4uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xe4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E4uint8_mem>:
testb  $0xe4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E4uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 228
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_E4uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -28
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void help(char **a) {
  printf(""
         "Prints string x times.\nUSAGE: %s [single-quote string] [x times]\n"
         "",
         a[0]);
  exit(0);
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"Prints string x times.\0AUSAGE: %s [single-quote string] [x times]\0A\00"
define void @help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [66 x i8] c"Prints string x times.\0AUSAGE: %s [single-quote string] [x times]\0A\00"
define void @help(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
void *method(void *initdata) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @method(i8* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ func(int *, int);
int main() {
  int shajal[5] = {10, 20, 30, 40, 50};
  func(shajal, 5);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <func@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.shajal = [5 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @func(i32* %4, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.shajal = [5 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @func(i32* %3, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printheader();
int /*<<< orphan*/ system(char *);
void printavailmenu() {
  system("clear");
  printheader();
  printf("\n\t\t################\n"
         "\x1b[36m"
         "\t\t| AVAILABILITY |:\n"
         "\x1b[0m"
         "\t\t################\n\n\n"
         "\x1b[34m"
         "\t\t\t1] Add availability of doctor\n\n"
         "\t\t\t2] Search availability of particular doctor\n\n"
         "\t\t\t3] Edit availablity\n\n"
         "\t\t\t4] Delete availability data\n\n"
         "\t\t\t5] List availability of all doctors\n\n"
         "\t\t\t6] Return to main menu\n"
         "\x1b[0m");
}


x86 assembly (clang, -O0):
<printavailmenu>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <printheader@plt>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printavailmenu>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
call   1050 <printheader@plt>
lea    0xebb(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [284 x i8] c"\0A\09\09################\0A\1B[36m\09\09| AVAILABILITY |:\0A\1B[0m\09\09################\0A\0A\0A\1B[34m\09\09\091] Add availability of doctor\0A\0A\09\09\092] Search availability of particular doctor\0A\0A\09\09\093] Edit availablity\0A\0A\09\09\094] Delete availability data\0A\0A\09\09\095] List availability of all doctors\0A\0A\09\09\096] Return to main menu\0A\1B[0m\00"
define void @printavailmenu() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @printheader()
%3 = call i32 @printf(i8* getelementptr inbounds ([284 x i8], [284 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [284 x i8] c"\0A\09\09################\0A\1B[36m\09\09| AVAILABILITY |:\0A\1B[0m\09\09################\0A\0A\0A\1B[34m\09\09\091] Add availability of doctor\0A\0A\09\09\092] Search availability of particular doctor\0A\0A\09\09\093] Edit availablity\0A\0A\09\09\094] Delete availability data\0A\0A\09\09\095] List availability of all doctors\0A\0A\09\09\096] Return to main menu\0A\1B[0m\00"
define void @printavailmenu() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @printheader()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([284 x i8], [284 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, char const *, char *, size_t);
ssize_t readlinkat(int fd, const char *path, char *buf, size_t bufsize) {
  return syscall(332, fd, path, buf, bufsize);
}


x86 assembly (clang, -O0):
<readlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x14c,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlinkat>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x14c,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @readlinkat(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @syscall(i32 332, i32 %9, i8* %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @readlinkat(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @syscall(i32 332, i32 %0, i8* %1, i8* %2, i64 %3)
ret i32 %5
}
void swapgs(void) { __asm__ volatile("swapgs"); }


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

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

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

LLVM IR (-O2):
define void @swapgs() {
tail call void asm sideeffect "swapgs", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int encodeVariableByte(unsigned char *buffer, unsigned int value) {
  int t = 0;
  do {
    buffer[t++] = (unsigned char)(value & 127);
    value /= 128;
  } while (value != 0);
  buffer[t - 1] |= 128;
  return t;
}


x86 assembly (clang, -O0):
<encodeVariableByte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7f,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
shr    $0x7,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1112 <encodeVariableByte+0x12>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     $0x80,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeVariableByte>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %esi,%ecx
mov    %ecx,%edx
and    $0x7f,%dl
mov    %dl,(%rdi,%rax,1)
add    $0x1,%rax
shr    $0x7,%esi
cmp    $0x7f,%ecx
ja     1110 <encodeVariableByte+0x10>
or     $0x80,%cl
mov    %cl,-0x1(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define i32 @encodeVariableByte(i8* nocapture writeonly %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = phi i32 [ %10, %3 ], [ %1, %2 ]
%6 = trunc i32 %5 to i8
%7 = and i8 %6, 127
%8 = add nuw nsw i64 %4, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %7, i8* %9
%10 = lshr i32 %5, 7
%11 = icmp ult i32 %5, 128
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = trunc i32 %5 to i8
%14 = trunc i64 %8 to i32
%15 = and i64 %4, 4294967295
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = or i8 %13, -128
store i8 %17, i8* %16
ret i32 %14
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
char *lower(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++)
    s[i] = tolower(s[i]);
  return s;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <lower+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <lower+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <lower+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <lower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @lower(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
typedef int __u16;

/* Variables and functions */
int is_cfa_dev(__u16 *id) {
  return id[0] == 0x848a || id[0] == 0x844a || (id[83] & 0xc004) == 0x4004;
}


x86 assembly (clang, -O0):
<is_cfa_dev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmpl   $0x848a,(%rcx)
mov    %al,-0x9(%rbp)
je     114c <is_cfa_dev+0x4c>
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmpl   $0x844a,(%rcx)
mov    %al,-0x9(%rbp)
je     114c <is_cfa_dev+0x4c>
mov    -0x8(%rbp),%rax
mov    0x14c(%rax),%eax
and    $0xc004,%eax
cmp    $0x4004,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cfa_dev>:
mov    (%rdi),%ecx
mov    $0x1,%eax
cmp    $0x844a,%ecx
je     1117 <is_cfa_dev+0x17>
cmp    $0x848a,%ecx
jne    1118 <is_cfa_dev+0x18>
ret
mov    $0xc004,%ecx
and    0x14c(%rdi),%ecx
xor    %eax,%eax
cmp    $0x4004,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_cfa_dev(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 33930
br i1 %6, label %18, label %7
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 33866
br i1 %11, label %18, label %12
12: ; preds = %7
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 83
%15 = load i32, i32* %14
%16 = and i32 %15, 49156
%17 = icmp eq i32 %16, 16388
br label %18
18: ; preds = %12, %7, %1
%19 = phi i1 [ true, %7 ], [ true, %1 ], [ %17, %12 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_cfa_dev(i32* nocapture %0) {
%2 = load i32, i32* %0
switch i32 %2, label %3 [
i32 33930, label %9
i32 33866, label %9
]
3: ; preds = %1
%4 = getelementptr inbounds i32, i32* %0, i64 83
%5 = load i32, i32* %4
%6 = and i32 %5, 49156
%7 = icmp eq i32 %6, 16388
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %1, %1, %3
%10 = phi i32 [ 1, %1 ], [ %8, %3 ], [ 1, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int atomic_int;

/* Variables and functions */
int ATOMIC_VAR_INIT(int);
int /*<<< orphan*/ abort();
void test_or(void) {
  atomic_int i = ATOMIC_VAR_INIT(5);
  i |= 2;
  if (i != 7)
    abort();
  if ((i |= 8) != 15)
    abort();
}


x86 assembly (clang, -O0):
<test_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <ATOMIC_VAR_INIT@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
je     114f <test_or+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x4(%rbp)
cmp    $0xf,%eax
je     1168 <test_or+0x48>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_or>:
push   %rax
mov    $0x5,%edi
call   1040 <ATOMIC_VAR_INIT@plt>
and    $0xfffffffd,%eax
cmp    $0x5,%eax
jne    1135 <test_or+0x15>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @test_or() {
%1 = tail call i32 @ATOMIC_VAR_INIT(i32 5)
%2 = and i32 %1, -3
%3 = icmp eq i32 %2, 5
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
ret void
}
float gb_lerp(float a, float b, float t) { return a * (1.0f - t) + b * t; }


x86 assembly (clang, -O0):
<gb_lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_lerp>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @gb_lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @gb_lerp(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
ret float %6
}
int safe_chr_real_fn(char src, char *buff, char **bufp, int max) {
  char *tp;
  int retval = 0;
  tp = *bufp;
  if ((tp - buff) < max) {
    *tp++ = src;
    *bufp = tp;
    *tp = '\0';
  } else {
    buff[max] = '\0';
    retval = 1;
  }
  return retval;
}


x86 assembly (clang, -O0):
<safe_chr_real_fn>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
movslq -0x1c(%rbp),%rcx
cmp    %rcx,%rax
jge    116a <safe_chr_real_fn+0x6a>
mov    -0x1(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
jmp    117d <safe_chr_real_fn+0x7d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_chr_real_fn>:
mov    (%rdx),%r8
mov    %r8,%rax
sub    %rsi,%rax
movslq %ecx,%rcx
cmp    %rcx,%rax
jge    1122 <safe_chr_real_fn+0x22>
mov    %dil,(%r8)
add    $0x1,%r8
mov    %r8,(%rdx)
xor    %eax,%eax
movb   $0x0,(%r8)
ret
add    %rcx,%rsi
mov    $0x1,%eax
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @safe_chr_real_fn(i8 signext %0, i8* %1, i8** nocapture %2, i32 %3) {
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
%7 = ptrtoint i8* %1 to i64
%8 = sub i64 %6, %7
%9 = sext i32 %3 to i64
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %0, i8* %5
store i8* %12, i8** %2
br label %15
13: ; preds = %4
%14 = getelementptr inbounds i8, i8* %1, i64 %9
br label %15
15: ; preds = %13, %11
%16 = phi i8* [ %14, %13 ], [ %12, %11 ]
%17 = phi i32 [ 1, %13 ], [ 0, %11 ]
store i8 0, i8* %16
ret i32 %17
}
/* Variables and functions */
int identity(char);
void void_txor1(char x) { char y = (identity(x) ^ 1) ? 42 : 43; }


x86 assembly (clang, -O0):
<void_txor1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <identity@plt>
mov    %eax,%edx
xor    $0x1,%edx
mov    $0x2b,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x2(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<void_txor1>:
jmp    1030 <identity@plt>

LLVM IR (-O0):
define void @void_txor1(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @identity(i8 signext %4)
%6 = xor i32 %5, 1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 42, i32 43
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
ret void
}

LLVM IR (-O2):
define void @void_txor1(i8 signext %0) {
%2 = tail call i32 @identity(i8 signext %0)
ret void
}
void gil_taking(struct battle_char *origin, struct battle_char *target) {}


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

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

LLVM IR (-O0):
%struct.battle_char = type opaque
define void @gil_taking(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
ret void
}

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @gil_taking(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ pci_system_cleanup();
int /*<<< orphan*/ stderr;
void fatal(char *why) {
  fprintf(stderr, why);
  pci_system_cleanup();
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <pci_system_cleanup@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <pci_system_cleanup@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
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* %4)
%6 = call i32 (...) @pci_system_cleanup()
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 (...) @pci_system_cleanup()
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int a;
  while (scanf("%d", &a) != EOF) {
    printf("%d\n\n", ((a + 1) * (unsigned)a) >> 1);
  }
  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
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     116d <main+0x4d>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
imul   -0x8(%rbp),%esi
shr    $0x1,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea8(%rip),%r12
cmp    (%r12),%rax
je     1185 <main+0x65>
lea    0xeb6(%rip),%r14
lea    0xeac(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    0x4(%rsp),%eax
lea    0x1(%rax),%esi
imul   %eax,%esi
shr    %esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [5 x i8] c"%d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %0, %6
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
%9 = mul i32 %8, %7
%10 = lshr i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%13 = load i64, i64* @EOF
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %6
15: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
const char *mscgen_getenv_s(const char *name) {
  char *r = getenv(name);
  if (r == NULL)
    r = "";
  return r;
}


x86 assembly (clang, -O0):
<mscgen_getenv_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113f <mscgen_getenv_s+0x2f>
lea    0xec5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mscgen_getenv_s>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @mscgen_getenv_s(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @mscgen_getenv_s(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printAllPermutation(char *, int /*<<< orphan*/, scalar_t__);
scalar_t__ strlen(char *);
int main() {
  char perm[] = "abcd";
  printAllPermutation(perm, 0, strlen(perm) - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1040 <printAllPermutation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <printAllPermutation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.perm = [5 x i8] c"abcd\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i64 @strlen(i8* %4)
%6 = sub nsw i64 %5, 1
%7 = call i32 @printAllPermutation(i8* %3, i32 0, i64 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.perm = [5 x i8] c"abcd\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i64 @strlen(i8* %2)
%4 = add nsw i64 %3, -1
%5 = call i32 @printAllPermutation(i8* %2, i32 0, i64 %4)
ret i32 0
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_type;
};

/* Variables and functions */
void foo() {
  struct dirent *d;
  d->d_type;
}


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

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

LLVM IR (-O0):
%struct.dirent = type { i32 }
define void @foo() {
%1 = alloca %struct.dirent*
%2 = load %struct.dirent*, %struct.dirent** %1
%3 = getelementptr inbounds %struct.dirent, %struct.dirent* %2, i32 0, i32 0
%4 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
void my_fun\U000000e7\U000000e3o(void) {}


x86 assembly (clang, -O0):
<my_função>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_função>:
ret

LLVM IR (-O0):
define void @"my_fun\C3\A7\C3\A3o"() {
ret void
}

LLVM IR (-O2):
define void @"my_fun\C3\A7\C3\A3o"() {
ret void
}
int is_digit(char c) {
  int n;
  if (c >= '0' && c <= '9')
    n = 1;
  else
    n = 0;
  return n;
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_digit+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_digit+0x30>
movl   $0x1,-0x8(%rbp)
jmp    1137 <is_digit+0x37>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %3
br label %13
12: ; preds = %7, %1
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}