xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  char const **we_wordv;
};
typedef TYPE_1__ wordexp_t;

/* Variables and functions */
const char *chpl_wordexp_index(const wordexp_t wexp, size_t i) {
  return wexp.we_wordv[i];
}


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

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

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

LLVM IR (-O2):
define i8* @chpl_wordexp_index(i8** nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8*, i8** %0, i64 %1
%4 = load i8*, i8** %3
ret i8* %4
}
int reset() {
  int j = 0;
  return (j);
}


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

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

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

LLVM IR (-O2):
define i32 @reset() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CompileOffset(int, int);
void DoFieldC(void) { CompileOffset(1, 51); }


x86 assembly (clang, -O0):
<DoFieldC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x33,%esi
call   1030 <CompileOffset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoFieldC>:
mov    $0x1,%edi
mov    $0x33,%esi
jmp    1030 <CompileOffset@plt>

LLVM IR (-O0):
define void @DoFieldC() {
%1 = call i32 @CompileOffset(i32 1, i32 51)
ret void
}

LLVM IR (-O2):
define void @DoFieldC() {
%1 = tail call i32 @CompileOffset(i32 1, i32 51)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RotShift_instr(int);
void SRL(void) { RotShift_instr(7); }


x86 assembly (clang, -O0):
<SRL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <RotShift_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SRL>:
mov    $0x7,%edi
jmp    1030 <RotShift_instr@plt>

LLVM IR (-O0):
define void @SRL() {
%1 = call i32 @RotShift_instr(i32 7)
ret void
}

LLVM IR (-O2):
define void @SRL() {
%1 = tail call i32 @RotShift_instr(i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ match(char);
void constants() { match('c'); }


x86 assembly (clang, -O0):
<constants>:
push   %rbp
mov    %rsp,%rbp
mov    $0x63,%edi
call   1030 <match@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<constants>:
mov    $0x63,%edi
jmp    1030 <match@plt>

LLVM IR (-O0):
define void @constants() {
%1 = call i32 @match(i8 signext 99)
ret void
}

LLVM IR (-O2):
define void @constants() {
%1 = tail call i32 @match(i8 signext 99)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ehrpwm_reg_config(int /*<<< orphan*/, int, unsigned char,
                                     int);
int ehrpwm_tb_set_periodload(uint8_t module, unsigned char loadmode) {
  if (loadmode > 0x1)
    return -1;
  ehrpwm_reg_config(module, 0x0, loadmode << 0x3, (1 << 3));
  return 0;
}


x86 assembly (clang, -O0):
<ehrpwm_tb_set_periodload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jle    113a <ehrpwm_tb_set_periodload+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <ehrpwm_tb_set_periodload+0x4a>
mov    -0x8(%rbp),%edi
movzbl -0x9(%rbp),%eax
shl    $0x3,%eax
xor    %esi,%esi
mov    $0x8,%ecx
movzbl %al,%edx
call   1030 <ehrpwm_reg_config@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehrpwm_tb_set_periodload>:
push   %rbx
mov    $0xffffffff,%ebx
cmp    $0x1,%sil
ja     1132 <ehrpwm_tb_set_periodload+0x22>
shl    $0x3,%sil
movzbl %sil,%edx
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x8,%ecx
call   1030 <ehrpwm_reg_config@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ehrpwm_tb_set_periodload(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %17
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 3
%15 = trunc i32 %14 to i8
%16 = call i32 @ehrpwm_reg_config(i32 %11, i32 0, i8 zeroext %15, i32 8)
store i32 0, i32* %3
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @ehrpwm_tb_set_periodload(i32 %0, i8 zeroext %1) {
%3 = icmp ugt i8 %1, 1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = shl nuw nsw i8 %1, 3
%6 = tail call i32 @ehrpwm_reg_config(i32 %0, i32 0, i8 zeroext %5, i32 8)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %8
}
int cairo_code_draw_casChLabel_get_height() { return 10; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casChLabel_get_height() {
ret i32 10
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casChLabel_get_height() {
ret i32 10
}
void free_3d_int(int ***iii) {
  free(iii[0][0]);
  free(iii[0]);
  free(iii);
}


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

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

LLVM IR (-O0):
define void @free_3d_int(i32*** %0) {
%2 = alloca i32***
store i32*** %0, i32**** %2
%3 = load i32***, i32**** %2
%4 = getelementptr inbounds i32**, i32*** %3, i64 0
%5 = load i32**, i32*** %4
%6 = getelementptr inbounds i32*, i32** %5, i64 0
%7 = load i32*, i32** %6
%8 = bitcast i32* %7 to i8*
%9 = load i32***, i32**** %2
%10 = getelementptr inbounds i32**, i32*** %9, i64 0
%11 = load i32**, i32*** %10
%12 = bitcast i32** %11 to i8*
%13 = load i32***, i32**** %2
%14 = bitcast i32*** %13 to i8*
ret void
}

LLVM IR (-O2):
define void @free_3d_int(i32*** nocapture %0) {
%2 = bitcast i32*** %0 to i8***
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
%5 = bitcast i32*** %0 to i8**
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = bitcast i32*** %0 to i8*
tail call void @free(i8* %7)
ret void
}
/* Variables and functions */
char *getenv(char *);
char *check_env(char *primary, char *secondary, char *def) {
  char *res;
  res = getenv(primary);
  if (!res)
    res = getenv(secondary);
  return (res ? res : def);
}


x86 assembly (clang, -O0):
<check_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1149 <check_env+0x39>
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1161 <check_env+0x51>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1169 <check_env+0x59>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_env>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
call   1030 <getenv@plt>
test   %rax,%rax
jne    112c <check_env+0x1c>
mov    %r14,%rdi
call   1030 <getenv@plt>
test   %rax,%rax
cmovne %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @check_env(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i8* @getenv(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = call i8* @getenv(i8* %13)
store i8* %14, i8** %7
br label %15
15: ; preds = %12, %3
%16 = load i8*, i8** %7
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = load i8*, i8** %7
br label %22
20: ; preds = %15
%21 = load i8*, i8** %6
br label %22
22: ; preds = %20, %18
%23 = phi i8* [ %19, %18 ], [ %21, %20 ]
ret i8* %23
}

LLVM IR (-O2):
define i8* @check_env(i8* nocapture %0, i8* nocapture %1, i8* readnone %2) {
%4 = tail call i8* @getenv(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i8* @getenv(i8* %1)
br label %8
8: ; preds = %6, %3
%9 = phi i8* [ %4, %3 ], [ %7, %6 ]
%10 = icmp eq i8* %9, null
%11 = select i1 %10, i8* %2, i8* %9
ret i8* %11
}
void iobench_start() {}


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

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

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

LLVM IR (-O2):
define void @iobench_start() {
ret void
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  int /*<<< orphan*/ next_key;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_GET_NEXT_KEY;
int /*<<< orphan*/ __NR_bpf;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_get_next_key(int fd, void *key, void *next_key) {
  union bpf_attr attr = {
      .map_fd = fd,
      .key = ptr_to_u64(key),
      .next_key = ptr_to_u64(next_key),
  };
  return syscall(__NR_bpf, BPF_MAP_GET_NEXT_KEY, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_get_next_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_get_next_key>:
push   %rax
mov    %rdx,%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_MAP_GET_NEXT_KEY = global i32 0
define i32 @bpf_get_next_key(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast %union.bpf_attr* %7 to i32*
%9 = load i8*, i8** %6
%10 = call i32 @ptr_to_u64(i8* %9)
store i32 %10, i32* %8
%11 = load i32, i32* @__NR_bpf
%12 = load i32, i32* @BPF_MAP_GET_NEXT_KEY
%13 = call i32 @syscall(i32 %11, i32 %12, %union.bpf_attr* %7, i32 4)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_MAP_GET_NEXT_KEY = global i32 0
define i32 @bpf_get_next_key(i32 %0, i8* nocapture readnone %1, i8* %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
%7 = tail call i32 @ptr_to_u64(i8* %2)
store i32 %7, i32* %6
%8 = load i32, i32* @__NR_bpf
%9 = load i32, i32* @BPF_MAP_GET_NEXT_KEY
%10 = call i32 @syscall(i32 %8, i32 %9, %union.bpf_attr* %4, i32 4)
ret i32 %10
}
int charcmp(const void *a, const void *b) {
  char *x = (char *)a;
  char *y = (char *)b;
  if (*x > *y)
    return 1;
  return *x == *y ? 0 : -1;
}


x86 assembly (clang, -O0):
<charcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x28(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    113e <charcmp+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    115b <charcmp+0x5b>
mov    -0x20(%rbp),%rax
movsbl (%rax),%edx
mov    -0x28(%rbp),%rax
movsbl (%rax),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
xor    %edx,%edx
cmp    %cl,%al
setne  %dl
neg    %edx
cmp    %cl,%al
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @charcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
%6 = icmp ne i8 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
unsigned int pal_dma_start_to_device(void *dma_source_buf, unsigned int length,
                                     void *host, void *target,
                                     unsigned int timeout) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pal_dma_start_to_device(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emulate_usr(int /*<<< orphan*/);
int /*<<< orphan*/ eval_intfactor();
int /*<<< orphan*/ push_int(int /*<<< orphan*/);
void fn_usr(void) { push_int(emulate_usr(eval_intfactor())); }


x86 assembly (clang, -O0):
<fn_usr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <eval_intfactor@plt>
mov    %eax,%edi
call   1030 <emulate_usr@plt>
mov    %eax,%edi
call   1050 <push_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_usr>:
push   %rax
xor    %eax,%eax
call   1040 <eval_intfactor@plt>
mov    %eax,%edi
call   1030 <emulate_usr@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <push_int@plt>

LLVM IR (-O0):
define void @fn_usr() {
%1 = call i32 (...) @eval_intfactor()
%2 = call i32 @emulate_usr(i32 %1)
%3 = call i32 @push_int(i32 %2)
ret void
}

LLVM IR (-O2):
define void @fn_usr() {
%1 = tail call i32 (...) @eval_intfactor()
%2 = tail call i32 @emulate_usr(i32 %1)
%3 = tail call i32 @push_int(i32 %2)
ret void
}
short f6(short a, unsigned short b) {
  unsigned c;
  return __builtin_mul_overflow(a, b, &c);
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswq -0x2(%rbp),%rdx
movzwl -0x4(%rbp),%eax
imul   %rax,%rdx
xor    %eax,%eax
mov    %edx,%ecx
shr    $0x20,%rdx
and    $0x1,%edx
or     %dl,%al
mov    %ecx,-0x8(%rbp)
and    $0x1,%al
movzbl %al,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
movslq %edi,%rcx
mov    %esi,%eax
imul   %rcx,%rax
shr    $0x20,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define signext i16 @f6(i16 signext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = load i16, i16* %4
%8 = sext i16 %6 to i33
%9 = zext i16 %7 to i33
%10 = call { i33, i1 } @llvm.smul.with.overflow.i33(i33 %8, i33 %9)
%11 = extractvalue { i33, i1 } %10, 1
%12 = extractvalue { i33, i1 } %10, 0
%13 = trunc i33 %12 to i32
%14 = zext i32 %13 to i33
%15 = icmp ne i33 %12, %14
%16 = or i1 %11, %15
store i32 %13, i32* %5
%17 = zext i1 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define signext i16 @f6(i16 signext %0, i16 zeroext %1) {
%3 = sext i16 %0 to i33
%4 = zext i16 %1 to i33
%5 = mul nsw i33 %4, %3
%6 = lshr i33 %5, 32
%7 = trunc i33 %6 to i16
ret i16 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _mm_crc32_u32(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t rte_hash_crc_4byte(uint32_t data, uint32_t init_val) {
  return _mm_crc32_u32(init_val, data);
}


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

x86 assembly (clang, -O2):
<rte_hash_crc_4byte>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <_mm_crc32_u32@plt>

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

LLVM IR (-O2):
define i32 @rte_hash_crc_4byte(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_crc32_u32(i32 %1, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int ibufclean(FILE *in) {
  int c, i;
  for (i = 0; (((c = fgetc(in)) != '\n') && (c != EOF)); i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<ibufclean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     1151 <ibufclean+0x41>
mov    -0xc(%rbp),%eax
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1161 <ibufclean+0x51>
jmp    1174 <ibufclean+0x64>
jmp    1166 <ibufclean+0x56>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <ibufclean+0x13>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibufclean>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    0x2ec4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    $0x1,%ebx
cmp    $0xa,%eax
je     1145 <ibufclean+0x35>
cmp    (%r15),%eax
jne    1130 <ibufclean+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @ibufclean(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
store i32 %7, i32* %3
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ false, %5 ], [ %12, %9 ]
br i1 %14, label %15, label %19
15: ; preds = %13
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @ibufclean(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = tail call i32 @fgetc(i32* %0)
%5 = icmp ne i32 %4, 10
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %4, %6
%8 = select i1 %5, i1 %7, i1 false
%9 = add nuw nsw i32 %3, 1
br i1 %8, label %2, label %10
10: ; preds = %2
ret i32 %3
}
signed char calculaColorMedio(unsigned char *pixel) {
  unsigned media = (*pixel + *(pixel + 1) + *(pixel + 2)) / 3;
  return (unsigned char)media;
}


x86 assembly (clang, -O0):
<calculaColorMedio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculaColorMedio>:
movzbl (%rdi),%eax
movzbl 0x1(%rdi),%ecx
add    %eax,%ecx
movzbl 0x2(%rdi),%eax
add    %ecx,%eax
imul   $0xaaab,%eax,%eax
shr    $0x11,%eax
ret

LLVM IR (-O0):
define signext i8 @calculaColorMedio(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add nsw i32 %6, %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = add nsw i32 %11, %15
%17 = sdiv i32 %16, 3
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @calculaColorMedio(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = add nuw nsw i16 %6, %3
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i16
%11 = add nuw nsw i16 %7, %10
%12 = udiv i16 %11, 3
%13 = trunc i16 %12 to i8
ret i8 %13
}
void foo302(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo302(i32 %0) {
ret void
}
void mx31_gpio_set(unsigned int gpio, unsigned int value) {}


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

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

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

LLVM IR (-O2):
define void @mx31_gpio_set(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn000000014000193C();
void fn0000000140001290() {
  fn000000014000193C();
  return;
}


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

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

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

LLVM IR (-O2):
define void @fn0000000140001290() {
%1 = tail call i32 (...) @fn000000014000193C()
ret void
}
/* Variables and functions */
int Fin_Cmnd(int /*<<< orphan*/, char, unsigned char *);
int Fin_Buzzer(int msec, int freq) {
  unsigned char IoBuffer[9];
  int res;
  IoBuffer[2] = (char)(msec >> 8);
  IoBuffer[3] = (char)(msec);
  IoBuffer[4] = (char)(freq >> 8);
  IoBuffer[5] = (char)(freq);
  res = Fin_Cmnd(0, 'B', IoBuffer);
  return (res);
}


x86 assembly (clang, -O0):
<Fin_Buzzer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0xf(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xc(%rbp)
lea    -0x11(%rbp),%rdx
xor    %edi,%edi
mov    $0x42,%esi
call   1030 <Fin_Cmnd@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fin_Buzzer>:
sub    $0x18,%rsp
mov    %esi,%eax
mov    %edi,%ecx
mov    %ch,0x11(%rsp)
mov    %cl,0x12(%rsp)
mov    %ah,0x13(%rsp)
mov    %al,0x14(%rsp)
lea    0xf(%rsp),%rdx
xor    %edi,%edi
mov    $0x42,%esi
call   1030 <Fin_Cmnd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @Fin_Buzzer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [9 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 2
store i8 %9, i8* %10
%11 = load i32, i32* %3
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 3
store i8 %12, i8* %13
%14 = load i32, i32* %4
%15 = ashr i32 %14, 8
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 4
store i8 %16, i8* %17
%18 = load i32, i32* %4
%19 = trunc i32 %18 to i8
%20 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 5
store i8 %19, i8* %20
%21 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%22 = call i32 @Fin_Cmnd(i32 0, i8 signext 66, i8* %21)
store i32 %22, i32* %6
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @Fin_Buzzer(i32 %0, i32 %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 2
store i8 %6, i8* %7
%8 = trunc i32 %0 to i8
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 3
store i8 %8, i8* %9
%10 = lshr i32 %1, 8
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 4
store i8 %11, i8* %12
%13 = trunc i32 %1 to i8
%14 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 5
store i8 %13, i8* %14
%15 = call i32 @Fin_Cmnd(i32 0, i8 signext 66, i8* %4)
ret i32 %15
}
unsigned long long f2(unsigned long long x) {
  if (x < 0x8000000000000000ULL)
    x = 0x8000000000000000ULL;
  return x;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000000,%rax
cmp    %rax,-0x8(%rbp)
jae    112a <f2+0x2a>
movabs $0x8000000000000000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movabs $0x8000000000000000,%rax
cmp    %rax,%rdi
cmova  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @f2(i64 %0) {
%2 = icmp ugt i64 %0, -9223372036854775808
%3 = select i1 %2, i64 %0, i64 -9223372036854775808
ret i64 %3
}
int test_imm_6Duint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x6D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Duint64_midword_reg>:
test   $0x6d0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Duint64_midword_reg(i64 %0) {
%2 = and i64 %0, 7143424
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
void tr_onError(int error, char *errtext, char *lastchars) {
  printf("onError( %d, %s ) @ %s\n", error, errtext, lastchars);
}


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

x86 assembly (clang, -O2):
<tr_onError>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"onError( %d, %s ) @ %s\0A\00"
define void @tr_onError(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"onError( %d, %s ) @ %s\0A\00"
define void @tr_onError(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2)
ret void
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printksize(off_t size) {
  if (size != 0 && size / 1024 == 0)
    printf("   1K ");
  else
    printf("%4lldK ", (long long)size / 1024);
}


x86 assembly (clang, -O0):
<printksize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <printksize+0x3c>
mov    -0x4(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    114c <printksize+0x3c>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116b <printksize+0x5b>
movslq -0x4(%rbp),%rax
mov    $0x400,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printksize>:
lea    0x3ff(%rdi),%eax
test   %edi,%edi
je     112f <printksize+0x1f>
cmp    $0x7fe,%eax
ja     112f <printksize+0x1f>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
test   %edi,%edi
cmovns %edi,%eax
sar    $0xa,%eax
movslq %eax,%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" 1K \00"
@.str.1 = [8 x i8] c"%4lldK \00"
define void @printksize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 1024
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %16
11: ; preds = %5, %1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = sdiv i64 %13, 1024
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c" 1K \00"
@.str.1 = [8 x i8] c"%4lldK \00"
define void @printksize(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = add i32 %0, 1023
%4 = icmp ult i32 %3, 2047
%5 = and i1 %2, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = sdiv i32 %0, 1024
%10 = sext i32 %9 to i64
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %8, %6
ret void
}
/* Variables and functions */
int write(int, char *, int);
int _write(int fd, char *buffer, int count) { return write(fd, buffer, count); }


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
double sqrt(double);
double foo(double x) { return 1.0 / sqrt(x); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1121 <foo+0x11>
sqrtsd %xmm0,%xmm0
jmp    1126 <foo+0x16>
call   1030 <sqrt@plt>
movsd  0xed2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @foo(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ client_close(int /*<<< orphan*/);
int /*<<< orphan*/ rsp_client_close();
void gdb_close() {
  rsp_client_close();
  client_close('0');
}


x86 assembly (clang, -O0):
<gdb_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rsp_client_close@plt>
mov    $0x30,%edi
call   1030 <client_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_close>:
push   %rax
xor    %eax,%eax
call   1040 <rsp_client_close@plt>
mov    $0x30,%edi
pop    %rax
jmp    1030 <client_close@plt>

LLVM IR (-O0):
define void @gdb_close() {
%1 = call i32 (...) @rsp_client_close()
%2 = call i32 @client_close(i32 48)
ret void
}

LLVM IR (-O2):
define void @gdb_close() {
%1 = tail call i32 (...) @rsp_client_close()
%2 = tail call i32 @client_close(i32 48)
ret void
}
int syscall1(int syscall, int arg) {
  int ret;
  __asm__("movl %[syscall],%%eax\n\t"
          "movl %[arg],%%ebx\n\t"
          "int $0x80\n\t"
          "movl %%eax,%[ret]\n\t"
          : [ret] "=r"(ret)
          : [syscall] "m"(syscall), [arg] "m"(arg)
          : "eax", "ebx");
  return ret;
}


x86 assembly (clang, -O0):
<syscall1>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
int    $0x80
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall1>:
push   %rbx
mov    %edi,-0x4(%rsp)
mov    %esi,-0x8(%rsp)
mov    -0x4(%rsp),%eax
mov    -0x8(%rsp),%ebx
int    $0x80
mov    %eax,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @syscall1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 asm "movl $1,%eax\0A\09movl $2,%ebx\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,*m,~{eax},~{ebx},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %3, i32* elementtype(i32) %4)
store i32 %6, i32* %5
%7 = load i32, i32* %5
ret i32 %7
}

LLVM IR (-O2):
define i32 @syscall1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 asm "movl $1,%eax\0A\09movl $2,%ebx\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,*m,~{eax},~{ebx},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %3, i32* elementtype(i32) %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ runtimeError(char *);
double *dvector(long nl, long nh) {
  double *v;
  v = (double *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(double)));
  if (!v)
    runtimeError("allocation failure in dvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <dvector+0x44>
lea    0xea1(%rip),%rdi
call   1040 <runtimeError@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <dvector+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <runtimeError@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @runtimeError(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = getelementptr inbounds double, double* %22, i64 1
ret double* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @runtimeError(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sub i64 0, %0
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = getelementptr inbounds double, double* %13, i64 1
ret double* %14
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  putchar(401);
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffff91,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @putchar(i8 signext -111)
%2 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext -111)
%2 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int CBoolChars(char *Src) {
  if (!strcmp(Src, "true"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<CBoolChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <CBoolChars+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <CBoolChars+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CBoolChars>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
define i32 @CBoolChars(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
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):
@.str = [5 x i8] c"true\00"
define i32 @CBoolChars(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ iqzz_block(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *);
int main(void) {
  int32_t in[16];
  int32_t out[16];
  uint8_t quantif[16];
  iqzz_block(in, out, quantif);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0xd0(%rbp),%rdx
call   1030 <iqzz_block@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xc8,%rsp
lea    0x80(%rsp),%rdi
lea    0x40(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <iqzz_block@plt>
xor    %eax,%eax
add    $0xc8,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i32]
%3 = alloca [16 x i32]
%4 = alloca [16 x i32]
store i32 0, i32* %1
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%8 = call i32 @iqzz_block(i32* %5, i32* %6, i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [16 x i32]
%2 = alloca [16 x i32]
%3 = alloca [16 x i32]
%4 = bitcast [16 x i32]* %1 to i8*
%5 = bitcast [16 x i32]* %2 to i8*
%6 = bitcast [16 x i32]* %3 to i8*
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%10 = call i32 @iqzz_block(i32* %7, i32* %8, i32* %9)
ret i32 0
}
void __DELETE_java_util_LinkedList(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_util_LinkedList(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_util_LinkedList(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void freeDoubleVector(double *vector) { free(vector); }


x86 assembly (clang, -O0):
<freeDoubleVector>:
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):
<freeDoubleVector>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeDoubleVector(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
void _M2_elc2_finish(__attribute__((unused)) int argc,
                     __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_elc2_finish(i32 %0, i8** nocapture %1) {
ret void
}
char *trim(char *s) {
  char *cur, *p;
  cur = p = s;
  while (*p) {
    if (*p != ' ' && *p != '\t') {
      *cur++ = *p++;
    } else {
      p++;
    }
  }
  *cur = *p;
  return s;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1179 <trim+0x79>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1168 <trim+0x68>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1168 <trim+0x68>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1174 <trim+0x74>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <trim+0x14>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
mov    %rdi,%rax
mov    %rdi,%rsi
mov    %rdi,%rdx
jmp    1114 <trim+0x14>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdx
movzbl (%rdx),%ecx
cmp    $0x9,%cl
je     1110 <trim+0x10>
cmp    $0x20,%cl
je     1110 <trim+0x10>
test   %cl,%cl
je     112d <trim+0x2d>
mov    %cl,(%rsi)
add    $0x1,%rsi
jmp    1110 <trim+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define i8* @trim(i8* returned %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = phi i8* [ %0, %1 ], [ %10, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %11
i8 32, label %8
i8 9, label %8
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %3
br label %8
8: ; preds = %2, %2, %6
%9 = phi i8* [ %7, %6 ], [ %3, %2 ], [ %3, %2 ]
%10 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
11: ; preds = %2
store i8 0, i8* %3
ret i8* %0
}