xunge/DecIR huggingface dataset:
void fftwf_extract_reim(int sign, float *c, float **r, float **i) {
  if (sign == (-1)) {
    *r = c + 0;
    *i = c + 1;
  } else {
    *r = c + 1;
    *i = c + 0;
  }
}


x86 assembly (clang, -O0):
<fftwf_extract_reim>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    113c <fftwf_extract_reim+0x3c>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
add    $0x4,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    1156 <fftwf_extract_reim+0x56>
mov    -0x10(%rbp),%rcx
add    $0x4,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftwf_extract_reim>:
cmp    $0xffffffff,%edi
je     1110 <fftwf_extract_reim+0x10>
lea    0x4(%rsi),%rax
mov    %rax,(%rdx)
mov    %rsi,(%rcx)
ret
mov    %rsi,(%rdx)
add    $0x4,%rsi
mov    %rsi,(%rcx)
ret

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

LLVM IR (-O2):
define void @fftwf_extract_reim(i32 %0, float* %1, float** nocapture writeonly %2, float** nocapture writeonly %3) {
%5 = icmp eq i32 %0, -1
br i1 %5, label %6, label %8
6: ; preds = %4
store float* %1, float** %2
%7 = getelementptr inbounds float, float* %1, i64 1
br label %10
8: ; preds = %4
%9 = getelementptr inbounds float, float* %1, i64 1
store float* %9, float** %2
br label %10
10: ; preds = %8, %6
%11 = phi float* [ %1, %8 ], [ %7, %6 ]
store float* %11, float** %3
ret void
}
int test_imm_73uint8_reg(unsigned char val) {
  return ((val) & (0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x73,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_73uint8_reg>:
test   $0x73,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_73uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 115
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ksft_print_cnts();
int ksft_exit_fail(void) {
  ksft_print_cnts();
  exit(1);
}


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

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

LLVM IR (-O0):
define i32 @ksft_exit_fail() {
%1 = call i32 (...) @ksft_print_cnts()
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @ksft_exit_fail() {
%1 = tail call i32 (...) @ksft_print_cnts()
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
extern uint16_t util_ToFromLE16(uint16_t val) {
  return ((val & 0xff) << 8) | ((val & 0xff00) >> 8);
}


x86 assembly (clang, -O0):
<util_ToFromLE16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_ToFromLE16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @util_ToFromLE16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @util_ToFromLE16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
signed int le_read16(const void *addr) {
  const unsigned char *p = (const unsigned char *)addr;
  return p[0] | (p[1] << 8);
}


x86 assembly (clang, -O0):
<le_read16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_read16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @le_read16(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @le_read16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int read_int() {
  int res = 0;
  scanf("%d", &res);
  return res;
}


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

x86 assembly (clang, -O2):
<read_int>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @read_int() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @read_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int sumOfElements(int *, int);
int empiricMean(int *vector, int size) {
  int value = 0;
  int sum = sumOfElements(vector, size);
  value = sum / size;
  return value;
}


x86 assembly (clang, -O0):
<empiricMean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sumOfElements@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empiricMean>:
push   %rbx
mov    %esi,%ebx
call   1030 <sumOfElements@plt>
cltd
idiv   %ebx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @empiricMean(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @sumOfElements(i32* %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @empiricMean(i32* %0, i32 %1) {
%3 = tail call i32 @sumOfElements(i32* %0, i32 %1)
%4 = sdiv i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int atan(int);
void sfcPI2(double *cnst) { *cnst = 2 * atan(1); }


x86 assembly (clang, -O0):
<sfcPI2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <atan@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfcPI2>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <atan@plt>
add    %eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sfcPI2(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call i32 @atan(i32 1)
%4 = mul nsw i32 2, %3
%5 = sitofp i32 %4 to double
%6 = load double*, double** %2
store double %5, double* %6
ret void
}

LLVM IR (-O2):
define void @sfcPI2(double* nocapture writeonly %0) {
%2 = tail call i32 @atan(i32 1)
%3 = shl nsw i32 %2, 1
%4 = sitofp i32 %3 to double
store double %4, double* %0
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int FETCH();
uint16_t getword() {
  uint8_t temp = FETCH();
  return temp | (FETCH() << 8);
}


x86 assembly (clang, -O0):
<getword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <FETCH@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <FETCH@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getword>:
push   %rbx
xor    %eax,%eax
call   1030 <FETCH@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <FETCH@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getword() {
%1 = alloca i32
%2 = call i32 (...) @FETCH()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (...) @FETCH()
%5 = shl i32 %4, 8
%6 = or i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @getword() {
%1 = tail call i32 (...) @FETCH()
%2 = tail call i32 (...) @FETCH()
%3 = shl i32 %2, 8
%4 = or i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
scalar_t__ shutdown(int, int);
void Shutdown(int sockfd, int howto) {
  if (shutdown(sockfd, howto) < 0)
    err_sys("shutdown error");
}


x86 assembly (clang, -O0):
<Shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <shutdown@plt>
cmp    $0x0,%rax
jge    114f <Shutdown+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Shutdown>:
push   %rax
call   1040 <shutdown@plt>
test   %rax,%rax
js     112d <Shutdown+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"shutdown error\00"
define void @Shutdown(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @shutdown(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @err_sys(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"shutdown error\00"
define void @Shutdown(i32 %0, i32 %1) {
%3 = tail call i64 @shutdown(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ statmbx_getRelativeFname(char *, char *, char *);
FILE *statmbx_getFile(char *homedir, char *suffix) {
  char fname[256];
  statmbx_getRelativeFname(homedir, suffix, fname);
  return fopen(fname, "r");
}


x86 assembly (clang, -O0):
<statmbx_getFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x110(%rbp),%rdx
call   1040 <statmbx_getRelativeFname@plt>
lea    -0x110(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <fopen@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statmbx_getFile>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <statmbx_getRelativeFname@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <fopen@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32* @statmbx_getFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%9 = call i32 @statmbx_getRelativeFname(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %11
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @statmbx_getFile(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @statmbx_getRelativeFname(i8* %0, i8* %1, i8* %4)
%6 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %6
}
void rop3_211_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D | S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_211_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_211_0_0>:
mov    (%rdi),%al
or     %sil,%al
and    %dl,%al
xor    %sil,%al
not    %al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_211_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, %1
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
char *x();
long main() {
  char *g;
  g = x();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <x@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = alloca i8*
%3 = call i8* (...) @x()
store i8* %3, i8** %2
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @main() {
%1 = tail call i8* (...) @x()
ret i64 undef
}
int soucetCisel(int n) {
  int vysledek = 0;
  while (n > 0) {
    vysledek += n;
    n--;
  }
  return vysledek;
}


x86 assembly (clang, -O0):
<soucetCisel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <soucetCisel+0x2f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <soucetCisel+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soucetCisel>:
test   %edi,%edi
jle    1119 <soucetCisel+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @soucetCisel(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ Sound_Init();
int /*<<< orphan*/ Sound_Shutdown();
void Sound_Restart_f(void) {
  Sound_Shutdown();
  Sound_Init();
}


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

x86 assembly (clang, -O2):
<Sound_Restart_f>:
push   %rax
xor    %eax,%eax
call   1030 <Sound_Shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Sound_Init@plt>

LLVM IR (-O0):
define void @Sound_Restart_f() {
%1 = call i32 (...) @Sound_Shutdown()
%2 = call i32 (...) @Sound_Init()
ret void
}

LLVM IR (-O2):
define void @Sound_Restart_f() {
%1 = tail call i32 (...) @Sound_Shutdown()
%2 = tail call i32 (...) @Sound_Init()
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double time_now(void) {
  struct timespec ts[1];
  clock_gettime(CLOCK_MONOTONIC, ts);
  return (double)ts->tv_sec + ts->tv_nsec / 1e9;
}


x86 assembly (clang, -O0):
<time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xec3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_now>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq 0x8(%rsp),%xmm1
cvtsi2sdl (%rsp),%xmm0
divsd  0xec7(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define double @time_now() {
%1 = alloca [1 x %struct.timespec]
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = getelementptr inbounds [1 x %struct.timespec], [1 x %struct.timespec]* %1, i64 0, i64 0
%4 = call i32 @clock_gettime(i32 %2, %struct.timespec* %3)
%5 = getelementptr inbounds [1 x %struct.timespec], [1 x %struct.timespec]* %1, i64 0, i64 0
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds [1 x %struct.timespec], [1 x %struct.timespec]* %1, i64 0, i64 0
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 1.000000e+09
%14 = fadd double %8, %13
ret double %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define double @time_now() {
%1 = alloca [1 x %struct.timespec]
%2 = bitcast [1 x %struct.timespec]* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = getelementptr inbounds [1 x %struct.timespec], [1 x %struct.timespec]* %1, i64 0, i64 0
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
%6 = getelementptr inbounds [1 x %struct.timespec], [1 x %struct.timespec]* %1, i64 0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds [1 x %struct.timespec], [1 x %struct.timespec]* %1, i64 0, i64 0, i32 0
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+09
%13 = fadd double %12, %8
ret double %13
}
/* Variables and functions */
int bnode_is_leaf(size_t ref) { return (!((ref) >> 1)); }


x86 assembly (clang, -O0):
<bnode_is_leaf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnode_is_leaf>:
xor    %eax,%eax
cmp    $0x2,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @bnode_is_leaf(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 1
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @bnode_is_leaf(i64 %0) {
%2 = icmp ult i64 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
scalar_t__ strlen(char *);
void show_string(char *desc, char *str) {
  printf("zzz: str:%d %s\n%s\n", (int)strlen(str), desc, str);
}


x86 assembly (clang, -O0):
<show_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"zzz: str:%d %s\0A%s\0A\00"
define void @show_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"zzz: str:%d %s\0A%s\0A\00"
define void @show_string(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %0, i8* %1)
ret void
}
int isNumber(char c) {
  if (c == '-')
    return (1);
  if (c >= '0' && c <= '9')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1123 <isNumber+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1150 <isNumber+0x50>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1149 <isNumber+0x49>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1149 <isNumber+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <isNumber+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
cmp    $0x2d,%dil
sete   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isNumber(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
%6 = icmp eq i32 %5, 45
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %18
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 48
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %2
br label %18
17: ; preds = %12, %8
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @isNumber(i8 signext %0) {
%2 = icmp eq i8 %0, 45
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ system(char *);
void bexec(char *line) {
  system(line);
  free(line);
}


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

x86 assembly (clang, -O2):
<bexec>:
push   %rbx
mov    %rdi,%rbx
call   1040 <system@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @bexec(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
char *malloc(int);
char *bar() {
  char *b = malloc(10);
  gets(b);
  return b;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gets@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <gets@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @bar() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 10)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @gets(i8* %3)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @bar() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @gets(i8* %1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(int, int, int, int);
int main() {
  printf("%d\n", setbits(512, 5, 4, 127));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x200,%edi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0x7f,%ecx
call   1040 <setbits@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x200,%edi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0x7f,%ecx
call   1040 <setbits@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 512, i32 5, i32 4, i32 127)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_error_undefined_cond() {
  printf("Error: there's no defined action for this condition.\n");
}


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

x86 assembly (clang, -O2):
<msg_error_undefined_cond>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Error: there's no defined action for this condition.\0A\00"
define void @msg_error_undefined_cond() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"Error: there's no defined action for this condition.\00"
define void @msg_error_undefined_cond() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint64_t;

/* Variables and functions */
uint64_t volatile_fetch_add_u64(volatile uint64_t *dest, uint64_t val) {
  uint64_t result = *dest;
  *dest = result + val;
  return result;
}


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

x86 assembly (clang, -O2):
<volatile_fetch_add_u64>:
mov    %rsi,-0x8(%rsp)
mov    (%rdi),%rax
mov    %rax,-0x10(%rsp)
mov    -0x10(%rsp),%rax
add    -0x8(%rsp),%rax
mov    %rax,(%rdi)
mov    -0x10(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @volatile_fetch_add_u64(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store volatile i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = load volatile i64, i64* %6
store volatile i64 %7, i64* %5
%8 = load volatile i64, i64* %5
%9 = load volatile i64, i64* %4
%10 = add nsw i64 %8, %9
%11 = load i64*, i64** %3
store volatile i64 %10, i64* %11
%12 = load volatile i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @volatile_fetch_add_u64(i64* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %1, i64* %3
%5 = bitcast i64* %4 to i8*
%6 = load volatile i64, i64* %0
store volatile i64 %6, i64* %4
%7 = load volatile i64, i64* %4
%8 = load volatile i64, i64* %3
%9 = add nsw i64 %8, %7
store volatile i64 %9, i64* %0
%10 = load volatile i64, i64* %4
ret i64 %10
}
void AmiSetQword40ToBe(void *pAddr_p, long long int qwQwordVal_p) {
  ((unsigned char *)pAddr_p)[0] = ((unsigned char *)&qwQwordVal_p)[4];
  ((unsigned char *)pAddr_p)[1] = ((unsigned char *)&qwQwordVal_p)[3];
  ((unsigned char *)pAddr_p)[2] = ((unsigned char *)&qwQwordVal_p)[2];
  ((unsigned char *)pAddr_p)[3] = ((unsigned char *)&qwQwordVal_p)[1];
  ((unsigned char *)pAddr_p)[4] = ((unsigned char *)&qwQwordVal_p)[0];
}


x86 assembly (clang, -O0):
<AmiSetQword40ToBe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0xc(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xe(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xf(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AmiSetQword40ToBe>:
mov    %rsi,%rax
mov    %rsi,%rcx
shr    $0x10,%rcx
mov    %rsi,%rdx
shr    $0x18,%rdx
shr    $0x20,%rsi
mov    %sil,(%rdi)
mov    %dl,0x1(%rdi)
mov    %cl,0x2(%rdi)
mov    %ah,0x3(%rdi)
mov    %al,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @AmiSetQword40ToBe(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = lshr i64 %1, 24
%9 = trunc i64 %8 to i8
%10 = lshr i64 %1, 32
%11 = trunc i64 %10 to i8
store i8 %11, i8* %0
%12 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %13
%14 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %5, i8* %14
%15 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %3, i8* %15
ret void
}
void flip_pipe(void) {}


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

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

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

LLVM IR (-O2):
define void @flip_pipe() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ grava_li(int, char *);
void rot7_sem() { grava_li(1, "$ROTD"); }


x86 assembly (clang, -O0):
<rot7_sem>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <grava_li@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot7_sem>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <grava_li@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"$ROTD\00"
define void @rot7_sem() {
%1 = call i32 @grava_li(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"$ROTD\00"
define void @rot7_sem() {
%1 = tail call i32 @grava_li(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ abs(scalar_t__);
uint8_t data_noise_reduse(uint16_t data_prev, uint16_t data_new,
                          uint8_t delta) {
  if (abs(data_prev - data_new) > delta) {
    return data_new;
  } else {
    return data_prev;
  }
}


x86 assembly (clang, -O0):
<data_noise_reduse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x18(%rbp),%rdi
call   1030 <abs@plt>
cmp    -0x20(%rbp),%rax
jle    1148 <data_noise_reduse+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <data_noise_reduse+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_noise_reduse>:
mov    %rdi,%rax
mov    %rdi,%rcx
sub    %rsi,%rcx
mov    %rcx,%rdi
neg    %rdi
cmovs  %rcx,%rdi
cmp    %rdx,%rdi
cmovg  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @data_noise_reduse(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = sub nsw i64 %8, %9
%11 = call i64 @abs(i64 %10)
%12 = load i64, i64* %7
%13 = icmp sgt i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = load i64, i64* %6
store i64 %15, i64* %4
br label %18
16: ; preds = %3
%17 = load i64, i64* %5
store i64 %17, i64* %4
br label %18
18: ; preds = %16, %14
%19 = load i64, i64* %4
ret i64 %19
}

LLVM IR (-O2):
define i64 @data_noise_reduse(i64 %0, i64 %1, i64 %2) {
%4 = sub nsw i64 %0, %1
%5 = tail call i64 @llvm.abs.i64(i64 %4, i1 true)
%6 = icmp sgt i64 %5, %2
%7 = select i1 %6, i64 %1, i64 %0
ret i64 %7
}
int checkSO() { return 0; }


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

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

LLVM IR (-O0):
define i32 @checkSO() {
ret i32 0
}

LLVM IR (-O2):
define i32 @checkSO() {
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRD8_get(void) { return U_WMRCORENONE_get("U_WMRD8"); }


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

x86 assembly (clang, -O2):
<U_WMRD8_get>:
lea    0xee9(%rip),%rdi
jmp    1030 <U_WMRCORENONE_get@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRD8\00"
define i32 @U_WMRD8_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRD8\00"
define i32 @U_WMRD8_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ff_init_ff_sine_windows(int);
void tableinit(void) {
  int i;
  for (i = 5; i <= 12; i++)
    ff_init_ff_sine_windows(i);
}


x86 assembly (clang, -O0):
<tableinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jg     113f <tableinit+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <ff_init_ff_sine_windows@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <tableinit+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tableinit>:
push   %rax
mov    $0x5,%edi
call   1030 <ff_init_ff_sine_windows@plt>
mov    $0x6,%edi
call   1030 <ff_init_ff_sine_windows@plt>
mov    $0x7,%edi
call   1030 <ff_init_ff_sine_windows@plt>
mov    $0x8,%edi
call   1030 <ff_init_ff_sine_windows@plt>
mov    $0x9,%edi
call   1030 <ff_init_ff_sine_windows@plt>
mov    $0xa,%edi
call   1030 <ff_init_ff_sine_windows@plt>
mov    $0xb,%edi
call   1030 <ff_init_ff_sine_windows@plt>
mov    $0xc,%edi
pop    %rax
jmp    1030 <ff_init_ff_sine_windows@plt>

LLVM IR (-O0):
define void @tableinit() {
%1 = alloca i32
store i32 5, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 12
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @ff_init_ff_sine_windows(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @tableinit() {
%1 = tail call i32 @ff_init_ff_sine_windows(i32 5)
%2 = tail call i32 @ff_init_ff_sine_windows(i32 6)
%3 = tail call i32 @ff_init_ff_sine_windows(i32 7)
%4 = tail call i32 @ff_init_ff_sine_windows(i32 8)
%5 = tail call i32 @ff_init_ff_sine_windows(i32 9)
%6 = tail call i32 @ff_init_ff_sine_windows(i32 10)
%7 = tail call i32 @ff_init_ff_sine_windows(i32 11)
%8 = tail call i32 @ff_init_ff_sine_windows(i32 12)
ret void
}
/* Variables and functions */
size_t utf16_strlen(const unsigned char *string) {
  size_t len = 0;
  while (*(string + len) != 0 || *(string + len + 1) != 0)
    len += 2;
  return len;
}


x86 assembly (clang, -O0):
<utf16_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    1140 <utf16_strlen+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1150 <utf16_strlen+0x50>
jmp    1161 <utf16_strlen+0x61>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <utf16_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf16_strlen>:
xor    %eax,%eax
jmp    1114 <utf16_strlen+0x14>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x2,%rax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <utf16_strlen+0x10>
cmpb   $0x0,0x1(%rdi,%rax,1)
jne    1110 <utf16_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @utf16_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i64 [ 0, %1 ], [ %12, %11 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2, %7
%12 = add i64 %3, 2
br label %2
13: ; preds = %7
ret i64 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World\n");
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
void lanplus_set_recvdelay(int delay) { return; }


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

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

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

LLVM IR (-O2):
define void @lanplus_set_recvdelay(i32 %0) {
ret void
}
__attribute__((always_)) float get_fill_percent(float percent, float lower,
                                                float upper) {
  return percent >= upper   ? 1.0
         : percent <= lower ? 0
                            : (float)(percent - lower) / (float)(upper - lower);
}


x86 assembly (clang, -O0):
<get_fill_percent>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1134 <get_fill_percent+0x34>
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    117f <get_fill_percent+0x7f>
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1154 <get_fill_percent+0x54>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1171 <get_fill_percent+0x71>
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fill_percent>:
ucomiss %xmm2,%xmm0
jae    1120 <get_fill_percent+0x20>
xorps  %xmm3,%xmm3
ucomiss %xmm0,%xmm1
jae    111c <get_fill_percent+0x1c>
subss  %xmm1,%xmm0
subss  %xmm1,%xmm2
divss  %xmm2,%xmm0
movaps %xmm0,%xmm3
movaps %xmm3,%xmm0
ret
movss  0xed8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @get_fill_percent(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 = fcmp oge float %7, %8
br i1 %9, label %10, label %11
10: ; preds = %3
br label %27
11: ; preds = %3
%12 = load float, float* %4
%13 = load float, float* %5
%14 = fcmp ole float %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
br label %24
16: ; preds = %11
%17 = load float, float* %4
%18 = load float, float* %5
%19 = fsub float %17, %18
%20 = load float, float* %6
%21 = load float, float* %5
%22 = fsub float %20, %21
%23 = fdiv float %19, %22
br label %24
24: ; preds = %16, %15
%25 = phi float [ 0.000000e+00, %15 ], [ %23, %16 ]
%26 = fpext float %25 to double
br label %27
27: ; preds = %24, %10
%28 = phi double [ 1.000000e+00, %10 ], [ %26, %24 ]
%29 = fptrunc double %28 to float
ret float %29
}

LLVM IR (-O2):
define float @get_fill_percent(float %0, float %1, float %2) {
%4 = fcmp ult float %0, %2
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = fcmp ugt float %0, %1
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = fsub float %0, %1
%9 = fsub float %2, %1
%10 = fdiv float %8, %9
br label %11
11: ; preds = %7, %5, %3
%12 = phi float [ 1.000000e+00, %3 ], [ %10, %7 ], [ 0.000000e+00, %5 ]
ret float %12
}
void RTAvlrPVRemoveBestFit(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void generate_statement_end(FILE *output) { fprintf(output, ";\n"); }


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

x86 assembly (clang, -O2):
<generate_statement_end>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [3 x i8] c";\0A\00"
define void @generate_statement_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c";\0A\00"
define void @generate_statement_end(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}