xunge/DecIR huggingface dataset:
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_note {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_unref(struct i8x_object *);
struct i8x_note *__attribute__((always_)) i8x_note_unref(struct i8x_note *x) {
  return (struct i8x_note *)i8x_ob_unref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_note_unref>:
jmp    1030 <i8x_ob_unref@plt>

LLVM IR (-O0):
%struct.i8x_note = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_note* @i8x_note_unref(%struct.i8x_note* %0) {
%2 = alloca %struct.i8x_note*
store %struct.i8x_note* %0, %struct.i8x_note** %2
%3 = load %struct.i8x_note*, %struct.i8x_note** %2
%4 = bitcast %struct.i8x_note* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_unref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_note*
ret %struct.i8x_note* %6
}

LLVM IR (-O2):
%struct.i8x_note = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_note* @i8x_note_unref(%struct.i8x_note* %0) {
%2 = bitcast %struct.i8x_note* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_unref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_note*
ret %struct.i8x_note* %4
}
void gtk_color_selection_set_change_palette_with_screen_hook() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_set_change_palette_with_screen_hook() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_enterexit_func(char *, char *, char const *);
void log_exit_ecall(const char *func) {
  log_enterexit_func("exit", "ecall", func);
}


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

x86 assembly (clang, -O2):
<log_exit_ecall>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee4(%rip),%rsi
jmp    1030 <log_enterexit_func@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"exit\00"
@.str.1 = [6 x i8] c"ecall\00"
define void @log_exit_ecall(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_enterexit_func(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
@.str.1 = [6 x i8] c"ecall\00"
define void @log_exit_ecall(i8* %0) {
%2 = tail call i32 @log_enterexit_func(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t buffer_resolverInit(void) {}


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

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

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

LLVM IR (-O2):
define i32 @buffer_resolverInit() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fclose(void *);
void stdio_file_handler_close(void *file) { fclose(file); }


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

x86 assembly (clang, -O2):
<stdio_file_handler_close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @stdio_file_handler_close(i8* nocapture %0) {
%2 = tail call i32 @fclose(i8* %0)
ret void
}
int isgraph(int c) { return (((c) <= (0x7e)) && ((c) >= (0x21))); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x7e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1120 <isgraph+0x20>
cmpl   $0x21,-0x4(%rbp)
setge  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
long maxl(long int a, long int b) {
  if (a > b)
    return (a);
  else
    return (b);
}


x86 assembly (clang, -O0):
<maxl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <maxl+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <maxl+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxl>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @maxl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp sgt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %13
11: ; preds = %2
%12 = load i64, i64* %5
store i64 %12, i64* %3
br label %13
13: ; preds = %11, %9
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @maxl(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ remove_ptr(void *);
void _memory_free(void *ptr) {
  remove_ptr(ptr);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<_memory_free>:
push   %rbx
mov    %rdi,%rbx
call   1030 <remove_ptr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>

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

LLVM IR (-O2):
define void @_memory_free(i8* %0) {
%2 = tail call i32 @remove_ptr(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t null_disk_flags(int drive) { return 0x09; }


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

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

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

LLVM IR (-O2):
define i32 @null_disk_flags(i32 %0) {
ret i32 9
}
int Cyc_NewControlFlow_hash_ptr(void *s) { return (int)s; }


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

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

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

LLVM IR (-O2):
define i32 @Cyc_NewControlFlow_hash_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
void rb_dispose_double(double *obj_val) {
  if (obj_val) {
    *obj_val = 0.0;
  }
}


x86 assembly (clang, -O0):
<rb_dispose_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111e <rb_dispose_double+0x1e>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_dispose_double>:
test   %rdi,%rdi
je     110c <rb_dispose_double+0xc>
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @rb_dispose_double(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = icmp ne double* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double*, double** %2
store double 0.000000e+00, double* %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @rb_dispose_double(double* writeonly %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store double 0.000000e+00, double* %0
br label %4
4: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblock_ref_is_one() {
  printf("NOT IMPLEMENTED:"
         "pa_memblock_ref_is_one"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_memblock_ref_is_one\00"
define i32 @pa_memblock_ref_is_one() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned char inb(unsigned int);
int /*<<< orphan*/ outb(unsigned char, unsigned int);
int smbus_ack(unsigned smbus_io_base, int state) {
  unsigned char val = inb(smbus_io_base + 0x03);
  outb(val | (0x01 << 4), smbus_io_base + 0x03);
  return 0;
}


x86 assembly (clang, -O0):
<smbus_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x3,%edi
call   1040 <inb@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
or     $0x10,%eax
mov    -0x4(%rbp),%esi
add    $0x3,%esi
movzbl %al,%edi
call   1030 <outb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_ack>:
push   %rbx
lea    0x3(%rdi),%ebx
mov    %ebx,%edi
call   1040 <inb@plt>
or     $0x10,%al
movzbl %al,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @smbus_ack(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 3
%8 = call zeroext i8 @inb(i32 %7)
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = or i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = load i32, i32* %3
%14 = add i32 %13, 3
%15 = call i32 @outb(i8 zeroext %12, i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @smbus_ack(i32 %0, i32 %1) {
%3 = add i32 %0, 3
%4 = tail call zeroext i8 @inb(i32 %3)
%5 = or i8 %4, 16
%6 = tail call i32 @outb(i8 zeroext %5, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xtoa(unsigned long, char *, int, int);
char *ltoa(long val, char *buf, int radix) {
  xtoa((unsigned long)val, buf, radix, (radix == 10 && val < 0));
  return buf;
}


x86 assembly (clang, -O0):
<ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jne    1153 <ltoa+0x43>
cmpq   $0x0,-0x8(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
call   1030 <xtoa@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoa>:
push   %rbx
mov    %rsi,%rbx
cmp    $0xa,%edx
sete   %al
test   %rdi,%rdi
sets   %cl
and    %al,%cl
movzbl %cl,%ecx
call   1030 <xtoa@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i64, i64* %4
%14 = icmp slt i64 %13, 0
br label %15
15: ; preds = %12, %3
%16 = phi i1 [ false, %3 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i32 @xtoa(i64 %7, i8* %8, i32 %9, i32 %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @ltoa(i64 %0, i8* returned %1, i32 %2) {
%4 = icmp eq i32 %2, 10
%5 = icmp slt i64 %0, 0
%6 = and i1 %5, %4
%7 = zext i1 %6 to i32
%8 = tail call i32 @xtoa(i64 %0, i8* %1, i32 %2, i32 %7)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
unsigned char *dh_compute_shared_key(unsigned char *shared,
                                     const unsigned char *pub, size_t pub_size,
                                     const unsigned char *priv,
                                     size_t priv_size) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<dh_compute_shared_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dh_compute_shared_key>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @dh_compute_shared_key(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @dh_compute_shared_key(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i8* nocapture readnone %3, i64 %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i8* null
}
/* Variables and functions */
unsigned int f17(unsigned int);
unsigned int f18(unsigned int a) { return f17(f17(a)); }


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

x86 assembly (clang, -O2):
<f18>:
push   %rax
call   1030 <f17@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f17@plt>

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

LLVM IR (-O2):
define i32 @f18(i32 %0) {
%2 = tail call i32 @f17(i32 %0)
%3 = tail call i32 @f17(i32 %2)
ret i32 %3
}
char BCD22CHAR(char input) { return ((input >> 4) * 10) + (input & 0x0F); }


x86 assembly (clang, -O0):
<BCD22CHAR>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%eax
movsbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BCD22CHAR>:
mov    %edi,%eax
sar    $0x4,%al
movzbl %al,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%dil
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @BCD22CHAR(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = mul nsw i32 %5, 10
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = and i32 %8, 15
%10 = add nsw i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @BCD22CHAR(i8 signext %0) {
%2 = ashr i8 %0, 4
%3 = mul nsw i8 %2, 10
%4 = and i8 %0, 15
%5 = add nsw i8 %3, %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void fatal(char *s) {
  printf("FATAL ERROR: %s\n", s);
  exit(10);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"FATAL ERROR: %s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 10)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"FATAL ERROR: %s\0A\00"
define void @fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 10)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_REVOKEDINFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_REVOKEDINFO_it;
int i2d_OCSP_REVOKEDINFO(OCSP_REVOKEDINFO *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &OCSP_REVOKEDINFO_it);
}


x86 assembly (clang, -O0):
<i2d_OCSP_REVOKEDINFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_OCSP_REVOKEDINFO>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@OCSP_REVOKEDINFO_it = global i32 0
define i32 @i2d_OCSP_REVOKEDINFO(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @OCSP_REVOKEDINFO_it)
ret i32 %7
}

LLVM IR (-O2):
@OCSP_REVOKEDINFO_it = global i32 0
define i32 @i2d_OCSP_REVOKEDINFO(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @OCSP_REVOKEDINFO_it)
ret i32 %3
}
char *PbReallocPbCb(pbIn, cb)
char *pbIn;
unsigned cb;
{
  char *pbOut;
  if ((pbOut = (char *)realloc(pbIn, cb)) == 0)
    Error("out of memory in PbReallocPbCb (%d)", cb);
  return pbOut;
}


x86 assembly (clang, -O0):
<PbReallocPbCb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115c <PbReallocPbCb+0x3c>
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <Error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PbReallocPbCb>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %esi,%esi
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1144 <PbReallocPbCb+0x24>
lea    0xec5(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <Error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"out of memory in PbReallocPbCb (%d)\00"
define i8* @PbReallocPbCb(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @realloc(i8* %6, i64 %8)
store i8* %9, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @Error to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [36 x i8] c"out of memory in PbReallocPbCb (%d)\00"
define i8* @PbReallocPbCb(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = tail call i8* @realloc(i8* %0, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @Error to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
void *test_anti_range_133(int n) {
  extern void *alloc_anti_range_133(int) __attribute__((alloc_size(1)));
  if ((-0x7fffffff - 1) + 2 <= n && n <= 2)
    n = (-0x7fffffff - 1) + 2 - 1;
  return alloc_anti_range_133(n);
}


x86 assembly (clang, -O0):
<test_anti_range_133>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80000002,%eax
cmp    -0x4(%rbp),%eax
jg     113a <test_anti_range_133+0x2a>
cmpl   $0x2,-0x4(%rbp)
jg     113a <test_anti_range_133+0x2a>
movl   $0x80000001,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_133@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_133>:
lea    0x7ffffffe(%rdi),%eax
cmp    $0x80000001,%eax
mov    $0x80000001,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_133@plt>

LLVM IR (-O0):
define i8* @test_anti_range_133(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 -2147483646, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -2147483647, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_133(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_133(i32 %0) {
%2 = add i32 %0, 2147483646
%3 = icmp ult i32 %2, -2147483647
%4 = select i1 %3, i32 -2147483647, i32 %0
%5 = tail call i8* @alloc_anti_range_133(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("no siema\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"no siema\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float cos_32s(float x) {
  static const float c1 = 0.99940307;
  static const float c2 = -0.49558072;
  static const float c3 = 0.03679168;
  float x2;
  x2 = x * x;
  return (c1 + x2 * (c2 + c3 * x2));
}


x86 assembly (clang, -O0):
<cos_32s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xeda(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xed2(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xeba(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_32s>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xeec(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
@cos_32s.c1 = internal constant float 0x3FEFFB1C20000000
@cos_32s.c2 = internal constant float 0xBFDFB79840000000
@cos_32s.c3 = internal constant float 0x3FA2D65BE0000000
define float @cos_32s(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = load float, float* %3
%9 = call float @llvm.fmuladd.f32(float 0x3FA2D65BE0000000, float %8, float 0xBFDFB79840000000)
%10 = call float @llvm.fmuladd.f32(float %7, float %9, float 0x3FEFFB1C20000000)
ret float %10
}

LLVM IR (-O2):
define float @cos_32s(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float 0x3FA2D65BE0000000, float 0xBFDFB79840000000)
%4 = tail call float @llvm.fmuladd.f32(float %2, float %3, float 0x3FEFFB1C20000000)
ret float %4
}
/* Variables and functions */
#define EOF 128
int /*<<< orphan*/ error(char *);
int getchar();
int /*<<< orphan*/ putchar(int);
void do_destringify(void) {
  int c;
  for (;;) {
    switch (c = getchar()) {
    case '"':
      return;
    case EOF:
      error("syntax error: EOF inside @\"..\"");
      break;
    default:
      putchar(c);
    }
  }
}


x86 assembly (clang, -O0):
<do_destringify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x22,%eax
je     1168 <do_destringify+0x38>
jmp    1155 <do_destringify+0x25>
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
je     116e <do_destringify+0x3e>
jmp    117f <do_destringify+0x4f>
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe8b(%rip),%rdi
call   1050 <error@plt>
jmp    1187 <do_destringify+0x57>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    1138 <do_destringify+0x8>

x86 assembly (clang, -O2):
<do_destringify>:
push   %rbx
lea    0xec8(%rip),%rbx
jmp    1148 <do_destringify+0x18>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <error@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x80,%eax
je     1140 <do_destringify+0x10>
cmp    $0x22,%eax
je     1164 <do_destringify+0x34>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1148 <do_destringify+0x18>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"syntax error: EOF inside @\22..\22\00"
define void @do_destringify() {
%1 = alloca i32
br label %2
2: ; preds = %10, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
switch i32 %3, label %7 [
i32 34, label %4
i32 128, label %5
]
4: ; preds = %2
ret void
5: ; preds = %2
%6 = call i32 @error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = call i32 @putchar(i32 %8)
br label %10
10: ; preds = %7, %5
br label %2
}

LLVM IR (-O2):
@.str = [31 x i8] c"syntax error: EOF inside @\22..\22\00"
define void @do_destringify() {
br label %1
1: ; preds = %8, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %6 [
i32 34, label %3
i32 128, label %4
]
3: ; preds = %1
ret void
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 @putchar(i32 %2)
br label %8
8: ; preds = %6, %4
br label %1
}
float f(float x) { return x * x * x - x * x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
subss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @f(float %0) {
%2 = fmul float %0, %0
%3 = fneg float %2
%4 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %3)
ret float %4
}
void RTSemMutexRequestDebug(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemMutexRequestDebug() {
ret void
}
/* Variables and functions */
int Hash_generate(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
unsigned _hashatom(const char *key) { return Hash_generate(key, strlen(key)); }


x86 assembly (clang, -O0):
<_hashatom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <Hash_generate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hashatom>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <Hash_generate@plt>

LLVM IR (-O0):
define i32 @_hashatom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @Hash_generate(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @_hashatom(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @Hash_generate(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void main() { barrier(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @barrier()
ret void
}
void vfw_shutdown() { int i; }


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

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

LLVM IR (-O0):
define void @vfw_shutdown() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @vfw_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *, char *, int /*<<< orphan*/);
void int_01(void) { panic("Debug Error", "#DB", 0); }


x86 assembly (clang, -O0):
<int_01>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
xor    %edx,%edx
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_01>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %edx,%edx
jmp    1030 <panic@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Debug Error\00"
@.str.1 = [4 x i8] c"#DB\00"
define void @int_01() {
%1 = call i32 @panic(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Debug Error\00"
@.str.1 = [4 x i8] c"#DB\00"
define void @int_01() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_batch_context_recv_status_on_client_details() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_batch_context_recv_status_on_client_details>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_recv_status_on_client_details() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_recv_status_on_client_details() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printBuffer(char *buffer, size_t length) {
  for (size_t i = 0; i < length; i++) {
    printf("%c", buffer[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <printBuffer+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printBuffer+0x18>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBuffer>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <printBuffer+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printBuffer+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printBuffer(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i64, i64* %5
%19 = add i64 %18, 1
store i64 %19, i64* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printBuffer(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %12, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw i64 %7, 1
%13 = icmp eq i64 %12, %1
br i1 %13, label %4, label %6
}
int bar(int x, int y) {
  if ((~x & y) > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    1128 <bar+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <bar+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
not    %edi
xor    %eax,%eax
test   %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = xor i32 %6, -1
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = and i32 %3, %1
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, double);
int write_devattr(char const *, char *);
int write_devattr_double(const char *attr, double value) {
  char buf[100];
  snprintf(buf, 100, "%f", value);
  return write_devattr(attr, buf);
}


x86 assembly (clang, -O0):
<write_devattr_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    $0x64,%esi
lea    0xeb7(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <write_devattr@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_devattr_double>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
lea    0xecf(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x64,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <write_devattr@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @write_devattr_double(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [100 x i8]
store i8* %0, i8** %3
store double %1, double* %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = load double, double* %4
%8 = call i32 @snprintf(i8* %6, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @write_devattr(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @write_devattr_double(i8* %0, double %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %1)
%6 = call i32 @write_devattr(i8* %0, i8* %4)
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t pred_comma(char c) {
  if (c == ',')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<pred_comma>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
jne    1123 <pred_comma+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <pred_comma+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pred_comma>:
xor    %eax,%eax
cmp    $0x2c,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @pred_comma(i8 signext %0) {
%2 = icmp eq i8 %0, 44
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void bitArrayClr(void *array, unsigned bit) {
  (((uint32_t *)array)[(bit) / (sizeof(((uint32_t *)array)[0]) * 8)] &=
   ~(1 << ((bit) % (sizeof(((uint32_t *)array)[0]) * 8))));
}


x86 assembly (clang, -O0):
<bitArrayClr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%rax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x5,%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitArrayClr>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
shr    $0x5,%ecx
and    %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @bitArrayClr(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 = zext i32 %5 to i64
%7 = urem i64 %6, 32
%8 = trunc i64 %7 to i32
%9 = shl i32 1, %8
%10 = xor i32 %9, -1
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %4
%14 = zext i32 %13 to i64
%15 = udiv i64 %14, 32
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i32, i32* %16
%18 = and i32 %17, %10
store i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @bitArrayClr(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = xor i32 %4, -1
%6 = bitcast i8* %0 to i32*
%7 = lshr i32 %1, 5
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = and i32 %10, %5
store i32 %11, i32* %9
ret void
}
unsigned int inw(short port) {
  unsigned short ret = 0;
  __asm__ volatile("inw %1,%0" : "=a"(ret) : "d"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @inw(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
store i16 0, i16* %3
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @inw(i16 signext %0) {
%2 = tail call i16 asm sideeffect "inw $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = zext i16 %2 to i32
ret i32 %3
}
void dsp_enable_flush_denormal_to_zero() {
  unsigned int mxcsr;
  mxcsr = __builtin_ia32_stmxcsr();
  __builtin_ia32_ldmxcsr(mxcsr | 0x8040);
}


x86 assembly (clang, -O0):
<dsp_enable_flush_denormal_to_zero>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
stmxcsr (%rax)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x8040,%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rax
ldmxcsr (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsp_enable_flush_denormal_to_zero>:
stmxcsr -0x4(%rsp)
mov    $0x8040,%eax
or     -0x4(%rsp),%eax
mov    %eax,-0x8(%rsp)
ldmxcsr -0x8(%rsp)
ret

LLVM IR (-O0):
define void @dsp_enable_flush_denormal_to_zero() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = or i32 %6, 32832
store i32 %7, i32* %3
%8 = bitcast i32* %3 to i8*
ret void
}

LLVM IR (-O2):
define void @dsp_enable_flush_denormal_to_zero() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = load i32, i32* %1
%5 = or i32 %4, 32832
store i32 %5, i32* %2
%6 = bitcast i32* %2 to i8*
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ err_fatal(char *);
int Close(int fd) {
  int n;
  n = close(fd);
  if (n == -1) {
    err_fatal("ERROR. close() failed");
  }
  return 0;
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    114c <Close+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <err_fatal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rax
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1137 <Close+0x17>
lea    0xece(%rip),%rdi
call   1040 <err_fatal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"ERROR. close() failed\00"
define i32 @Close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err_fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"ERROR. close() failed\00"
define i32 @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err_fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void *worker(void *ptr) {
  puts("Hello World");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i8* @worker(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define noalias i8* @worker(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ log_external_fragmentation();
int /*<<< orphan*/ log_internal_fragmentation();
scalar_t__ memory_alloc(size_t);
int /*<<< orphan*/ memory_init();
void *malloc(size_t size) {
  static int init_flag = 0;
  if (!init_flag) {
    init_flag = 1;
    memory_init();
  }
  log_internal_fragmentation();
  log_external_fragmentation();
  return (void *)memory_alloc((size_t)size);
}


x86 assembly (clang, -O0):
<malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2ef1(%rip)
jne    116a <malloc+0x2a>
movl   $0x1,0x2ee1(%rip)
mov    $0x0,%al
call   1030 <memory_init@plt>
mov    $0x0,%al
call   1050 <log_internal_fragmentation@plt>
mov    $0x0,%al
call   1040 <log_external_fragmentation@plt>
mov    -0x8(%rbp),%rdi
call   1060 <memory_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,0x2ef9(%rip)
jne    115b <malloc+0x1b>
movb   $0x1,0x2ef0(%rip)
xor    %eax,%eax
call   1030 <memory_init@plt>
xor    %eax,%eax
call   1050 <log_internal_fragmentation@plt>
xor    %eax,%eax
call   1040 <log_external_fragmentation@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <memory_alloc@plt>

LLVM IR (-O0):
@malloc.init_flag = internal global i32 0
define i8* @malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @malloc.init_flag
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
store i32 1, i32* @malloc.init_flag
%6 = call i32 (...) @memory_init()
br label %7
7: ; preds = %5, %1
%8 = call i32 (...) @log_internal_fragmentation()
%9 = call i32 (...) @log_external_fragmentation()
%10 = load i64, i64* %2
%11 = call i64 @memory_alloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
@malloc.init_flag = internal unnamed_addr global i1 false
define i8* @malloc(i64 %0) {
%2 = load i1, i1* @malloc.init_flag
br i1 %2, label %5, label %3
3: ; preds = %1
store i1 true, i1* @malloc.init_flag
%4 = tail call i32 (...) @memory_init()
br label %5
5: ; preds = %3, %1
%6 = tail call i32 (...) @log_internal_fragmentation()
%7 = tail call i32 (...) @log_external_fragmentation()
%8 = tail call i64 @memory_alloc(i64 %0)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}