xunge/DecIR huggingface dataset:
/* Variables and functions */
int EOF;
int read(int, char *, int);
int getchar(void) {
  char c = '\00';
  int r = read(1, &c, 1);
  if (r < 0)
    return r;
  if (r == 0)
    return -EOF;
  return c;
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1144 <getchar+0x34>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <getchar+0x58>
cmpl   $0x0,-0xc(%rbp)
jne    1161 <getchar+0x51>
xor    %eax,%eax
mov    0x2e91(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <getchar+0x58>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <read@plt>
test   %eax,%eax
js     1135 <getchar+0x25>
je     1137 <getchar+0x27>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret
mov    0x2eaa(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @getchar() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i8 0, i8* %2
%4 = call i32 @read(i32 1, i8* %2, i32 1)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* %3
store i32 %8, i32* %1
br label %18
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* @EOF
%14 = sub nsw i32 0, %13
store i32 %14, i32* %1
br label %18
15: ; preds = %9
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
store i32 %17, i32* %1
br label %18
18: ; preds = %15, %12, %7
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @getchar() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @read(i32 1, i8* %1, i32 1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %0
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = load i32, i32* @EOF
%8 = sub nsw i32 0, %7
br label %12
9: ; preds = %4
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
br label %12
12: ; preds = %0, %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ], [ %2, %0 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, int);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  int jari_jari;
  float luas_lingkaran;
  const float pi = 3.14;
  jari_jari = 10;
  luas_lingkaran = pi * jari_jari * jari_jari;
  printf("Luas Lingkaran = %.2f untuk jari-jari = %i \n\n", luas_lingkaran,
         jari_jari);
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xec2(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0xa,-0x14(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm1
movss  0xea9(%rip),%xmm0
mulss  %xmm1,%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
mov    -0x14(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
movss  0xed0(%rip),%xmm0
mov    $0xa,%esi
call   1040 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Luas Lingkaran = %.2f untuk jari-jari = %i \0A\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x40091EB860000000, float* %8
store i32 10, i32* %6
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to float
%11 = fmul float 0x40091EB860000000, %10
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to float
%14 = fmul float %11, %13
store float %14, float* %7
%15 = load float, float* %7
%16 = load i32, i32* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), float %15, i32 %16)
%18 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"Luas Lingkaran = %.2f untuk jari-jari = %i \0A\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), float 3.140000e+02, i32 10)
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EAGAIN;
int EWOULDBLOCK;
bool is_wouldblock(int err) { return (err == EAGAIN) || (err == EWOULDBLOCK); }


x86 assembly (clang, -O0):
<is_wouldblock>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ebd(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1130 <is_wouldblock+0x30>
mov    -0x4(%rbp),%eax
mov    0x2eb8(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_wouldblock>:
mov    0x2ec9(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2ecd(%rip),%rcx
cmp    %edi,(%rcx)
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@EAGAIN = global i32 0
@EWOULDBLOCK = global i32 0
define i32 @is_wouldblock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EAGAIN
%5 = icmp eq i32 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @EWOULDBLOCK
%9 = icmp eq i32 %7, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@EAGAIN = global i32 0
@EWOULDBLOCK = global i32 0
define i32 @is_wouldblock(i32 %0) {
%2 = load i32, i32* @EAGAIN
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @EWOULDBLOCK
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void term(status) int status;
{
  stats();
  exit(status);
}


x86 assembly (clang, -O0):
<term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <stats@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<term>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <stats@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @term(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @stats()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @term(i32 %0) {
%2 = tail call i32 (...) @stats()
tail call void @exit(i32 %0)
unreachable
}
int is_digit(const char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int getpagesize(void) { return 4096; }


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

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

LLVM IR (-O0):
define i32 @getpagesize() {
ret i32 4096
}

LLVM IR (-O2):
define i32 @getpagesize() {
ret i32 4096
}
__attribute__((always_)) void
tracepoint_update_probe_range(struct tracepoint *begin,
                              struct tracepoint *end) {}


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

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

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

LLVM IR (-O2):
%struct.tracepoint = type opaque
define void @tracepoint_update_probe_range(%struct.tracepoint* nocapture %0, %struct.tracepoint* nocapture %1) {
ret void
}
/* Variables and functions */
int japi_canvas(int, int, int);
int j_canvas(int arg0, int arg1, int arg2) {
  return (japi_canvas(arg0, arg1, arg2));
}


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

x86 assembly (clang, -O2):
<j_canvas>:
jmp    1030 <japi_canvas@plt>

LLVM IR (-O0):
define i32 @j_canvas(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @japi_canvas(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @j_canvas(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @japi_canvas(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_ctx {
  int dummy;
};
struct i8x_chunk {
  int dummy;
};

/* Variables and functions */
struct i8x_ctx *i8x_ob_get_ctx(struct i8x_object *);
struct i8x_ctx *__attribute__((always_))
i8x_chunk_get_ctx(struct i8x_chunk *x) {
  return i8x_ob_get_ctx((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_chunk_get_ctx>:
jmp    1030 <i8x_ob_get_ctx@plt>

LLVM IR (-O0):
%struct.i8x_ctx = type { i32 }
%struct.i8x_chunk = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_chunk_get_ctx(%struct.i8x_chunk* %0) {
%2 = alloca %struct.i8x_chunk*
store %struct.i8x_chunk* %0, %struct.i8x_chunk** %2
%3 = load %struct.i8x_chunk*, %struct.i8x_chunk** %2
%4 = bitcast %struct.i8x_chunk* %3 to %struct.i8x_object*
%5 = call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %4)
ret %struct.i8x_ctx* %5
}

LLVM IR (-O2):
%struct.i8x_ctx = type { i32 }
%struct.i8x_chunk = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_chunk_get_ctx(%struct.i8x_chunk* %0) {
%2 = bitcast %struct.i8x_chunk* %0 to %struct.i8x_object*
%3 = tail call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %2)
ret %struct.i8x_ctx* %3
}
/* Variables and functions */
int /*<<< orphan*/ lcd_op(char, int, int);
void lcd_write(char c) { lcd_op(c, 0x1, 0x1); }


x86 assembly (clang, -O0):
<lcd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
movsbl -0x1(%rbp),%edi
mov    %edx,%esi
call   1030 <lcd_op@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @lcd_write(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @lcd_op(i8 signext %3, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @lcd_write(i8 signext %0) {
%2 = tail call i32 @lcd_op(i8 signext %0, i32 1, i32 1)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int y_root;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xkey_y_root(void *_p, int _v) {
  ((XEvent *)_p)->xkey.y_root = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xkey_y_root>:
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):
<set_XEvent_xkey_y_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xkey_y_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xkey_y_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void defOnAccountDomainInfo(char *domainInfo, int len) {
  FILE *fp;
  if ((fp = fopen("/tmp/ez-ipupd.domainif", "w")) != 0) {
    fprintf(fp, "%s\n", domainInfo);
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<defOnAccountDomainInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     117d <defOnAccountDomainInfo+0x4d>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defOnAccountDomainInfo>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1173 <defOnAccountDomainInfo+0x43>
mov    %rax,%rbx
lea    0xec0(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/tmp/ez-ipupd.domainif\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @defOnAccountDomainInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %5
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32*, i32** %5
%10 = load i8*, i8** %3
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %5
%13 = call i32 @fclose(i32* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"/tmp/ez-ipupd.domainif\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @defOnAccountDomainInfo(i8* %0, i32 %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %5, %2
ret void
}
float clamp(float value, float low, float high) {
  float answer;
  if (value < low) {
    answer = low;
  } else if (value > high) {
    answer = high;
  } else {
    answer = value;
  }
  return answer;
}


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,-0x10(%rbp)
jmp    1162 <clamp+0x62>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <clamp+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    115d <clamp+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1162 <clamp+0x62>
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define float @clamp(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ free_mem(char *);
void free_str(const char *pstr) {
  if (pstr && *pstr) {
    free_mem((char *)pstr);
  }
}


x86 assembly (clang, -O0):
<free_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <free_str+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <free_str+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <free_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_str>:
test   %rdi,%rdi
je     111f <free_str+0xf>
cmpb   $0x0,(%rdi)
je     111f <free_str+0xf>
jmp    1030 <free_mem@plt>
ret

LLVM IR (-O0):
define void @free_str(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 %13
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = call i32 @free_mem(i8* %11)
br label %13
13: ; preds = %10, %5, %1
ret void
}

LLVM IR (-O2):
define void @free_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free_mem(i8* %0)
br label %8
8: ; preds = %6, %3, %1
ret void
}
test_8(int code) {
  _Bool temp = testit();
  _Bool rotate = (code == 22);
  if (temp == 0 || !rotate)
    oof();
}


x86 assembly (clang, -O0):
<test_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <testit@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x9(%rbp)
cmpl   $0x16,-0x8(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0xa(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     1164 <test_8+0x44>
testb  $0x1,-0xa(%rbp)
jne    116b <test_8+0x4b>
mov    $0x0,%al
call   1040 <oof@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_8>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <testit@plt>
cmp    $0x16,%ebx
jne    1135 <test_8+0x15>
test   %eax,%eax
je     1135 <test_8+0x15>
pop    %rbx
ret
xor    %eax,%eax
call   1040 <oof@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %3
%6 = call i32 (...) @testit()
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i8
store i8 %8, i8* %4
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 22
%11 = zext i1 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %4
%13 = trunc i8 %12 to i1
%14 = zext i1 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %1
%17 = load i8, i8* %5
%18 = trunc i8 %17 to i1
br i1 %18, label %21, label %19
19: ; preds = %16, %1
%20 = call i32 (...) @oof()
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @test_8(i32 %0) {
%2 = tail call i32 (...) @testit()
%3 = icmp ne i32 %2, 0
%4 = icmp eq i32 %0, 22
%5 = and i1 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @oof()
br label %8
8: ; preds = %1, %6
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, numi;
  scanf("\n%d", &num);
  numi = num * num;
  printf("\n%d", numi);
  numi = numi * num;
  printf("\n%d", numi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
imul   %ebp,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
imul   0x4(%rsp),%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %5
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
void init_rqueue_mutex() {}


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

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

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

LLVM IR (-O2):
define void @init_rqueue_mutex() {
ret void
}
/* Variables and functions */
char *getenv(char *);
char *getlogin(void) { return (getenv("LOGNAME")); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"LOGNAME\00"
define i8* @getlogin() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ default_cpu_header(char const *, int);
void default_cstate_cpu_header(const char *cpu,
                               __attribute__((unused)) void *report_data) {
  default_cpu_header(cpu, 80);
}


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

x86 assembly (clang, -O2):
<default_cstate_cpu_header>:
mov    $0x50,%esi
jmp    1030 <default_cpu_header@plt>

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

LLVM IR (-O2):
define void @default_cstate_cpu_header(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @default_cpu_header(i8* %0, i32 80)
ret void
}
int HelpItem166(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem166() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void display(char ch[]) {
  printf("String Output: ");
  puts(ch);
}


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

x86 assembly (clang, -O2):
<display>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"String Output: \00"
define void @display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"String Output: \00"
define void @display(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
double hello() {
  printf("Hello Worls");
  return 13.42;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
movsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello Worls\00"
define double @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret double 1.342000e+01
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello Worls\00"
define double @hello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret double 1.342000e+01
}
unsigned int kgsl_get_alloc_size(__attribute__((unused)) int detailed) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @kgsl_get_alloc_size(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ matNf_setColumn(float *, float const *, int const, int);
void mat4f_setColumn(float matrix[16], const float v[4], const int col) {
  matNf_setColumn(matrix, v, col, 4);
}


x86 assembly (clang, -O0):
<mat4f_setColumn>:
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
mov    $0x4,%ecx
call   1030 <matNf_setColumn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4f_setColumn>:
mov    $0x4,%ecx
jmp    1030 <matNf_setColumn@plt>

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

LLVM IR (-O2):
define void @mat4f_setColumn(float* %0, float* %1, i32 %2) {
%4 = tail call i32 @matNf_setColumn(float* %0, float* %1, i32 %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terminal_writestring(char *);
void shell_command_help(int argc, char *argv[]) {
  terminal_writestring("Syntax: help <prikaz>\n");
  terminal_writestring("clear -> Vycisti obrazovku\n");
}


x86 assembly (clang, -O0):
<shell_command_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <terminal_writestring@plt>
lea    0xee5(%rip),%rdi
call   1030 <terminal_writestring@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"Syntax: help <prikaz>\0A\00"
@.str.1 = [28 x i8] c"clear -> Vycisti obrazovku\0A\00"
define void @shell_command_help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @terminal_writestring(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @terminal_writestring(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Syntax: help <prikaz>\0A\00"
@.str.1 = [28 x i8] c"clear -> Vycisti obrazovku\0A\00"
define void @shell_command_help(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @terminal_writestring(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @terminal_writestring(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a, b = 3;
  a = (b + 1) * b + 1;
  printf("%d", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
imul   -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%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
mov    $0xd,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}
int test_imm_E4int64_highword_reg(long long val) {
  return ((val >> 32) & (0xE4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E4int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 228
%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_E4int64_highword_reg(i64 %0) {
%2 = and i64 %0, 979252543488
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  if (i)
    ;
  ++i;
  assert(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112e <main+0x1e>
jmp    112e <main+0x1e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 undef)
ret i32 0
}
int test_imm_F0uint8_mem(unsigned char *val) {
  return ((*val) & (0xF0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F0uint8_mem>:
cmpb   $0x10,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F0uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 240
%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_F0uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 16
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float lerp(float v0, float v1, float t) { return v0 + (v1 - v0) * t; }


x86 assembly (clang, -O0):
<lerp>:
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
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %4, float %2, float %0)
ret float %5
}
int char_lt(int c1, int c2) { return c1 < c2; }


x86 assembly (clang, -O0):
<char_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_lt>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @char_lt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @char_lt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void mainLoop() {
  for (;;)
    sleep(1);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<mainLoop>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <mainLoop+0x9>
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1119 <mainLoop+0x9>

x86 assembly (clang, -O2):
<mainLoop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <mainLoop+0x10>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @mainLoop() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @mainLoop() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sleep(i32 1)
br label %1
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
long int create_seed(void) {
  long int gseed;
  struct timeval tval;
  if (gettimeofday(&tval, NULL) < 0) {
    perror("get time of day");
    return 1;
  }
  gseed = tval.tv_sec * tval.tv_usec;
  return gseed;
}


x86 assembly (clang, -O0):
<create_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    1158 <create_seed+0x38>
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
movq   $0x1,-0x8(%rbp)
jmp    116d <create_seed+0x4d>
mov    -0x20(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_seed>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     1145 <create_seed+0x25>
mov    0x10(%rsp),%rax
imul   0x8(%rsp),%rax
add    $0x18,%rsp
ret
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [16 x i8] c"get time of day\00"
define i64 @create_seed() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca %struct.timeval
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i64 1, i64* %1
br label %15
8: ; preds = %0
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%12 = load i64, i64* %11
%13 = mul nsw i64 %10, %12
store i64 %13, i64* %2
%14 = load i64, i64* %2
store i64 %14, i64* %1
br label %15
15: ; preds = %8, %6
%16 = load i64, i64* %1
ret i64 %16
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [16 x i8] c"get time of day\00"
define i64 @create_seed() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = mul nsw i64 %11, %9
br label %13
13: ; preds = %7, %5
%14 = phi i64 [ 1, %5 ], [ %12, %7 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ SetMotor(int /*<<< orphan*/, int);
int /*<<< orphan*/ SetMotors(int /*<<< orphan*/);
int /*<<< orphan*/ SetTime(int);
int /*<<< orphan*/ random(int /*<<< orphan*/, int);
int pulse(int seq) {
  if (seq % 2)
    SetMotors(0);
  else
    SetMotor(random(0, 3), 144);
  SetTime(70);
  return 1;
}


x86 assembly (clang, -O0):
<pulse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116b <pulse+0x2b>
xor    %edi,%edi
call   1030 <SetMotors@plt>
jmp    1183 <pulse+0x43>
xor    %edi,%edi
mov    $0x3,%esi
call   1050 <random@plt>
mov    %eax,%edi
mov    $0x90,%esi
call   1040 <SetMotor@plt>
mov    $0x46,%edi
call   1060 <SetTime@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pulse>:
push   %rax
test   $0x1,%dil
jne    1161 <pulse+0x21>
xor    %edi,%edi
mov    $0x3,%esi
call   1050 <random@plt>
mov    %eax,%edi
mov    $0x90,%esi
call   1040 <SetMotor@plt>
jmp    1168 <pulse+0x28>
xor    %edi,%edi
call   1030 <SetMotors@plt>
mov    $0x46,%edi
call   1060 <SetTime@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pulse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @SetMotors(i32 0)
br label %11
8: ; preds = %1
%9 = call i32 @random(i32 0, i32 3)
%10 = call i32 @SetMotor(i32 %9, i32 144)
br label %11
11: ; preds = %8, %6
%12 = call i32 @SetTime(i32 70)
ret i32 1
}

LLVM IR (-O2):
define i32 @pulse(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @SetMotors(i32 0)
br label %9
6: ; preds = %1
%7 = tail call i32 @random(i32 0, i32 3)
%8 = tail call i32 @SetMotor(i32 %7, i32 144)
br label %9
9: ; preds = %6, %4
%10 = tail call i32 @SetTime(i32 70)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int main(void) {
  printf("Test of pthread_exit() in main thread only.\n");
  pthread_exit(NULL);
  printf("You shouldn't see this.");
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <pthread_exit@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Test of pthread_exit() in main thread only.\0A\00"
@.str.1 = [24 x i8] c"You shouldn't see this.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @pthread_exit(i32* null)
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"You shouldn't see this.\00"
@str = [44 x i8] c"Test of pthread_exit() in main thread only.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @pthread_exit(i32* null)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
void ff_hevc_put_hevc_bi_w_qpel_v8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v8_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void *e_malloc(size_t size) {
  void *a = malloc(size);
  if (a == NULL) {
    fprintf(stderr, "Error: malloc: %s\n", strerror(errno));
    exit(1);
  }
  return a;
}


x86 assembly (clang, -O0):
<e_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    119a <e_malloc+0x5a>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe75(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_malloc>:
push   %rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     114d <e_malloc+0xd>
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Error: malloc: %s\0A\00"
@errno = global i32 0
define i8* @e_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* @errno
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Error: malloc: %s\0A\00"
@errno = global i32 0
define noalias i8* @e_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret i8* %2
}