xunge/DecIR huggingface dataset:
/* Variables and functions */
char EOF;
int /*<<< orphan*/ printf(char *, char);
int main() {
  char e = EOF;
  printf("%c", e);
  return 0;
}


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

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

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

LLVM IR (-O2):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = load i8, i8* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %1)
ret i32 0
}
/* Type definitions */
struct free_arena_header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove_from_free_chain(struct free_arena_header *);
int /*<<< orphan*/ remove_from_main_chain(struct free_arena_header *);
void remove_from_chains(struct free_arena_header *ah) {
  remove_from_free_chain(ah);
  remove_from_main_chain(ah);
}


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

x86 assembly (clang, -O2):
<remove_from_chains>:
push   %rbx
mov    %rdi,%rbx
call   1040 <remove_from_free_chain@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <remove_from_main_chain@plt>

LLVM IR (-O0):
%struct.free_arena_header = type { i32 }
define void @remove_from_chains(%struct.free_arena_header* %0) {
%2 = alloca %struct.free_arena_header*
store %struct.free_arena_header* %0, %struct.free_arena_header** %2
%3 = load %struct.free_arena_header*, %struct.free_arena_header** %2
%4 = call i32 @remove_from_free_chain(%struct.free_arena_header* %3)
%5 = load %struct.free_arena_header*, %struct.free_arena_header** %2
%6 = call i32 @remove_from_main_chain(%struct.free_arena_header* %5)
ret void
}

LLVM IR (-O2):
%struct.free_arena_header = type { i32 }
define void @remove_from_chains(%struct.free_arena_header* %0) {
%2 = tail call i32 @remove_from_free_chain(%struct.free_arena_header* %0)
%3 = tail call i32 @remove_from_main_chain(%struct.free_arena_header* %0)
ret void
}
/* Variables and functions */
char *XtNewString(char *);
char *get_os_name(void) { return XtNewString("BSD"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"BSD\00"
define i8* @get_os_name() {
%1 = call i8* @XtNewString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"BSD\00"
define i8* @get_os_name() {
%1 = tail call i8* @XtNewString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
unsigned int numReversed(unsigned int numberToReverse) {
  unsigned int reversedNumber = 0;
  while (numberToReverse) {
    reversedNumber *= 10;
    reversedNumber += numberToReverse % 10;
    numberToReverse /= 10;
  }
  return reversedNumber;
}


x86 assembly (clang, -O0):
<numReversed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <numReversed+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <numReversed+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numReversed>:
xor    %eax,%eax
test   %edi,%edi
je     1131 <numReversed+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <numReversed+0x10>
ret

LLVM IR (-O0):
define i32 @numReversed(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 ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul i32 %8, 10
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = urem i32 %10, 10
%12 = load i32, i32* %3
%13 = add i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = udiv i32 %14, 10
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @numReversed(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul i32 %4, 10
%7 = urem i32 %5, 10
%8 = add i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
int kx_arccos(float c) {
  float x;
  int ret;
  x = c * c * c;
  x = x * x * x;
  ret = 90 - (int)(59.f * c + 31.f * x);
  return ret;
}


x86 assembly (clang, -O0):
<kx_arccos>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec6(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xeb5(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%ecx
mov    $0x5a,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kx_arccos>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
mulss  0xee2(%rip),%xmm2
mulss  0xede(%rip),%xmm0
addss  %xmm2,%xmm0
cvttss2si %xmm0,%ecx
mov    $0x5a,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @kx_arccos(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = load float, float* %2
%9 = fmul float %7, %8
store float %9, float* %3
%10 = load float, float* %3
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = load float, float* %3
%14 = fmul float %12, %13
store float %14, float* %3
%15 = load float, float* %2
%16 = load float, float* %3
%17 = fmul float 3.100000e+01, %16
%18 = call float @llvm.fmuladd.f32(float 5.900000e+01, float %15, float %17)
%19 = fptosi float %18 to i32
%20 = sub nsw i32 90, %19
store i32 %20, i32* %4
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @kx_arccos(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fmul float %3, %3
%5 = fmul float %3, %4
%6 = fmul float %5, 3.100000e+01
%7 = tail call float @llvm.fmuladd.f32(float %0, float 5.900000e+01, float %6)
%8 = fptosi float %7 to i32
%9 = sub nsw i32 90, %8
ret i32 %9
}
/* Variables and functions */
float fabs(float x) {
  if (x < 0)
    return -x;
  else
    return x;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <fabs+0x32>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113c <fabs+0x3c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ diag(char *, char *);
int /*<<< orphan*/ term(int /*<<< orphan*/);
void disorder(char *s, char *t) {
  char *u;
  for (u = t; *u != '\n'; u++)
    ;
  *u = 0;
  diag(s, t);
  term(0);
}


x86 assembly (clang, -O0):
<disorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     115e <disorder+0x3e>
jmp    114d <disorder+0x2d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <disorder+0x18>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <diag@plt>
xor    %edi,%edi
call   1040 <term@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disorder>:
push   %rax
mov    %rsi,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0xa,(%rax)
lea    0x1(%rax),%rax
jne    1130 <disorder+0x10>
movb   $0x0,-0x1(%rax)
call   1030 <diag@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <term@plt>

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

LLVM IR (-O2):
define void @disorder(i8* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
store i8 0, i8* %4
%9 = tail call i32 @diag(i8* %0, i8* %1)
%10 = tail call i32 @term(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _genieWriteInhLabel(int, char *);
int /*<<< orphan*/ gcvt(float, int, char *);
int _genieWriteInhLabelFloat(int index, float n, int precision) {
  char str[sizeof(long)];
  gcvt(n, precision, str);
  _genieWriteInhLabel(index, str);
  return 0;
}


x86 assembly (clang, -O0):
<_genieWriteInhLabelFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1040 <gcvt@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1030 <_genieWriteInhLabel@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_genieWriteInhLabelFloat>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1040 <gcvt@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <_genieWriteInhLabel@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_genieWriteInhLabelFloat(i32 %0, float %1, i32 %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
%7 = alloca [8 x i8]
store i32 %0, i32* %4
store float %1, float* %5
store i32 %2, i32* %6
%8 = load float, float* %5
%9 = load i32, i32* %6
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%11 = call i32 @gcvt(float %8, i32 %9, i8* %10)
%12 = load i32, i32* %4
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%14 = call i32 @_genieWriteInhLabel(i32 %12, i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @_genieWriteInhLabelFloat(i32 %0, float %1, i32 %2) {
%4 = alloca [8 x i8]
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%6 = call i32 @gcvt(float %1, i32 %2, i8* %5)
%7 = call i32 @_genieWriteInhLabel(i32 %0, i8* %5)
ret i32 0
}
/* Variables and functions */
char *getpass(char const *);
int /*<<< orphan*/ strncpy(char *, char *, unsigned char);
int validated_or_get_len(char *);
int getpasswd(const char *prompt, char *password, unsigned char psize) {
  char *inp_pass;
  inp_pass = getpass(prompt);
  strncpy(password, inp_pass, psize - 1);
  password[psize - 1] = '\0';
  return validated_or_get_len(password);
}


x86 assembly (clang, -O0):
<getpasswd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getpass@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movzbl -0x11(%rbp),%eax
sub    $0x1,%eax
movzbl %al,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
movzbl -0x11(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
call   1040 <validated_or_get_len@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpasswd>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1050 <getpass@plt>
mov    %ebp,%ebp
lea    -0x1(%rbp),%rcx
movzbl %cl,%edx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%rbp,1)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <validated_or_get_len@plt>

LLVM IR (-O0):
define i32 @getpasswd(i8* %0, i8* %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = call i8* @getpass(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %5
%11 = load i8*, i8** %7
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 1
%15 = trunc i32 %14 to i8
%16 = call i32 @strncpy(i8* %10, i8* %11, i8 zeroext %15)
%17 = load i8*, i8** %5
%18 = load i8, i8* %6
%19 = zext i8 %18 to i32
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %17, i64 %21
store i8 0, i8* %22
%23 = load i8*, i8** %5
%24 = call i32 @validated_or_get_len(i8* %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @getpasswd(i8* %0, i8* %1, i8 zeroext %2) {
%4 = tail call i8* @getpass(i8* %0)
%5 = zext i8 %2 to i32
%6 = add nsw i32 %5, -1
%7 = trunc i32 %6 to i8
%8 = tail call i32 @strncpy(i8* %1, i8* %4, i8 zeroext %7)
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 0, i8* %10
%11 = tail call i32 @validated_or_get_len(i8* %1)
ret i32 %11
}
call4b(unp) union utag *unp;
{ unp = 0; }


x86 assembly (clang, -O0):
<call4b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.utag = type opaque
define i32 @call4b(%union.utag* %0) {
%2 = alloca i32
%3 = alloca %union.utag*
store %union.utag* %0, %union.utag** %3
store %union.utag* null, %union.utag** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%union.utag = type opaque
define i32 @call4b(%union.utag* nocapture readnone %0) {
ret i32 undef
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      if (state[0UL] > local1) {
      }
      if (state[0UL] == local1) {
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 316086328UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    116a <RandomFunc+0x6a>
movzwl -0x12(%rbp),%eax
movzwl -0x14(%rbp),%ecx
cmp    %ecx,%eax
jle    1144 <RandomFunc+0x44>
jmp    1144 <RandomFunc+0x44>
movzwl -0x12(%rbp),%eax
movzwl -0x14(%rbp),%ecx
cmp    %ecx,%eax
jne    1159 <RandomFunc+0x59>
jmp    1159 <RandomFunc+0x59>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
add    $0x12d71838,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0x237d,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = add nsw i32 %10, 2885
%12 = trunc i32 %11 to i16
%13 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %12, i16* %13
store i16 0, i16* %6
br label %14
14: ; preds = %34, %2
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %39
18: ; preds = %14
%19 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = load i16, i16* %6
%23 = zext i16 %22 to i32
%24 = icmp sgt i32 %21, %23
br i1 %24, label %25, label %26
25: ; preds = %18
br label %26
26: ; preds = %25, %18
%27 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%28 = load i16, i16* %27
%29 = zext i16 %28 to i32
%30 = load i16, i16* %6
%31 = zext i16 %30 to i32
%32 = icmp eq i32 %29, %31
br i1 %32, label %33, label %34
33: ; preds = %26
br label %34
34: ; preds = %33, %26
%35 = load i16, i16* %6
%36 = zext i16 %35 to i64
%37 = add i64 %36, 2
%38 = trunc i64 %37 to i16
store i16 %38, i16* %6
br label %14
39: ; preds = %14
%40 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%41 = load i16, i16* %40
%42 = zext i16 %41 to i64
%43 = add i64 %42, 316086328
%44 = trunc i64 %43 to i16
%45 = load i16*, i16** %4
%46 = getelementptr inbounds i16, i16* %45, i64 0
store i16 %44, i16* %46
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 9085
store i16 %4, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x21() {
  Assert_real((iscntrl(33) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              170, ("iscntrl should be 0 for !"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x21>:
push   %rax
mov    $0x21,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xaa,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for !\00"
define void @t_iscntrl_0x21() {
%1 = call i64 @iscntrl(i32 33)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for !\00"
define void @t_iscntrl_0x21() {
%1 = tail call i64 @iscntrl(i32 33)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int func(int, int);
int /*<<< orphan*/ gen_func(int, int, int);
int mksym_i32();
void test_AND() {
  int res = 0, y = 0, z = 0;
  y = mksym_i32();
  z = mksym_i32();
  res = func(y, z);
  gen_func(y, z, res);
}


x86 assembly (clang, -O0):
<test_AND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <mksym_i32@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <mksym_i32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <func@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1040 <gen_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_AND>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <mksym_i32@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <mksym_i32@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <func@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <gen_func@plt>

LLVM IR (-O0):
define void @test_AND() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 (...) @mksym_i32()
store i32 %4, i32* %2
%5 = call i32 (...) @mksym_i32()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @func(i32 %6, i32 %7)
store i32 %8, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %1
%12 = call i32 @gen_func(i32 %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @test_AND() {
%1 = tail call i32 (...) @mksym_i32()
%2 = tail call i32 (...) @mksym_i32()
%3 = tail call i32 @func(i32 %1, i32 %2)
%4 = tail call i32 @gen_func(i32 %1, i32 %2, i32 %3)
ret void
}
void swap(int vs[], int i, int j) {
  int t;
  t = vs[i];
  vs[i] = vs[j];
  vs[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void swap_mem_int(int *a, int *b) {
  int tmp = *a;
  *a = *b;
  *b = tmp;
  return;
}


x86 assembly (clang, -O0):
<swap_mem_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_mem_int>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap_mem_int(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void info(void) {
  printf("Die Spielfelder tragen von links nach rechts die Nummern 1-9\n");
  printf("Der Spieler hat das Zeichen 'X' der Computer das Zeichen 'Y'\n");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"Die Spielfelder tragen von links nach rechts die Nummern 1-9\0A\00"
@.str.1 = [62 x i8] c"Der Spieler hat das Zeichen 'X' der Computer das Zeichen 'Y'\0A\00"
define void @info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [61 x i8] c"Die Spielfelder tragen von links nach rechts die Nummern 1-9\00"
@str.2 = [61 x i8] c"Der Spieler hat das Zeichen 'X' der Computer das Zeichen 'Y'\00"
define void @info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.2, i64 0, i64 0))
ret void
}
extern long mpy_ex32(long a, long b) {
  long edx;
  __asm__("imull %2" : "=a"(a), "=d"(edx) : "rm"(b), "0"(a));
  return edx;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @mpy_ex32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = call { i64, i64 } asm "imull $2", "={ax},={dx},rm,0,~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
%9 = extractvalue { i64, i64 } %8, 0
%10 = extractvalue { i64, i64 } %8, 1
store i64 %9, i64* %3
store i64 %10, i64* %5
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
double Rad2Mi(const double rad) { return rad * 3958.755865744; }


x86 assembly (clang, -O0):
<Rad2Mi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rad2Mi>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Rad2Mi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x40AEED8300D5B54B
ret double %4
}

LLVM IR (-O2):
define double @Rad2Mi(double %0) {
%2 = fmul double %0, 0x40AEED8300D5B54B
ret double %2
}
int foo() {
  int x, y;
  x = 5;
  y = 3;
  return x + y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 8
}
void SHA256String(unsigned char Digest[32], char HexDigest[65]) {}


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

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

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

LLVM IR (-O2):
define void @SHA256String(i8* nocapture %0, i8* nocapture %1) {
ret void
}
long readlong(prompt)
char *prompt;
{
  int err;
  long res;
  char string[100];
  do {
    printf("%s", prompt);
    gets(string);
    if (sscanf(string, "%ld", &res) == 1)
      break;
  } while (1);
  return res;
}


x86 assembly (clang, -O0):
<readlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1040 <gets@plt>
lea    -0x80(%rbp),%rdi
lea    0xe9c(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1180 <readlong+0x50>
jmp    1194 <readlong+0x64>
jmp    1185 <readlong+0x55>
mov    $0x1,%al
test   $0x1,%al
jne    113f <readlong+0xf>
jmp    1194 <readlong+0x64>
mov    -0x18(%rbp),%rax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlong>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%r15
lea    0xeb6(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xead(%rip),%r12
lea    0x8(%rsp),%r13
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <gets@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1160 <readlong+0x30>
mov    0x8(%rsp),%rax
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i64 @readlong(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = alloca [100 x i8]
store i8* %0, i8** %2
br label %6
6: ; preds = %16, %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%12 = call i32 (i8*, i8*, ...) @sscanf(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %4)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %6
br label %17
15: ; preds = %6
br label %16
16: ; preds = %15
br i1 true, label %6, label %17
17: ; preds = %16, %14
%18 = load i64, i64* %4
ret i64 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i64 @readlong(i8* %0) {
%2 = alloca i64
%3 = alloca [100 x i8]
%4 = bitcast i64* %2 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
br label %6
6: ; preds = %6, %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %5)
%9 = call i32 (i8*, i8*, ...) @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %6
11: ; preds = %6
%12 = load i64, i64* %2
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ SendToReceiver(int);
void SendCCM(int ccmProcessed) { SendToReceiver(ccmProcessed); }


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

x86 assembly (clang, -O2):
<SendCCM>:
jmp    1030 <SendToReceiver@plt>

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

LLVM IR (-O2):
define void @SendCCM(i32 %0) {
%2 = tail call i32 @SendToReceiver(i32 %0)
ret void
}
int config_get_str(const char *param, char *ret) {}


x86 assembly (clang, -O0):
<config_get_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @config_get_str(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
int tolower(int c) {
  if ((c >= 'A') && (c <= 'Z'))
    return c + ('a' - 'A');
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ usleep(int);
void Recursive(int num) {
  if (num == 5) {
    int duration_us = rand() % 8000000;
    printf("going to sleep for %d us\n", duration_us);
    usleep(duration_us);
    return;
  }
  Recursive(num + 1);
}


x86 assembly (clang, -O0):
<Recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    1183 <Recursive+0x43>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x7a1200,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1060 <usleep@plt>
jmp    118e <Recursive+0x4e>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <Recursive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Recursive>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rbx
imul   $0x431bde83,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x35,%rax
add    %ecx,%eax
imul   $0x7a1200,%eax,%eax
sub    %eax,%ebx
lea    0xea2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <usleep@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"going to sleep for %d us\0A\00"
define void @Recursive(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 5
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 8000000
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @usleep(i32 %11)
br label %16
13: ; preds = %1
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
br label %16
16: ; preds = %13, %6
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"going to sleep for %d us\0A\00"
define void @Recursive(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 8000000
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @usleep(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ writeide(int, int /*<<< orphan*/, int /*<<< orphan*/);
void ide_write_sec(uint16_t addr, uint8_t val, void *priv) {
  writeide(1, addr, val);
}


x86 assembly (clang, -O0):
<ide_write_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x1,%edi
call   1030 <writeide@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_write_sec>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <writeide@plt>

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

LLVM IR (-O2):
define void @ide_write_sec(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @writeide(i32 1, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_cpl_C(char *str) {
  sprintf(str, "CPL   C                         ");
}


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

x86 assembly (clang, -O2):
<sprint_cpl_C>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"CPL C \00"
define void @sprint_cpl_C(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
void foo_1_1_1_2_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_2_1_1_2_1() {
ret void
}
void VIM_HIF_SetReg8(unsigned long adr, unsigned char val) {
  unsigned short uTemp;
  ;
  *(volatile unsigned short *)(0x8000000) = (unsigned short)adr;
  ;
  uTemp = *(volatile unsigned short *)(0x8000100);
  if ((adr & 0x1) == 0) {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff00) | val;
  } else {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff) | (val << 8);
  }
}


x86 assembly (clang, -O0):
<VIM_HIF_SetReg8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %ax,%cx
mov    $0x8000000,%eax
mov    %cx,(%rax)
mov    $0x8000100,%eax
mov    (%rax),%ax
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    115a <VIM_HIF_SetReg8+0x5a>
movzwl -0xc(%rbp),%eax
and    $0xff00,%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    $0x8000100,%eax
mov    %cx,(%rax)
jmp    1177 <VIM_HIF_SetReg8+0x77>
movzwl -0xc(%rbp),%eax
and    $0xff,%eax
movzbl -0x9(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    $0x8000100,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_HIF_SetReg8>:
mov    %di,0x8000000
08
movzwl 0x8000100,%ecx
08
test   $0x1,%dil
jne    1122 <VIM_HIF_SetReg8+0x22>
and    $0xffffff00,%ecx
movzbl %sil,%eax
jmp    112c <VIM_HIF_SetReg8+0x2c>
movzbl %cl,%ecx
movzbl %sil,%eax
shl    $0x8,%eax
or     %ecx,%eax
mov    %ax,0x8000100
08
ret

LLVM IR (-O0):
define void @VIM_HIF_SetReg8(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i16
store i64 %0, i64* %3
store i8 %1, i8* %4
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i16
store volatile i16 %7, i16* inttoptr (i64 134217728 to i16*)
%8 = load volatile i16, i16* inttoptr (i64 134217984 to i16*)
store i16 %8, i16* %5
%9 = load i64, i64* %3
%10 = and i64 %9, 1
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i16, i16* %5
%14 = zext i16 %13 to i32
%15 = and i32 %14, 65280
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i16
store volatile i16 %19, i16* inttoptr (i64 134217984 to i16*)
br label %29
20: ; preds = %2
%21 = load i16, i16* %5
%22 = zext i16 %21 to i32
%23 = and i32 %22, 255
%24 = load i8, i8* %4
%25 = zext i8 %24 to i32
%26 = shl i32 %25, 8
%27 = or i32 %23, %26
%28 = trunc i32 %27 to i16
store volatile i16 %28, i16* inttoptr (i64 134217984 to i16*)
br label %29
29: ; preds = %20, %12
ret void
}

LLVM IR (-O2):
define void @VIM_HIF_SetReg8(i64 %0, i8 zeroext %1) {
%3 = trunc i64 %0 to i16
store volatile i16 %3, i16* inttoptr (i64 134217728 to i16*)
%4 = load volatile i16, i16* inttoptr (i64 134217984 to i16*)
%5 = and i64 %0, 1
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = and i16 %4, -256
%9 = zext i8 %1 to i16
%10 = or i16 %8, %9
br label %16
11: ; preds = %2
%12 = and i16 %4, 255
%13 = zext i8 %1 to i16
%14 = shl nuw i16 %13, 8
%15 = or i16 %12, %14
br label %16
16: ; preds = %11, %7
%17 = phi i16 [ %15, %11 ], [ %10, %7 ]
store volatile i16 %17, i16* inttoptr (i64 134217984 to i16*)
ret void
}
void atexit() {}


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

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

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

LLVM IR (-O2):
define void @atexit() {
ret void
}
void exit_signal_handling() {}


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

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

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

LLVM IR (-O2):
define void @exit_signal_handling() {
ret void
}
void g_get_tmp_dir() {}


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

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

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

LLVM IR (-O2):
define void @g_get_tmp_dir() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ null_size();
int /*<<< orphan*/ out_of_mem();
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  if (ptr == NULL && size == 0)
    null_size();
  ptr = realloc(ptr, size);
  if (ptr == NULL)
    out_of_mem();
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115d <xrealloc+0x2d>
cmpq   $0x0,-0x10(%rbp)
jne    115d <xrealloc+0x2d>
mov    $0x0,%al
call   1040 <null_size@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1180 <xrealloc+0x50>
mov    $0x0,%al
call   1050 <out_of_mem@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
jne    114b <xrealloc+0x1b>
test   %r14,%r14
jne    114b <xrealloc+0x1b>
xor    %eax,%eax
call   1040 <null_size@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1165 <xrealloc+0x35>
xor    %eax,%eax
call   1050 <out_of_mem@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @null_size()
br label %12
12: ; preds = %10, %7, %2
%13 = load i8*, i8** %3
%14 = load i64, i64* %4
%15 = call i8* @realloc(i8* %13, i64 %14)
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 (...) @out_of_mem()
br label %20
20: ; preds = %18, %12
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @null_size()
br label %8
8: ; preds = %6, %2
%9 = tail call i8* @realloc(i8* %0, i64 %1)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (...) @out_of_mem()
br label %13
13: ; preds = %11, %8
ret i8* %9
}