xunge/DecIR huggingface dataset:
void cond_dummy_update(const struct XCSF *xcsf, const struct Cl *c,
                       const double *x, const double *y) {
  (void)xcsf;
  (void)c;
  (void)x;
  (void)y;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_update(%struct.XCSF* %0, %struct.Cl* %1, double* %2, double* %3) {
%5 = alloca %struct.XCSF*
%6 = alloca %struct.Cl*
%7 = alloca double*
%8 = alloca double*
store %struct.XCSF* %0, %struct.XCSF** %5
store %struct.Cl* %1, %struct.Cl** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load %struct.XCSF*, %struct.XCSF** %5
%10 = load %struct.Cl*, %struct.Cl** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_update(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Type definitions */
struct stemmer {
  int dummy;
};

/* Variables and functions */
scalar_t__ m(struct stemmer *);
int /*<<< orphan*/ setto(struct stemmer *, char const *);
void r(struct stemmer *z, const char *s) {
  if (m(z) > 0) {
    setto(z, s);
  }
}


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <m@plt>
cmp    $0x0,%rax
jle    1150 <r+0x30>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <setto@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <m@plt>
test   %rax,%rax
jle    1146 <r+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <setto@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stemmer = type { i32 }
define void @r(%struct.stemmer* %0, i8* %1) {
%3 = alloca %struct.stemmer*
%4 = alloca i8*
store %struct.stemmer* %0, %struct.stemmer** %3
store i8* %1, i8** %4
%5 = load %struct.stemmer*, %struct.stemmer** %3
%6 = call i64 @m(%struct.stemmer* %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load %struct.stemmer*, %struct.stemmer** %3
%10 = load i8*, i8** %4
%11 = call i32 @setto(%struct.stemmer* %9, i8* %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.stemmer = type { i32 }
define void @r(%struct.stemmer* %0, i8* %1) {
%3 = tail call i64 @m(%struct.stemmer* %0)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @setto(%struct.stemmer* %0, i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void term_flash() { printf("\033[5m"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[5m\00"
define void @term_flash() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[5m\00"
define void @term_flash() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int exy(int x) {
  int tmp;
  int result = 1;
  if (x == 0)
    return 1;
  for (tmp = 1; tmp <= x; tmp++)
    result *= 2;
  return result;
}


x86 assembly (clang, -O0):
<exy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <exy+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1154 <exy+0x54>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114e <exy+0x4e>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <exy+0x2b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exy>:
test   %edi,%edi
jle    1118 <exy+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <exy+0x1e>
mov    $0x1,%eax
jmp    1138 <exy+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <exy+0x30>
test   %ecx,%ecx
je     1147 <exy+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <exy+0x40>
ret

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

LLVM IR (-O2):
define i32 @exy(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %25, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
/* Variables and functions */
char toupper(char);
void strtoupper(char *s, long l) {
  long i;
  for (i = 0; i < l; i++)
    s[i] = toupper(s[i]);
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1165 <strtoupper+0x55>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <strtoupper+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1147 <strtoupper+0x37>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <strtoupper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @strtoupper(i8* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yogrt_set_debug(int);
int iyogrt_set_debug__(int *val) {
  yogrt_set_debug(*val);
  return *val;
}


x86 assembly (clang, -O0):
<iyogrt_set_debug__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <yogrt_set_debug@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iyogrt_set_debug__>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <yogrt_set_debug@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iyogrt_set_debug__(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @yogrt_set_debug(i32 %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @iyogrt_set_debug__(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @yogrt_set_debug(i32 %2)
%4 = load i32, i32* %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int CED_DbgStopLoop(int fh) { return ioctl(fh, _IO(0xce, 40)); }


x86 assembly (clang, -O0):
<CED_DbgStopLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xce,%edi
mov    $0x28,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_DbgStopLoop>:
push   %rbx
mov    %edi,%ebx
mov    $0xce,%edi
mov    $0x28,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_DbgStopLoop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 206, i32 40)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CED_DbgStopLoop(i32 %0) {
%2 = tail call i32 @_IO(i32 206, i32 40)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void bury_uint(uint8_t *buf, unsigned int i) { *(int *)buf = i; }


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

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

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

LLVM IR (-O2):
define void @bury_uint(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
const char *type_name(signed char t) {
  if (t)
    return "SCHAR";
  else
    return "signed char";
}


x86 assembly (clang, -O0):
<type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1124 <type_name+0x24>
lea    0xee5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <type_name+0x2f>
lea    0xedb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_name>:
test   %dil,%dil
lea    0xefc(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"SCHAR\00"
@.str.1 = [12 x i8] c"signed char\00"
define i8* @type_name(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"SCHAR\00"
@.str.1 = [12 x i8] c"signed char\00"
define i8* @type_name(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(size_t *);
void nl_xvector_free(size_t *v) { free(v); }


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

x86 assembly (clang, -O2):
<nl_xvector_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @nl_xvector_free(i64* nocapture %0) {
%2 = tail call i32 @free(i64* %0)
ret void
}
void RTAvlroGCPtrInsert(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPtrInsert() {
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
int wLexIsNonBreakingChar(char c) {
  if (isalnum(c)) {
    return 1;
  }
  switch (c) {
  case '$':
  case '_':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<wLexIsNonBreakingChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     113d <wLexIsNonBreakingChar+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1176 <wLexIsNonBreakingChar+0x66>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x24,%eax
je     1163 <wLexIsNonBreakingChar+0x53>
jmp    1152 <wLexIsNonBreakingChar+0x42>
mov    -0xc(%rbp),%eax
sub    $0x5f,%eax
jne    116f <wLexIsNonBreakingChar+0x5f>
jmp    1163 <wLexIsNonBreakingChar+0x53>
movl   $0x1,-0x4(%rbp)
jmp    1176 <wLexIsNonBreakingChar+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wLexIsNonBreakingChar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x24,%bl
sete   %cl
cmp    $0x5f,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wLexIsNonBreakingChar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalnum(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %13
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
switch i32 %10, label %12 [
i32 36, label %11
i32 95, label %11
]
11: ; preds = %8, %8
store i32 1, i32* %2
br label %13
12: ; preds = %8
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @wLexIsNonBreakingChar(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 36
%5 = icmp eq i8 %0, 95
%6 = or i1 %4, %5
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int, int);
void reset_data(int *a, int *b, int *c) {
  memset(a, -1, 10000 * sizeof(*a));
  memset(b, -1, 10000 * sizeof(*b));
  memset(c, -1, 10000 * sizeof(*c));
}


x86 assembly (clang, -O0):
<reset_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x9c40,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x9c40,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x9c40,%edx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_data>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0xffffffff,%esi
mov    $0x9c40,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x9c40,%edx
call   1030 <memset@plt>
mov    %r14,%rdi
mov    $0xffffffff,%esi
mov    $0x9c40,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @reset_data(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @memset(i32* %0, i32 -1, i32 40000)
%5 = tail call i32 @memset(i32* %1, i32 -1, i32 40000)
%6 = tail call i32 @memset(i32* %2, i32 -1, i32 40000)
ret void
}
double usecs_to_secs(double usecs) { return usecs / 1000000; }


x86 assembly (clang, -O0):
<usecs_to_secs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @usecs_to_secs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+06
ret double %4
}

LLVM IR (-O2):
define double @usecs_to_secs(double %0) {
%2 = fdiv double %0, 1.000000e+06
ret double %2
}
int test_imm_4Cuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x4C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Cuint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x4c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Cuint64_highword_reg>:
movabs $0x4c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Cuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 76
%6 = icmp ne i64 %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_4Cuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 326417514496
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int main() {
  char str[80];
  sprintf(str, "Linkerist %s", "Heracles");
  puts(str);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xec6(%rip),%rsi
lea    0xecc(%rip),%rdx
call   1040 <sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xed4(%rip),%rsi
lea    0xeda(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Linkerist %s\00"
@.str.1 = [9 x i8] c"Heracles\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = call i32 @puts(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Linkerist %s\00"
@.str.1 = [9 x i8] c"Heracles\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* %2)
ret i32 0
}
void signed_char_div_signed_char(signed char *LHS, signed char RHS) {
  (*LHS) /= RHS;
}


x86 assembly (clang, -O0):
<signed_char_div_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_div_signed_char>:
movsbl (%rdi),%eax
cwtd
idiv   %si
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_div_signed_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = sdiv i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_div_signed_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i16
%5 = sext i8 %1 to i16
%6 = sdiv i16 %4, %5
%7 = trunc i16 %6 to i8
store i8 %7, i8* %0
ret void
}
int htotl(int val) { return (val); }


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

x86 assembly (clang, -O2):
<htotl>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @htotl(i32 returned %0) {
ret i32 %0
}
int main() {
  int i;
  if ((i == 1))
    ;
  "👿berhund";
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111a <main+0x1a>
jmp    111a <main+0x1a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"\F0\9F\91\BFberhund\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCOffset() {
  long int stat = 99;
  BNCIO(13);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0xd,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCOffset>:
push   %rax
mov    $0xd,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCOffset() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 13)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCOffset() {
%1 = tail call i32 @BNCIO(i32 13)
ret i64 99
}
/* Variables and functions */
int kr_func1(int, int);
int kr_func2(int, int);
int /*<<< orphan*/ printf(char *, ...);
kr_test() {
  printf("kr_test:\n");
  printf("func1=%d\n", kr_func1(3, 4));
  printf("func2=%d\n", kr_func2(3, 4));
  return 0;
}


x86 assembly (clang, -O0):
<kr_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1050 <kr_func1@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <kr_func2@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kr_test>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1060 <kr_func1@plt>
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1050 <kr_func2@plt>
lea    0xe88(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"kr_test:\0A\00"
@.str.1 = [10 x i8] c"func1=%d\0A\00"
@.str.2 = [10 x i8] c"func2=%d\0A\00"
define i32 @kr_test() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @kr_func1(i32 3, i32 4)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 @kr_func2(i32 3, i32 4)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"func1=%d\0A\00"
@.str.2 = [10 x i8] c"func2=%d\0A\00"
@str = [9 x i8] c"kr_test:\00"
define i32 @kr_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @kr_func1(i32 3, i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @kr_func2(i32 3, i32 4)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}
void McASPRxFmtSet(unsigned int baseAddr, unsigned int formatVal) {
  (*((volatile unsigned int *)(baseAddr + (0x68)))) = formatVal;
}


x86 assembly (clang, -O0):
<McASPRxFmtSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x68,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPRxFmtSet>:
add    $0x68,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @McASPRxFmtSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 104
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @McASPRxFmtSet(i32 %0, i32 %1) {
%3 = add i32 %0, 104
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Variables and functions */
scalar_t__ ldexp(float, int);
float ldexpf(float x, int exp) { return (float)ldexp(x, exp); }


x86 assembly (clang, -O0):
<ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <ldexp@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexpf>:
push   %rax
call   1030 <ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ldexpf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = call i64 @ldexp(float %5, i32 %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = tail call i64 @ldexp(float %0, i32 %1)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("ok\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"ok\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *strchr(const char *s, int c) {
  for (; *s != '\0'; s++) {
    if (*s == (const char)c) {
      return (char *)s;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113d <strchr+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <strchr+0x5b>
jmp    1142 <strchr+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ null, %2 ], [ null, %13 ], [ %10, %8 ]
ret i8* %18
}
int ld_ble_rc2(long double a1) { return !(__builtin_islessequal(a1, 100)); }


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

x86 assembly (clang, -O2):
<ld_ble_rc2>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ld_ble_rc2(x86_fp80 %0) {
%2 = fcmp ugt x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
int dlinfo(void *ptr1, int x, void *ptr2) { return 0; }


x86 assembly (clang, -O0):
<dlinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dlinfo(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2SRxDataGet(unsigned long ulBase, unsigned long *pulData) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  while ((*((volatile unsigned long *)(ulBase + 0x00000818))) == 0) {
  }
  *pulData = (*((volatile unsigned long *)(ulBase + 0x00000800)));
}


x86 assembly (clang, -O0):
<I2SRxDataGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x818(%rax),%rax
cmp    $0x0,%rax
jne    114f <I2SRxDataGet+0x3f>
jmp    1135 <I2SRxDataGet+0x25>
mov    -0x8(%rbp),%rax
mov    0x800(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SRxDataGet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
nopl   0x0(%rax)
cmpq   $0x0,0x818(%rbx)
je     1130 <I2SRxDataGet+0x20>
mov    0x800(%rbx),%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2SRxDataGet(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074085888
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
br label %9
9: ; preds = %15, %2
%10 = load i64, i64* %3
%11 = add i64 %10, 2072
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %9
br label %9
16: ; preds = %9
%17 = load i64, i64* %3
%18 = add i64 %17, 2048
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = load i64*, i64** %4
store i64 %20, i64* %21
ret void
}

LLVM IR (-O2):
define void @I2SRxDataGet(i64 %0, i64* nocapture writeonly %1) {
%3 = icmp eq i64 %0, 1074085888
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 2072
%7 = inttoptr i64 %6 to i64*
br label %8
8: ; preds = %8, %2
%9 = load volatile i64, i64* %7
%10 = icmp eq i64 %9, 0
br i1 %10, label %8, label %11
11: ; preds = %8
%12 = add i64 %0, 2048
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
store i64 %14, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VisClearScreen();
int /*<<< orphan*/ _PrintDevices();
int /*<<< orphan*/ _PrintMFLQ();
int /*<<< orphan*/ _PrintMMU();
int /*<<< orphan*/ _PrintProcMessages();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void VisPrintState(void) {
  VisClearScreen();
  _PrintMFLQ();
  _PrintDevices();
  _PrintMMU();
  _PrintProcMessages();
  fflush(stdout);
}


x86 assembly (clang, -O0):
<VisPrintState>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <VisClearScreen@plt>
mov    $0x0,%al
call   1080 <_PrintMFLQ@plt>
mov    $0x0,%al
call   1070 <_PrintDevices@plt>
mov    $0x0,%al
call   1030 <_PrintMMU@plt>
mov    $0x0,%al
call   1050 <_PrintProcMessages@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VisPrintState>:
push   %rax
xor    %eax,%eax
call   1040 <VisClearScreen@plt>
xor    %eax,%eax
call   1080 <_PrintMFLQ@plt>
xor    %eax,%eax
call   1070 <_PrintDevices@plt>
xor    %eax,%eax
call   1030 <_PrintMMU@plt>
xor    %eax,%eax
call   1050 <_PrintProcMessages@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1060 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @VisPrintState() {
%1 = call i32 (...) @VisClearScreen()
%2 = call i32 (...) @_PrintMFLQ()
%3 = call i32 (...) @_PrintDevices()
%4 = call i32 (...) @_PrintMMU()
%5 = call i32 (...) @_PrintProcMessages()
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @VisPrintState() {
%1 = tail call i32 (...) @VisClearScreen()
%2 = tail call i32 (...) @_PrintMFLQ()
%3 = tail call i32 (...) @_PrintDevices()
%4 = tail call i32 (...) @_PrintMMU()
%5 = tail call i32 (...) @_PrintProcMessages()
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
ret void
}
void Msp430TimerCapComP__3__Timer__overflow(void) {}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCapComP__3__Timer__overflow() {
ret void
}
int __attribute__((no, noclone)) get_input(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @get_input() {
ret i32 1
}

LLVM IR (-O2):
define i32 @get_input() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ crc_accumulate(int /*<<< orphan*/, int /*<<< orphan*/ *);
void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer,
                           uint8_t length) {
  const uint8_t *p = (const uint8_t *)pBuffer;
  while (length--) {
    crc_accumulate(*p++, crcAccum);
  }
}


x86 assembly (clang, -O0):
<crc_accumulate_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     115e <crc_accumulate_buffer+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <crc_accumulate@plt>
jmp    112b <crc_accumulate_buffer+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_accumulate_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     1145 <crc_accumulate_buffer+0x35>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
mov    %r15,%rsi
call   1030 <crc_accumulate@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <crc_accumulate_buffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @crc_accumulate_buffer(i32* %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to i32*
br label %7
7: ; preds = %5, %7
%8 = phi i32* [ %11, %7 ], [ %6, %5 ]
%9 = phi i32 [ %10, %7 ], [ %2, %5 ]
%10 = add nsw i32 %9, -1
%11 = getelementptr inbounds i32, i32* %8, i64 1
%12 = load i32, i32* %8
%13 = tail call i32 @crc_accumulate(i32 %12, i32* %0)
%14 = icmp eq i32 %10, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ writeidel(int, int /*<<< orphan*/);
void ide_write_sec_l(uint16_t addr, uint32_t val, void *priv) {
  writeidel(1, val);
}


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

x86 assembly (clang, -O2):
<ide_write_sec_l>:
mov    $0x1,%edi
jmp    1030 <writeidel@plt>

LLVM IR (-O0):
define void @ide_write_sec_l(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* %5
%8 = call i32 @writeidel(i32 1, i32 %7)
ret void
}

LLVM IR (-O2):
define void @ide_write_sec_l(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @writeidel(i32 1, i32 %1)
ret void
}
void float_to_ullong(unsigned long long *dest, float src) {
  *dest = (unsigned long long)src;
}


x86 assembly (clang, -O0):
<float_to_ullong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xee6(%rip),%xmm2
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rax
cvttss2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
and    %rdx,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_to_ullong>:
cvttss2si %xmm0,%rax
mov    %rax,%rcx
subss  0xef0(%rip),%xmm0
cvttss2si %xmm0,%rdx
sar    $0x3f,%rcx
and    %rcx,%rdx
or     %rax,%rdx
mov    %rdx,(%rdi)
ret

LLVM IR (-O0):
define void @float_to_ullong(i64* %0, float %1) {
%3 = alloca i64*
%4 = alloca float
store i64* %0, i64** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fptoui float %5 to i64
%7 = load i64*, i64** %3
store i64 %6, i64* %7
ret void
}

LLVM IR (-O2):
define void @float_to_ullong(i64* nocapture writeonly %0, float %1) {
%3 = fptoui float %1 to i64
store i64 %3, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tokenization_error(int, char *, char *, char *);
void could_not_open(int severity, char *fle_nam, char *for_what) {
  tokenization_error(severity, "Could not open file %s for %s.\n", fle_nam,
                     for_what);
}


x86 assembly (clang, -O0):
<could_not_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <tokenization_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<could_not_open>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <tokenization_error@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Could not open file %s for %s.\0A\00"
define void @could_not_open(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @tokenization_error(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Could not open file %s for %s.\0A\00"
define void @could_not_open(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @tokenization_error(i32 %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
int test_imm_DFuint16_mem(unsigned short *val) {
  return ((*val) & (-0xDF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DFuint16_mem>:
movzwl (%rdi),%eax
test   $0xff21,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DFuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -223
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int baz(int *const p __attribute__((pass_object_size(1))), int n) {
  return p[n];
}


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

x86 assembly (clang, -O2):
<baz>:
movslq %edx,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @baz(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @baz(i32* nocapture %0, i64 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
void *test_anti_range_74(signed char n) {
  extern void *alloc_anti_range_74(signed char) __attribute__((alloc_size(1)));
  if (1 <= n && n <= 1)
    n = 1 - 1;
  return alloc_anti_range_74(n);
}


x86 assembly (clang, -O0):
<test_anti_range_74>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_74+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jg     1140 <test_anti_range_74+0x30>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_74@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_74>:
xor    %eax,%eax
cmp    $0x1,%dil
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_74@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_74(i8 signext %0) {
%2 = icmp eq i8 %0, 1
%3 = select i1 %2, i8 0, i8 %0
%4 = tail call i8* @alloc_anti_range_74(i8 signext %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void send_message(int fd, char *msg) { write(fd, msg, strlen(msg)); }


x86 assembly (clang, -O0):
<send_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @send_message(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}