xunge/DecIR huggingface dataset:
int isupper(int ch) { return (unsigned int)(ch - 'A') < 26u; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
cmp    $0x1a,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 65
%5 = icmp ult i32 %4, 26
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add nsw i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
sec_to_hst(logsec, hd, sec, cyl) long logsec;
char *hd, *sec, *cyl;
{
  int bigcyl;
  bigcyl = logsec / (4 * 17);
  *sec = (logsec % 17) + 1 + ((bigcyl >> 2) & 0xc0);
  *cyl = bigcyl & 0xff;
  *hd = (logsec % (4 * 17)) / 17;
}


x86 assembly (clang, -O0):
<sec_to_hst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x44,%ecx
cqto
idiv   %rcx
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x11,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
add    $0x1,%rax
mov    -0x2c(%rbp),%ecx
sar    $0x2,%ecx
and    $0xc0,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x2c(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    $0x44,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x11,%ecx
cqto
idiv   %rcx
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec_to_hst>:
mov    %rdx,%r8
mov    %rdi,%r9
movabs $0x7878787878787879,%rdx
78 78 78
mov    %rdi,%rax
imul   %rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
mov    %rdx,%rax
sar    $0x5,%rax
add    %rdi,%rax
shr    $0x3,%rdx
add    %edi,%edx
mov    %edx,%edi
shl    $0x4,%edi
add    %edx,%edi
mov    %r9d,%edx
sub    %edi,%edx
mov    %eax,%edi
shr    $0x2,%edi
and    $0xc0,%edi
add    %edx,%edi
add    $0x1,%dil
mov    %dil,(%r8)
mov    %al,(%rcx)
mov    %eax,%ecx
shl    $0x6,%ecx
lea    (%rcx,%rax,4),%eax
sub    %eax,%r9d
movsbl %r9b,%eax
imul   $0x79,%eax,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
shr    $0xb,%ecx
add    %al,%cl
mov    %cl,(%rsi)
ret

LLVM IR (-O0):
define i32 @sec_to_hst(i64 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i64 %0, i64* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%11 = load i64, i64* %6
%12 = sdiv i64 %11, 68
%13 = trunc i64 %12 to i32
store i32 %13, i32* %10
%14 = load i64, i64* %6
%15 = srem i64 %14, 17
%16 = add nsw i64 %15, 1
%17 = load i32, i32* %10
%18 = ashr i32 %17, 2
%19 = and i32 %18, 192
%20 = sext i32 %19 to i64
%21 = add nsw i64 %16, %20
%22 = trunc i64 %21 to i8
%23 = load i8*, i8** %8
store i8 %22, i8* %23
%24 = load i32, i32* %10
%25 = and i32 %24, 255
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %9
store i8 %26, i8* %27
%28 = load i64, i64* %6
%29 = srem i64 %28, 68
%30 = sdiv i64 %29, 17
%31 = trunc i64 %30 to i8
%32 = load i8*, i8** %7
store i8 %31, i8* %32
%33 = load i32, i32* %5
ret i32 %33
}

LLVM IR (-O2):
define i32 @sec_to_hst(i64 %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2, i8* nocapture writeonly %3) {
%5 = sdiv i64 %0, 68
%6 = trunc i64 %5 to i8
%7 = srem i64 %0, 17
%8 = add nsw i64 %7, 1
%9 = lshr i64 %5, 2
%10 = and i64 %9, 192
%11 = add nsw i64 %8, %10
%12 = trunc i64 %11 to i8
store i8 %12, i8* %2
store i8 %6, i8* %3
%13 = srem i64 %0, 68
%14 = trunc i64 %13 to i8
%15 = sdiv i8 %14, 17
store i8 %15, i8* %1
ret i32 undef
}
int kb_toascii(const unsigned char *key) { return '\033' + 1; }


x86 assembly (clang, -O0):
<kb_toascii>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1c,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @kb_toascii(i8* nocapture readnone %0) {
ret i32 28
}
/* Variables and functions */
void *bar(void *arg) {
  if (arg)
    arg = NULL;
  return arg;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111b <bar+0x1b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @bar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* null, i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @bar(i8* nocapture readnone %0) {
ret i8* null
}
int SCR_HorizontalAlignForString(const int x, int align, int width) {
  int nx = x;
  if (align % 3 == 0)
    nx = x;
  if (align % 3 == 1)
    nx = x - width / 2;
  if (align % 3 == 2)
    nx = x - width;
  return nx;
}


x86 assembly (clang, -O0):
<SCR_HorizontalAlignForString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112d <SCR_HorizontalAlignForString+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    115c <SCR_HorizontalAlignForString+0x5c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    1179 <SCR_HorizontalAlignForString+0x79>
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCR_HorizontalAlignForString>:
mov    %edi,%eax
movslq %esi,%rcx
imul   $0x55555556,%rcx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
shr    $0x20,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,2),%esi
sub    %esi,%ecx
mov    %eax,%esi
cmp    $0x1,%ecx
jne    1132 <SCR_HorizontalAlignForString+0x32>
mov    %edx,%edi
shr    $0x1f,%edi
add    %edx,%edi
sar    %edi
mov    %eax,%esi
sub    %edi,%esi
sub    %edx,%eax
cmp    $0x2,%ecx
cmovne %esi,%eax
ret

LLVM IR (-O0):
define i32 @SCR_HorizontalAlignForString(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
store i32 %8, i32* %7
%9 = load i32, i32* %5
%10 = srem i32 %9, 3
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %4
store i32 %13, i32* %7
br label %14
14: ; preds = %12, %3
%15 = load i32, i32* %5
%16 = srem i32 %15, 3
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = sdiv i32 %20, 2
%22 = sub nsw i32 %19, %21
store i32 %22, i32* %7
br label %23
23: ; preds = %18, %14
%24 = load i32, i32* %5
%25 = srem i32 %24, 3
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i32, i32* %4
%29 = load i32, i32* %6
%30 = sub nsw i32 %28, %29
store i32 %30, i32* %7
br label %31
31: ; preds = %27, %23
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @SCR_HorizontalAlignForString(i32 %0, i32 %1, i32 %2) {
%4 = srem i32 %1, 3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = sdiv i32 %2, -2
%8 = add i32 %7, %0
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %8, %6 ], [ %0, %3 ]
%11 = icmp eq i32 %4, 2
%12 = sub nsw i32 %0, %2
%13 = select i1 %11, i32 %12, i32 %10
ret i32 %13
}
void Security_maxMemory(unsigned long max, struct Except *eh) {}


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

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

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

LLVM IR (-O2):
%struct.Except = type opaque
define void @Security_maxMemory(i64 %0, %struct.Except* nocapture %1) {
ret void
}
/* Type definitions */
struct ebmb_node {
  int dummy;
};
struct eb_root {
  int dummy;
};

/* Variables and functions */
struct ebmb_node *__ebmb_lookup(struct eb_root *, void const *, unsigned int);
struct ebmb_node *ebmb_lookup(struct eb_root *root, const void *x,
                              unsigned int len) {
  return __ebmb_lookup(root, x, len);
}


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

x86 assembly (clang, -O2):
<ebmb_lookup>:
jmp    1030 <__ebmb_lookup@plt>

LLVM IR (-O0):
%struct.ebmb_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.ebmb_node* @ebmb_lookup(%struct.eb_root* %0, i8* %1, i32 %2) {
%4 = alloca %struct.eb_root*
%5 = alloca i8*
%6 = alloca i32
store %struct.eb_root* %0, %struct.eb_root** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.eb_root*, %struct.eb_root** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call %struct.ebmb_node* @__ebmb_lookup(%struct.eb_root* %7, i8* %8, i32 %9)
ret %struct.ebmb_node* %10
}

LLVM IR (-O2):
%struct.ebmb_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.ebmb_node* @ebmb_lookup(%struct.eb_root* %0, i8* %1, i32 %2) {
%4 = tail call %struct.ebmb_node* @__ebmb_lookup(%struct.eb_root* %0, i8* %1, i32 %2)
ret %struct.ebmb_node* %4
}
/* Variables and functions */
double sin(int);
double vy_y(double x, double y, int T) {
  return (-0.5 * T * 3.141592 * sin(T * 3.141592 * y));
}


x86 assembly (clang, -O0):
<vy_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vy_y>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  0xee3(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  0xedf(%rip),%xmm2
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%rsp)
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @vy_y(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double -5.000000e-01, %8
%10 = fmul double %9, 0x400921FAFC8B007A
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = fmul double %12, 0x400921FAFC8B007A
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = fptosi double %15 to i32
%17 = call double @sin(i32 %16)
%18 = fmul double %10, %17
ret double %18
}

LLVM IR (-O2):
define double @vy_y(double %0, double %1, i32 %2) {
%4 = sitofp i32 %2 to double
%5 = fmul double %4, -5.000000e-01
%6 = fmul double %5, 0x400921FAFC8B007A
%7 = fmul double %4, 0x400921FAFC8B007A
%8 = fmul double %7, %1
%9 = fptosi double %8 to i32
%10 = tail call double @sin(i32 %9)
%11 = fmul double %6, %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
float *malloc(int);
void leak(void) { float *a = malloc(sizeof(float) * 85); }


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

x86 assembly (clang, -O2):
<leak>:
mov    $0x154,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @leak() {
%1 = alloca float*
%2 = call float* @malloc(i32 340)
store float* %2, float** %1
ret void
}

LLVM IR (-O2):
define void @leak() {
%1 = tail call float* @malloc(i32 340)
ret void
}
/* Type definitions */
struct tinyrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tinyrl_printf(struct tinyrl *, char *, unsigned int);
void tinyrl_vt100_cursor_up(struct tinyrl *this, unsigned count) {
  tinyrl_printf(this, "\x1b[%dA", count);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <tinyrl_printf@plt>

LLVM IR (-O0):
%struct.tinyrl = type { i32 }
@.str = [6 x i8] c"\1B[%dA\00"
define void @tinyrl_vt100_cursor_up(%struct.tinyrl* %0, i32 %1) {
%3 = alloca %struct.tinyrl*
%4 = alloca i32
store %struct.tinyrl* %0, %struct.tinyrl** %3
store i32 %1, i32* %4
%5 = load %struct.tinyrl*, %struct.tinyrl** %3
%6 = load i32, i32* %4
%7 = call i32 @tinyrl_printf(%struct.tinyrl* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
%struct.tinyrl = type { i32 }
@.str = [6 x i8] c"\1B[%dA\00"
define void @tinyrl_vt100_cursor_up(%struct.tinyrl* %0, i32 %1) {
%3 = tail call i32 @tinyrl_printf(%struct.tinyrl* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
char get_tri_matrix(char matrix[26][26], int i, int j) { return matrix[i][j]; }


x86 assembly (clang, -O0):
<get_tri_matrix>:
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
imul   $0x1a,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tri_matrix>:
movslq %esi,%rax
movslq %edx,%rcx
lea    (%rax,%rax,4),%rdx
lea    (%rdx,%rdx,4),%rdx
add    %rax,%rdx
add    %rdi,%rdx
mov    (%rcx,%rdx,1),%al
ret

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

LLVM IR (-O2):
define signext i8 @get_tri_matrix([26 x i8]* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %0, i64 %4, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menu(void) {
  printf("======================\n");
  printf("1.write configure file\n");
  printf("2.read configure file\n");
  printf("3.exit\n");
  printf("======================\n");
}


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

x86 assembly (clang, -O2):
<menu>:
push   %rbx
lea    0xf1c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"======================\0A\00"
@.str.1 = [24 x i8] c"1.write configure file\0A\00"
@.str.2 = [23 x i8] c"2.read configure file\0A\00"
@.str.3 = [8 x i8] c"3.exit\0A\00"
define void @menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.4 = [23 x i8] c"1.write configure file\00"
@str.5 = [22 x i8] c"2.read configure file\00"
@str.6 = [7 x i8] c"3.exit\00"
@str.7 = [23 x i8] c"======================\00"
define void @menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) {
  printf("jumping to forth\n");
  goto forth;
back:
  printf("in back; returning\n");
  return;
  printf("unprinted\n");
forth:
  printf("in forth; jumping to back\n");
  goto back;
  printf("unprinted\n");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1133 <foo+0x23>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
jmp    1125 <foo+0x15>

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

LLVM IR (-O0):
@.str = [18 x i8] c"jumping to forth\0A\00"
@.str.1 = [20 x i8] c"in back; returning\0A\00"
@.str.2 = [27 x i8] c"in forth; jumping to back\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %4
2: ; preds = %4
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@str = [17 x i8] c"jumping to forth\00"
@str.3 = [26 x i8] c"in forth; jumping to back\00"
@str.4 = [19 x i8] c"in back; returning\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.4, i64 0, i64 0))
ret void
}
float clamp(float val, float min, float max) {
  if (val < min) {
    val = min;
  } else if (val > max) {
    val = max;
  }
  return val;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clamp+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <clamp+0x53>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    114e <clamp+0x4e>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <clamp+0x53>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
ucomiss %xmm0,%xmm1
ja     1110 <clamp+0x10>
ucomiss %xmm2,%xmm0
movaps %xmm0,%xmm1
jbe    1110 <clamp+0x10>
movaps %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
store float %11, float* %4
br label %19
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
store float %17, float* %4
br label %18
18: ; preds = %16, %12
br label %19
19: ; preds = %18, %10
%20 = load float, float* %4
ret float %20
}

LLVM IR (-O2):
define float @clamp(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fcmp ogt float %0, %2
br i1 %6, label %7, label %8
7: ; preds = %5
br label %8
8: ; preds = %3, %5, %7
%9 = phi float [ %2, %7 ], [ %0, %5 ], [ %1, %3 ]
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skipws(FILE *in) {
  int ch;
  while (in) {
    ch = getc(in);
    if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') {
    } else {
      ungetc(ch, in);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<skipws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1186 <skipws+0x66>
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
je     116b <skipws+0x4b>
cmpl   $0x9,-0xc(%rbp)
je     116b <skipws+0x4b>
cmpl   $0xa,-0xc(%rbp)
je     116b <skipws+0x4b>
cmpl   $0xd,-0xc(%rbp)
jne    1170 <skipws+0x50>
jmp    1181 <skipws+0x61>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <ungetc@plt>
jmp    1186 <skipws+0x66>
jmp    112c <skipws+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipws>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1166 <skipws+0x46>
mov    %rdi,%rbx
movabs $0x100002600,%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    $0x20,%eax
ja     1155 <skipws+0x35>
mov    %eax,%ecx
bt     %rcx,%r14
jb     1140 <skipws+0x20>
mov    %eax,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ungetc@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @skipws(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %5
%4 = tail call i32 @getc(i32* %0)
switch i32 %4, label %6 [
i32 32, label %5
i32 13, label %5
i32 10, label %5
i32 9, label %5
]
5: ; preds = %3, %3, %3, %3
br label %3
6: ; preds = %3
%7 = tail call i32 @ungetc(i32 %4, i32* %0)
br label %8
8: ; preds = %1, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay(int);
int /*<<< orphan*/ Send(int, int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/, int /*<<< orphan*/);
main() {
  while (1) {
    Send(6, 0, 0, 0, 0);
    Delay(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6,%edi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <Send@plt>
mov    $0x1,%edi
call   1030 <Delay@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x6,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <Send@plt>
mov    $0x1,%edi
call   1030 <Delay@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @Send(i32 6, i32 0, i32 0, i32 0, i32 0)
%4 = call i32 @Delay(i32 1)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @Send(i32 6, i32 0, i32 0, i32 0, i32 0)
%3 = tail call i32 @Delay(i32 1)
br label %1
}
/* Variables and functions */
int getcury(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
int t_getcury() { return getcury(stdscr); }


x86 assembly (clang, -O0):
<t_getcury>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getcury@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_getcury>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getcury@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @t_getcury() {
%1 = load i32, i32* @stdscr
%2 = call i32 @getcury(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @t_getcury() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getcury(i32 %1)
ret i32 %2
}
double smaler(double x, double y) { return (x < y) ? x : y; }


x86 assembly (clang, -O0):
<smaler>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <smaler+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <smaler+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<smaler>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @smaler(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @smaler(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ mintaka_app_end();
void mintaka_app_end_() { mintaka_app_end(); }


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

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

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

LLVM IR (-O2):
define void @mintaka_app_end_() {
%1 = tail call i32 (...) @mintaka_app_end()
ret void
}
unsigned long long __udivdi3(unsigned long long num, unsigned long long den) {
  (void)num;
  (void)den;
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @__udivdi3(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 = load i64, i64* %4
ret i64 0
}

LLVM IR (-O2):
define i64 @__udivdi3(i64 %0, i64 %1) {
ret i64 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ SePError(char *);
int fork();
int SeFork() {
  pid_t pid;
  if ((pid = fork()) < 0)
    SePError("Faild to fork process");
  return pid;
}


x86 assembly (clang, -O0):
<SeFork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1147 <SeFork+0x27>
lea    0xebe(%rip),%rdi
call   1030 <SePError@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SeFork>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    113a <SeFork+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <SePError@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Faild to fork process\00"
define i32 @SeFork() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @SePError(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [22 x i8] c"Faild to fork process\00"
define i32 @SeFork() {
%1 = tail call i32 (...) @fork()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @SePError(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void addTitleElement(char *title) { printf("<H1>%s</H1>", title); }


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

x86 assembly (clang, -O2):
<addTitleElement>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"<H1>%s</H1>\00"
define void @addTitleElement(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"<H1>%s</H1>\00"
define void @addTitleElement(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void ADCDisable(unsigned long ulBase) {
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x1;
}


x86 assembly (clang, -O0):
<ADCDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCDisable>:
andq   $0xfffffffffffffffe,(%rdi)
ret

LLVM IR (-O0):
define void @ADCDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @ADCDisable(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -2
store volatile i64 %4, i64* %2
ret void
}
int iio_device_register_trigger_consumer(struct iio_dev *indio_dev) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @iio_device_register_trigger_consumer(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @iio_device_register_trigger_consumer(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void initial() { srandom(time(0)); }


x86 assembly (clang, -O0):
<initial>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initial>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srandom@plt>

LLVM IR (-O0):
define void @initial() {
%1 = call i32 @time(i32 0)
%2 = call i32 @srandom(i32 %1)
ret void
}

LLVM IR (-O2):
define void @initial() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @srandom(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *__fetch_name(int number) {
  fprintf(stderr, "ChillLib: fetch_name: no runtime system library linked.\n");
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<__fetch_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__fetch_name>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"ChillLib: fetch_name: no runtime system library linked.\0A\00"
define i8* @__fetch_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"ChillLib: fetch_name: no runtime system library linked.\0A\00"
define noalias i8* @__fetch_name(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int cbm_iec_poll(int f) { return ioctl(f, _IO(0xcb, 12)); }


x86 assembly (clang, -O0):
<cbm_iec_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcb,%edi
mov    $0xc,%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):
<cbm_iec_poll>:
push   %rbx
mov    %edi,%ebx
mov    $0xcb,%edi
mov    $0xc,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @cbm_iec_poll(i32 %0) {
%2 = tail call i32 @_IO(i32 203, i32 12)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
int islower(int c) {
  return ((unsigned char)c >= 'a') && ((unsigned char)c <= 'z');
}


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x5(%rbp)
jl     112a <islower+0x2a>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
movzbl %dil,%ecx
add    $0xffffff9f,%ecx
xor    %eax,%eax
cmp    $0x1a,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = and i32 %0, 255
%3 = add nsw i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
long lrintl(long double x) {
  long r;
  __asm__("fistpl %0" : "=m"(r) : "t"(x) : "st");
  return r;
}


x86 assembly (clang, -O0):
<lrintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fistpl -0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintl>:
fldt   0x8(%rsp)
fistpl -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @lrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @lrintl(x86_fp80 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ foobar(int);
int main() {
  foobar(2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <foobar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foobar(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foobar(i32 2)
ret i32 0
}
void encodeRGB3dI_C(unsigned char *in_array, unsigned char *out_array,
                    int height, int size, int bits, int bitsDone) {}


x86 assembly (clang, -O0):
<encodeRGB3dI_C>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @encodeRGB3dI_C(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ZowiTone(int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ delay(int);
void S_sad() {
  for (int i = 880; i > 659.26; i = i / 1.02) {
    ZowiTone(10, i, 20, 0);
    delay(250);
  }
}


x86 assembly (clang, -O0):
<S_sad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x370,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1181 <S_sad+0x61>
mov    -0x4(%rbp),%esi
mov    $0xa,%edi
mov    $0x14,%edx
xor    %ecx,%ecx
call   1030 <ZowiTone@plt>
mov    $0xfa,%edi
call   1040 <delay@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <S_sad+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_sad>:
push   %rax
mov    $0x370,%esi
cs nopw 0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
movsd  %xmm0,(%rsp)
mov    $0xa,%edi
mov    $0x14,%edx
xor    %ecx,%ecx
call   1030 <ZowiTone@plt>
mov    $0xfa,%edi
call   1040 <delay@plt>
movsd  (%rsp),%xmm0
divsd  0xe9c(%rip),%xmm0
cvttsd2si %xmm0,%esi
cmp    $0x293,%esi
jg     1130 <S_sad+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @S_sad() {
%1 = alloca i32
store i32 880, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to double
%5 = fcmp ogt double %4, 6.592600e+02
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @ZowiTone(i32 10, i32 %7, i32 20, i32 0)
%9 = call i32 @delay(i32 250)
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 1.020000e+00
%14 = fptosi double %13 to i32
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @S_sad() {
br label %2
1: ; preds = %2
ret void
2: ; preds = %0, %2
%3 = phi i32 [ 880, %0 ], [ %8, %2 ]
%4 = sitofp i32 %3 to double
%5 = tail call i32 @ZowiTone(i32 10, i32 %3, i32 20, i32 0)
%6 = tail call i32 @delay(i32 250)
%7 = fdiv double %4, 1.020000e+00
%8 = fptosi double %7 to i32
%9 = icmp sgt i32 %8, 659
br i1 %9, label %2, label %1
}
int test_imm_E3uint32_reg(unsigned int val) {
  return ((val) & (0xE3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E3uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E3uint32_reg(i32 %0) {
%2 = and i32 %0, 227
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((weak, section(".after_vectors"))) void UsageFault_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<UsageFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UsageFault_Handler+0x9>
jmp    1109 <UsageFault_Handler+0x9>

x86 assembly (clang, -O2):
<UsageFault_Handler>:
jmp    1100 <UsageFault_Handler>

LLVM IR (-O0):
define weak void @UsageFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @UsageFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int x = 10, y = 20, z;
  float m = 10.24, n = 9.68, o;
  z = y * x;
  o = m * n;
  printf("integer multiplication: %d\n", z);
  printf("floating point multiplication: %f\n", o);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"integer multiplication: %d\0A\00"
@.str.1 = [35 x i8] c"floating point multiplication: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
store float 0x40247AE140000000, float* %5
store float 0x40235C2900000000, float* %6
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %4
%11 = load float, float* %5
%12 = load float, float* %6
%13 = fmul float %11, %12
store float %13, float* %7
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to float
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float %15)
%17 = load float, float* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), float %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"integer multiplication: %d\0A\00"
@.str.1 = [35 x i8] c"floating point multiplication: %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float 2.000000e+02)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), float 0x4058C7E280000000)
ret i32 0
}
int main(void) {
  10.5 > 10;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  int j;
  i = __VERIFIER_nondet_int();
  j = __VERIFIER_nondet_int();
  while (i != j) {
    i = i - 1;
    j = j + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1156 <main+0x46>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
int abs(int x) {
  if (x < 0)
    return x * -1;
  return x;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <abs+0x1d>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1123 <abs+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}