xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *kino_MemMan_wrapped_calloc(size_t count, size_t size) {
  void *pointer = calloc(count, size);
  if (pointer == NULL && count != 0) {
    fprintf(stderr, "Out of memory.\n");
    exit(1);
  }
  return pointer;
}


x86 assembly (clang, -O0):
<kino_MemMan_wrapped_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1186 <kino_MemMan_wrapped_calloc+0x56>
cmpq   $0x0,-0x8(%rbp)
je     1186 <kino_MemMan_wrapped_calloc+0x56>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kino_MemMan_wrapped_calloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <calloc@plt>
test   %rbx,%rbx
je     1143 <kino_MemMan_wrapped_calloc+0x13>
test   %rax,%rax
je     1145 <kino_MemMan_wrapped_calloc+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define noalias i8* @kino_MemMan_wrapped_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %0, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct sd {
  int dummy;
};

/* Variables and functions */
scalar_t__ w9968cf_write_sb(struct sd *, int);
int w9968cf_smbus_write_nack(struct sd *sd) {
  int ret = 0;
  ret += w9968cf_write_sb(sd, 0x0013);
  ret += w9968cf_write_sb(sd, 0x0012);
  return ret;
}


x86 assembly (clang, -O0):
<w9968cf_smbus_write_nack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x13,%esi
call   1030 <w9968cf_write_sb@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x12,%esi
call   1030 <w9968cf_write_sb@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w9968cf_smbus_write_nack>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x13,%esi
call   1030 <w9968cf_write_sb@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x12,%esi
call   1030 <w9968cf_write_sb@plt>
add    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sd = type { i32 }
define i32 @w9968cf_smbus_write_nack(%struct.sd* %0) {
%2 = alloca %struct.sd*
%3 = alloca i32
store %struct.sd* %0, %struct.sd** %2
store i32 0, i32* %3
%4 = load %struct.sd*, %struct.sd** %2
%5 = call i64 @w9968cf_write_sb(%struct.sd* %4, i32 19)
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load %struct.sd*, %struct.sd** %2
%11 = call i64 @w9968cf_write_sb(%struct.sd* %10, i32 18)
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.sd = type { i32 }
define i32 @w9968cf_smbus_write_nack(%struct.sd* %0) {
%2 = tail call i64 @w9968cf_write_sb(%struct.sd* %0, i32 19)
%3 = tail call i64 @w9968cf_write_sb(%struct.sd* %0, i32 18)
%4 = add i64 %3, %2
%5 = trunc i64 %4 to i32
ret i32 %5
}
void rop3_213_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

x86 assembly (clang, -O2):
<rop3_213_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_213_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %6
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = trunc i32 %53 to i8
%55 = load i8*, i8** %4
store i8 %54, i8* %55
ret void
}

LLVM IR (-O2):
define void @rop3_213_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _strbuf_shrink(struct strbuf *, int /*<<< orphan*/);
void strbuf_shrink(struct strbuf *buf) { _strbuf_shrink(buf, 0); }


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

x86 assembly (clang, -O2):
<strbuf_shrink>:
xor    %esi,%esi
jmp    1030 <_strbuf_shrink@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define void @strbuf_shrink(%struct.strbuf* %0) {
%2 = alloca %struct.strbuf*
store %struct.strbuf* %0, %struct.strbuf** %2
%3 = load %struct.strbuf*, %struct.strbuf** %2
%4 = call i32 @_strbuf_shrink(%struct.strbuf* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define void @strbuf_shrink(%struct.strbuf* %0) {
%2 = tail call i32 @_strbuf_shrink(%struct.strbuf* %0, i32 0)
ret void
}
unsigned int H(unsigned int X, unsigned int Y, unsigned int Z) {
  return X ^ Y ^ Z;
}


x86 assembly (clang, -O0):
<H>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<H>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @H(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
void *make_sym_callable(void *ptr) { return ptr; }


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

x86 assembly (clang, -O2):
<make_sym_callable>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @make_sym_callable(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ svcPanic();
int unlink(char *name) { svcPanic(); }


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <svcPanic@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @unlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @svcPanic()
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @unlink(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @svcPanic()
ret i32 undef
}
/* Variables and functions */
char EOF;
char getchar();
void clean_buffer_keyboard(void) {
  char chr;
  do {
    chr = getchar();
  } while (chr != '\n' && chr != EOF);
}


x86 assembly (clang, -O0):
<clean_buffer_keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114a <clean_buffer_keyboard+0x3a>
movsbl -0x1(%rbp),%eax
mov    0x2ea9(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1118 <clean_buffer_keyboard+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_buffer_keyboard>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     112f <clean_buffer_keyboard+0x1f>
cmp    (%rbx),%al
jne    1120 <clean_buffer_keyboard+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @clean_buffer_keyboard() {
%1 = alloca i8
br label %2
2: ; preds = %14, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
br label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = load i8, i8* @EOF
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %10, %12
br label %14
14: ; preds = %8, %4
%15 = phi i1 [ false, %4 ], [ %13, %8 ]
br i1 %15, label %2, label %16
16: ; preds = %14
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @clean_buffer_keyboard() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp ne i8 %2, 10
%4 = load i8, i8* @EOF
%5 = icmp ne i8 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_ll_node_prop(void *data) {
  free(data);
  return;
}


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

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

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

LLVM IR (-O2):
define void @free_ll_node_prop(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void tty256(unsigned char r, unsigned char g, unsigned char b) {
  printf("\033[38;5;%dm", (r / 51) * 36 + (g / 51) * 6 + (b / 51) + 16);
}


x86 assembly (clang, -O0):
<tty256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x33,%ecx
cltd
idiv   %ecx
imul   $0x24,%eax,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
mov    $0x33,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0x6,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x3(%rbp),%eax
mov    $0x33,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%eax
lea    0xe8f(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty256>:
imul   $0xa1,%edi,%eax
shr    $0xb,%eax
and    $0xfffffffc,%eax
lea    (%rax,%rax,8),%eax
imul   $0xa1,%esi,%ecx
shr    $0xc,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,2),%ecx
imul   $0xa1,%edx,%edx
shr    $0xd,%edx
add    %al,%cl
add    %dl,%cl
add    $0x10,%cl
movzbl %cl,%esi
lea    0xeb8(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[38;5;%dm\00"
define void @tty256(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = sdiv i32 %8, 51
%10 = mul nsw i32 %9, 36
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = sdiv i32 %12, 51
%14 = mul nsw i32 %13, 6
%15 = add nsw i32 %10, %14
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = sdiv i32 %17, 51
%19 = add nsw i32 %15, %18
%20 = add nsw i32 %19, 16
%21 = trunc i32 %20 to i8
%22 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 zeroext %21)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[38;5;%dm\00"
define void @tty256(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = udiv i8 %0, 51
%5 = mul nuw i8 %4, 36
%6 = udiv i8 %1, 51
%7 = mul nuw nsw i8 %6, 6
%8 = udiv i8 %2, 51
%9 = add nuw i8 %5, 16
%10 = add nuw i8 %9, %7
%11 = add nuw i8 %10, %8
%12 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 zeroext %11)
ret void
}
long double percentile_index(const long long unsigned total_number,
                             const float percentage) {
  long double quantile = percentage;
  return (total_number + 1) * quantile - 1;
}


x86 assembly (clang, -O0):
<percentile_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
flds   -0xc(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
inc    %rax
mov    %rax,-0x28(%rbp)
sets   %al
movzbl %al,%eax
mov    %eax,%ecx
fildll -0x28(%rbp)
lea    0xed0(%rip),%rax
flds   (%rax,%rcx,4)
faddp  %st,%st(1)
fldt   -0x20(%rbp)
fmulp  %st,%st(1)
fld1
fchs
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<percentile_index>:
movss  %xmm0,-0xc(%rsp)
xor    %eax,%eax
inc    %rdi
mov    %rdi,-0x8(%rsp)
sets   %al
fildll -0x8(%rsp)
lea    0xee2(%rip),%rcx
fadds  (%rcx,%rax,4)
fmuls  -0xc(%rsp)
fld1
fchs
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @percentile_index(i64 %0, float %1) {
%3 = alloca i64
%4 = alloca float
%5 = alloca x86_fp80
store i64 %0, i64* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = fpext float %6 to x86_fp80
store x86_fp80 %7, x86_fp80* %5
%8 = load i64, i64* %3
%9 = add i64 %8, 1
%10 = uitofp i64 %9 to x86_fp80
%11 = load x86_fp80, x86_fp80* %5
%12 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %10, x86_fp80 %11, x86_fp80 0xKBFFF8000000000000000)
ret x86_fp80 %12
}

LLVM IR (-O2):
define x86_fp80 @percentile_index(i64 %0, float %1) {
%3 = fpext float %1 to x86_fp80
%4 = add i64 %0, 1
%5 = uitofp i64 %4 to x86_fp80
%6 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %5, x86_fp80 %3, x86_fp80 0xKBFFF8000000000000000)
ret x86_fp80 %6
}
/* Variables and functions */
int ui_select(int in) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ui_select(i32 %0) {
ret i32 1
}
void omap_set_fastboot_vars(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_set_fastboot_vars() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XClientMessageEvent;

/* Variables and functions */
void set_XClientMessageEvent_serial(void *_p, unsigned long _v) {
  ((XClientMessageEvent *)_p)->serial = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XClientMessageEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void crash_update(struct pt_regs *regs) {}


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @crash_update(%struct.pt_regs* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mpg123_delete(void *);
int /*<<< orphan*/ mpg123_exit();
void close_decoder(void *mpg) {
  mpg123_delete(mpg);
  mpg123_exit();
}


x86 assembly (clang, -O0):
<close_decoder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mpg123_delete@plt>
mov    $0x0,%al
call   1040 <mpg123_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @close_decoder(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mpg123_delete(i8* %3)
%5 = call i32 (...) @mpg123_exit()
ret void
}

LLVM IR (-O2):
define void @close_decoder(i8* %0) {
%2 = tail call i32 @mpg123_delete(i8* %0)
%3 = tail call i32 (...) @mpg123_exit()
ret void
}
/* Variables and functions */
scalar_t__ getpid();
scalar_t__ getppid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("The process id is %d\n", (int)getpid());
  printf("The parent process id is %d\n", (int)getppid());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"The process id is %d\0A\00"
@.str.1 = [29 x i8] c"The parent process id is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getpid()
%3 = trunc i64 %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i64 (...) @getppid()
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"The process id is %d\0A\00"
@.str.1 = [29 x i8] c"The parent process id is %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i64 (...) @getppid()
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
double sum_pixels(short unsigned int *img) {
  int i;
  double sum;
  for (i = 0; i < 1000000; i++) {
    sum += img[i];
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum_pixels>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xf4240,-0xc(%rbp)
jge    1144 <sum_pixels+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
cvtsi2sd %eax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sum_pixels+0xf>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_pixels>:
mov    $0x4,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzwl -0x8(%rdi,%rax,2),%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
movzwl -0x6(%rdi,%rax,2),%ecx
xorps  %xmm2,%xmm2
cvtsi2sd %ecx,%xmm2
addsd  %xmm0,%xmm1
movzwl -0x4(%rdi,%rax,2),%ecx
xorps  %xmm3,%xmm3
cvtsi2sd %ecx,%xmm3
addsd  %xmm1,%xmm2
movzwl -0x2(%rdi,%rax,2),%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
addsd  %xmm2,%xmm3
movzwl (%rdi,%rax,2),%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
addsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
add    $0x5,%rax
cmp    $0xf4244,%rax
jne    1110 <sum_pixels+0x10>
ret

LLVM IR (-O0):
define double @sum_pixels(i16* %0) {
%2 = alloca i16*
%3 = alloca i32
%4 = alloca double
store i16* %0, i16** %2
store i32 0, i32* %3
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1000000
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i16*, i16** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i16, i16* %9, i64 %11
%13 = load i16, i16* %12
%14 = zext i16 %13 to i32
%15 = sitofp i32 %14 to double
%16 = load double, double* %4
%17 = fadd double %16, %15
store double %17, double* %4
br label %18
18: ; preds = %8
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @sum_pixels(i16* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %29, %2 ]
%4 = phi double [ undef, %1 ], [ %28, %2 ]
%5 = getelementptr inbounds i16, i16* %0, i64 %3
%6 = load i16, i16* %5
%7 = uitofp i16 %6 to double
%8 = fadd double %4, %7
%9 = add nuw nsw i64 %3, 1
%10 = getelementptr inbounds i16, i16* %0, i64 %9
%11 = load i16, i16* %10
%12 = uitofp i16 %11 to double
%13 = fadd double %8, %12
%14 = add nuw nsw i64 %3, 2
%15 = getelementptr inbounds i16, i16* %0, i64 %14
%16 = load i16, i16* %15
%17 = uitofp i16 %16 to double
%18 = fadd double %13, %17
%19 = add nuw nsw i64 %3, 3
%20 = getelementptr inbounds i16, i16* %0, i64 %19
%21 = load i16, i16* %20
%22 = uitofp i16 %21 to double
%23 = fadd double %18, %22
%24 = add nuw nsw i64 %3, 4
%25 = getelementptr inbounds i16, i16* %0, i64 %24
%26 = load i16, i16* %25
%27 = uitofp i16 %26 to double
%28 = fadd double %23, %27
%29 = add nuw nsw i64 %3, 5
%30 = icmp eq i64 %29, 1000000
br i1 %30, label %31, label %2
31: ; preds = %2
ret double %28
}
/* Variables and functions */
int abs_xf(int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d", abs_xf(-5)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffb,%edi
call   1040 <abs_xf@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffb,%edi
call   1040 <abs_xf@plt>
lea    0xece(%rip),%rdi
mov    %eax,%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 = call i32 @abs_xf(i32 -5)
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @abs_xf(i32 -5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int A, B, SOMA;
  scanf("%d %d", &A, &B);
  SOMA = A + B;
  printf("SOMA = %d\n", SOMA);
  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
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"SOMA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
char *dgettext(int /*<<< orphan*/, char const *);
char *gettext(const char *msgid) { return dgettext(0, msgid); }


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

x86 assembly (clang, -O2):
<gettext>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <dgettext@plt>

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

LLVM IR (-O2):
define i8* @gettext(i8* %0) {
%2 = tail call i8* @dgettext(i32 0, i8* %0)
ret i8* %2
}
int test_imm_0Eint64_lowword_reg(long long val) {
  return ((val) & (0x0E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Eint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 14
%5 = icmp ne i64 %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_0Eint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 14
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("\a\n");
  printf("\c\n");
  printf("\d\n");
}


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"\07\00"
@str.3 = [2 x i8] c"c\00"
@str.4 = [2 x i8] c"d\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
int test_imm_78int16_mem(short *val) {
  return ((*val) & (0x78 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_78int16_mem>:
testb  $0x78,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_78int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 120
%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_78int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 120
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, float);
void formatFloat32(char *buffer, size_t size, char *format, float v) {
  snprintf(buffer, size, format, v);
}


x86 assembly (clang, -O0):
<formatFloat32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movss  -0x1c(%rbp),%xmm0
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<formatFloat32>:
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
define void @formatFloat32(i8* %0, i64 %1, i8* %2, float %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca float
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store float %3, float* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load float, float* %8
%13 = call i32 @snprintf(i8* %9, i64 %10, i8* %11, float %12)
ret void
}

LLVM IR (-O2):
define void @formatFloat32(i8* %0, i64 %1, i8* %2, float %3) {
%5 = tail call i32 @snprintf(i8* %0, i64 %1, i8* %2, float %3)
ret void
}
int utf8_has_8bits(const char *string) {
  while (string && string[0]) {
    if (string[0] & 0x80)
      return 1;
    string++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<utf8_has_8bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1128 <utf8_has_8bits+0x28>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1138 <utf8_has_8bits+0x38>
jmp    116a <utf8_has_8bits+0x6a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1159 <utf8_has_8bits+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1171 <utf8_has_8bits+0x71>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <utf8_has_8bits+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_has_8bits>:
xor    %eax,%eax
test   %rdi,%rdi
je     112f <utf8_has_8bits+0x2f>
mov    (%rdi),%cl
test   %cl,%cl
je     112f <utf8_has_8bits+0x2f>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %cl,%cl
js     1130 <utf8_has_8bits+0x30>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <utf8_has_8bits+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @utf8_has_8bits(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %9
6: ; preds = %9
%7 = load i8, i8* %13
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %3, %6
%10 = phi i8 [ %7, %6 ], [ %4, %3 ]
%11 = phi i8* [ %13, %6 ], [ %0, %3 ]
%12 = icmp sgt i8 %10, -1
%13 = getelementptr inbounds i8, i8* %11, i64 1
br i1 %12, label %6, label %14
14: ; preds = %6, %9, %3, %1
%15 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %9 ], [ 0, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test_private() {
  int i;
#pragma omp parallel
#pragma omp sections private(
  { foo(); }
#pragma omp parallel
#pragma omp sections private(,
  { foo(); }
#pragma omp parallel
#pragma omp sections private(, )
  { foo(); }
#pragma omp parallel
#pragma omp sections private()
  { foo(); }
#pragma omp parallel
#pragma omp sections private(int)
  { foo(); }
#pragma omp parallel
#pragma omp sections private(0)
  { foo(); }
  int x, y, z;
#pragma omp parallel
#pragma omp sections private(x)
  { foo(); }
#pragma omp parallel
#pragma omp sections private(x, y)
  { foo(); }
#pragma omp parallel
#pragma omp sections private(x, y, z)
  { foo(); }
}


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

x86 assembly (clang, -O2):
<test_private>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test_private() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @foo()
%6 = call i32 (...) @foo()
%7 = call i32 (...) @foo()
%8 = call i32 (...) @foo()
%9 = call i32 (...) @foo()
%10 = call i32 (...) @foo()
%11 = call i32 (...) @foo()
%12 = call i32 (...) @foo()
%13 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @test_private() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
%6 = tail call i32 (...) @foo()
%7 = tail call i32 (...) @foo()
%8 = tail call i32 (...) @foo()
%9 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LogErrno(char *);
scalar_t__ gethostname(char *, size_t);
int GetHostName(char *hostname_buf, size_t hostname_buflen) {
  if (gethostname(hostname_buf, hostname_buflen)) {
    LogErrno("gethostname");
    return 0;
  }
  hostname_buf[hostname_buflen - 1] = 0;
  return 1;
}


x86 assembly (clang, -O0):
<GetHostName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <gethostname@plt>
cmp    $0x0,%rax
je     115f <GetHostName+0x3f>
lea    0xeb2(%rip),%rdi
call   1030 <LogErrno@plt>
movl   $0x0,-0x4(%rbp)
jmp    1176 <GetHostName+0x56>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetHostName>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <gethostname@plt>
test   %rax,%rax
je     1144 <GetHostName+0x24>
lea    0xec5(%rip),%rdi
call   1030 <LogErrno@plt>
xor    %eax,%eax
jmp    114f <GetHostName+0x2f>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"gethostname\00"
define i32 @GetHostName(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i8*, i8** %4
%7 = load i64, i64* %5
%8 = call i64 @gethostname(i8* %6, i64 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @LogErrno(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %17
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = sub i64 %14, 1
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
store i32 1, i32* %3
br label %17
17: ; preds = %12, %10
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [12 x i8] c"gethostname\00"
define i32 @GetHostName(i8* %0, i64 %1) {
%3 = tail call i64 @gethostname(i8* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @LogErrno(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %2
%8 = add i64 %1, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ 0, %5 ], [ 1, %7 ]
ret i32 %11
}
int test_imm_56int64_lowword_reg(long long val) {
  return ((val) & (0x56 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_56int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 86
%5 = icmp ne i64 %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_56int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 86
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ getegid();
scalar_t__ geteuid();
scalar_t__ getgid();
scalar_t__ getuid();
int issetugid() { return (geteuid() != getuid() || getegid() != getgid()); }


x86 assembly (clang, -O0):
<issetugid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,%rdx
mov    $0x1,%al
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    1191 <issetugid+0x51>
mov    $0x0,%al
call   1060 <getegid@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <getgid@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issetugid>:
push   %rbx
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    %rcx,%rbx
jne    117b <issetugid+0x3b>
xor    %eax,%eax
call   1060 <getegid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getgid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @issetugid() {
%1 = call i64 (...) @geteuid()
%2 = call i64 (...) @getuid()
%3 = icmp ne i64 %1, %2
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = call i64 (...) @getegid()
%6 = call i64 (...) @getgid()
%7 = icmp ne i64 %5, %6
br label %8
8: ; preds = %4, %0
%9 = phi i1 [ true, %0 ], [ %7, %4 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @issetugid() {
%1 = tail call i64 (...) @geteuid()
%2 = tail call i64 (...) @getuid()
%3 = icmp eq i64 %1, %2
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i64 (...) @getegid()
%6 = tail call i64 (...) @getgid()
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ 1, %0 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  (void)fprintf(stderr, "write: Invalid communications protocol\n");
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"write: Invalid communications protocol\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"write: Invalid communications protocol\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double __dsind(double);
double d_sind(double *x) { return __dsind(*x); }


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

x86 assembly (clang, -O2):
<d_sind>:
movsd  (%rdi),%xmm0
jmp    1030 <__dsind@plt>

LLVM IR (-O0):
define double @d_sind(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call double @__dsind(double %4)
ret double %5
}

LLVM IR (-O2):
define double @d_sind(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @__dsind(double %2)
ret double %3
}
void setStyle(int style) {}


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

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

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

LLVM IR (-O2):
define void @setStyle(i32 %0) {
ret void
}
/* Variables and functions */
unsigned int REG_SPI_BASE(unsigned int);
__attribute__((always_)) __attribute__((flatten)) unsigned int
SPI_EXT0(unsigned int i) {
  return (REG_SPI_BASE(i) + 0xf0);
}


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

x86 assembly (clang, -O2):
<SPI_EXT0>:
push   %rax
call   1030 <REG_SPI_BASE@plt>
add    $0xf0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SPI_EXT0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @REG_SPI_BASE(i32 %3)
%5 = add i32 %4, 240
ret i32 %5
}

LLVM IR (-O2):
define i32 @SPI_EXT0(i32 %0) {
%2 = tail call i32 @REG_SPI_BASE(i32 %0)
%3 = add i32 %2, 240
ret i32 %3
}