xunge/DecIR huggingface dataset:
/* Variables and functions */
int EINVAL;
int crypto_ipsec_check_assoclen(unsigned int assoclen) {
  switch (assoclen) {
  case 16:
  case 20:
    break;
  default:
    return -EINVAL;
  }
  return 0;
}


x86 assembly (clang, -O0):
<crypto_ipsec_check_assoclen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x4,%eax
sub    $0x14,%eax
je     111b <crypto_ipsec_check_assoclen+0x1b>
jmp    1120 <crypto_ipsec_check_assoclen+0x20>
jmp    1133 <crypto_ipsec_check_assoclen+0x33>
xor    %eax,%eax
mov    0x2eb7(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <crypto_ipsec_check_assoclen+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_ipsec_check_assoclen>:
xor    %eax,%eax
or     $0x4,%edi
cmp    $0x14,%edi
jne    110b <crypto_ipsec_check_assoclen+0xb>
ret
mov    0x2ece(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @crypto_ipsec_check_assoclen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 16, label %5
i32 20, label %5
]
5: ; preds = %1, %1
br label %9
6: ; preds = %1
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %10
9: ; preds = %5
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @crypto_ipsec_check_assoclen(i32 %0) {
switch i32 %0, label %2 [
i32 16, label %5
i32 20, label %5
]
2: ; preds = %1
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ %4, %2 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int random();
int random_level(void) {
  const double p = 0.25;
  int level = 1;
  while ((random() & 0xffff) < 0xffff * p) {
    level++;
  }
  return level > 32 ? 32 : level;
}


x86 assembly (clang, -O0):
<random_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <random_level+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <random_level+0x1c>
cmpl   $0x20,-0xc(%rbp)
jle    1173 <random_level+0x63>
mov    $0x20,%eax
mov    %eax,-0x10(%rbp)
jmp    1179 <random_level+0x69>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_level>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <random@plt>
add    $0x1,%ebx
test   $0xc000,%eax
je     1120 <random_level+0x10>
cmp    $0x20,%ebx
mov    $0x20,%eax
cmovb  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_level() {
%1 = alloca double
%2 = alloca i32
store double 2.500000e-01, double* %1
store i32 1, i32* %2
br label %3
3: ; preds = %8, %0
%4 = call i32 (...) @random()
%5 = and i32 %4, 65535
%6 = sitofp i32 %5 to double
%7 = fcmp olt double %6, 0x40CFFFE000000000
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 32
br i1 %13, label %14, label %15
14: ; preds = %11
br label %17
15: ; preds = %11
%16 = load i32, i32* %2
br label %17
17: ; preds = %15, %14
%18 = phi i32 [ 32, %14 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @random_level() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @random()
%4 = and i32 %3, 49152
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = icmp ult i32 %2, 32
%9 = select i1 %8, i32 %2, i32 32
ret i32 %9
}
int Operand_label8_encode(unsigned int *valp) {
  unsigned imm8_0, label8_0;
  label8_0 = *valp;
  imm8_0 = (label8_0 - 0x4) & 0xff;
  *valp = imm8_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_label8_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_label8_encode>:
mov    $0xfc,%eax
add    (%rdi),%eax
movzbl %al,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_label8_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sub i32 %7, 4
%9 = and i32 %8, 255
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_label8_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 252
%4 = and i32 %3, 255
store i32 %4, i32* %0
ret i32 0
}
/* Type definitions */
struct tnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ create_array(struct tnode *);
int /*<<< orphan*/ sort_list(int);
int tpoint_alloc(struct tnode *);
int llsort(struct tnode *p) {
  int maxsize = tpoint_alloc(p);
  create_array(p);
  sort_list(maxsize);
  return maxsize;
}


x86 assembly (clang, -O0):
<llsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <tpoint_alloc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <create_array@plt>
mov    -0xc(%rbp),%edi
call   1040 <sort_list@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llsort>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <tpoint_alloc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <create_array@plt>
mov    %ebp,%edi
call   1040 <sort_list@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tnode = type { i32 }
define i32 @llsort(%struct.tnode* %0) {
%2 = alloca %struct.tnode*
%3 = alloca i32
store %struct.tnode* %0, %struct.tnode** %2
%4 = load %struct.tnode*, %struct.tnode** %2
%5 = call i32 @tpoint_alloc(%struct.tnode* %4)
store i32 %5, i32* %3
%6 = load %struct.tnode*, %struct.tnode** %2
%7 = call i32 @create_array(%struct.tnode* %6)
%8 = load i32, i32* %3
%9 = call i32 @sort_list(i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.tnode = type { i32 }
define i32 @llsort(%struct.tnode* %0) {
%2 = tail call i32 @tpoint_alloc(%struct.tnode* %0)
%3 = tail call i32 @create_array(%struct.tnode* %0)
%4 = tail call i32 @sort_list(i32 %2)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ rb_error_arity(int, int, int);
void rb_check_arity(int argc, int min, int max) {
  if ((argc < min) || (max != (-1) && argc > max))
    rb_error_arity(argc, min, max);
}


x86 assembly (clang, -O0):
<rb_check_arity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1143 <rb_check_arity+0x33>
cmpl   $0xffffffff,-0xc(%rbp)
je     1151 <rb_check_arity+0x41>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1151 <rb_check_arity+0x41>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <rb_error_arity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_check_arity>:
cmp    %esi,%edi
jl     111d <rb_check_arity+0xd>
cmp    $0xffffffff,%edx
je     1122 <rb_check_arity+0x12>
cmp    %edx,%edi
jle    1122 <rb_check_arity+0x12>
jmp    1030 <rb_error_arity@plt>
ret

LLVM IR (-O0):
define void @rb_check_arity(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %17, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13, %3
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = call i32 @rb_error_arity(i32 %18, i32 %19, i32 %20)
br label %22
22: ; preds = %17, %13, %10
ret void
}

LLVM IR (-O2):
define void @rb_check_arity(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = icmp ne i32 %2, -1
%7 = icmp sgt i32 %0, %2
%8 = and i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5, %3
%10 = tail call i32 @rb_error_arity(i32 %0, i32 %1, i32 %2)
br label %11
11: ; preds = %9, %5
ret void
}
/* Type definitions */
struct jedec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct jedec *);
void jedec_free(struct jedec *jed) { free(jed); }


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

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

LLVM IR (-O2):
%struct.jedec = type { i32 }
define void @jedec_free(%struct.jedec* nocapture %0) {
%2 = tail call i32 @free(%struct.jedec* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ container_init();
int /*<<< orphan*/ register_rs_object_client();
int /*<<< orphan*/ register_rs_object_server();
void init(void) {
  container_init();
  register_rs_object_client();
  register_rs_object_server();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <container_init@plt>
mov    $0x0,%al
call   1040 <register_rs_object_client@plt>
mov    $0x0,%al
call   1050 <register_rs_object_server@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1030 <container_init@plt>
xor    %eax,%eax
call   1040 <register_rs_object_client@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <register_rs_object_server@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @container_init()
%2 = call i32 (...) @register_rs_object_client()
%3 = call i32 (...) @register_rs_object_server()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @container_init()
%2 = tail call i32 (...) @register_rs_object_client()
%3 = tail call i32 (...) @register_rs_object_server()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ dirtempunlink();
int /*<<< orphan*/ tempunlink();
volatile void exiterr() {
  dirtempunlink();
  tempunlink();
  _exit(1);
}


x86 assembly (clang, -O0):
<exiterr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dirtempunlink@plt>
mov    $0x0,%al
call   1050 <tempunlink@plt>
mov    $0x1,%edi
call   1040 <_exit@plt>

x86 assembly (clang, -O2):
<exiterr>:
push   %rax
xor    %eax,%eax
call   1030 <dirtempunlink@plt>
xor    %eax,%eax
call   1050 <tempunlink@plt>
mov    $0x1,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
define void @exiterr() {
%1 = call i32 (...) @dirtempunlink()
%2 = call i32 (...) @tempunlink()
%3 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @exiterr() {
%1 = tail call i32 (...) @dirtempunlink()
%2 = tail call i32 (...) @tempunlink()
%3 = tail call i32 @_exit(i32 1)
unreachable
}
int GetBFromRGB(const int nRGB) { return (nRGB & 0x00FF0000) >> 16; }


x86 assembly (clang, -O0):
<GetBFromRGB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBFromRGB>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @GetBFromRGB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711680
%5 = ashr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetBFromRGB(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
void g_mem_chunk_alloc() {}


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

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

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

LLVM IR (-O2):
define void @g_mem_chunk_alloc() {
ret void
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_disable_tilt_function(void) {
  char ctlreg_1 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1B, &ctlreg_1, 1) == 0) {
    ctlreg_1 &= ~0x01;
    KIONIX_ACCEL_write_byte(0x1B, ctlreg_1);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_disable_tilt_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1b,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_disable_tilt_function+0x4d>
movsbl -0x1(%rbp),%eax
and    $0xfffffffe,%eax
mov    %al,-0x1(%rbp)
mov    $0x1b,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_disable_tilt_function+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_disable_tilt_function>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1b,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_disable_tilt_function+0x41>
movsbl 0xf(%rsp),%esi
and    $0xfffffffe,%esi
mov    %sil,0xf(%rsp)
mov    $0x1b,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_disable_tilt_function() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -2
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_disable_tilt_function() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, -2
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONCovStatName(const struct feature_pair *pair,
                          const struct CovariateAnalysis *covan, FILE *fp) {}


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

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

LLVM IR (-O0):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovStatName(%struct.feature_pair* %0, %struct.CovariateAnalysis* %1, i32* %2) {
%4 = alloca %struct.feature_pair*
%5 = alloca %struct.CovariateAnalysis*
%6 = alloca i32*
store %struct.feature_pair* %0, %struct.feature_pair** %4
store %struct.CovariateAnalysis* %1, %struct.CovariateAnalysis** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovStatName(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t count_entries(char *str, char c) {
  uint8_t count = 0;
  while ('\0' != *str) {
    if (c == *str) {
      ++count;
    }
    ++str;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_entries>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1157 <count_entries+0x57>
movsbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1146 <count_entries+0x46>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <count_entries+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_entries>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <count_entries+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_entries+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @count_entries(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64
store i8* %0, i8** %3
store i8 %1, i8* %4
store i64 0, i64* %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 0, %9
br i1 %10, label %11, label %24
11: ; preds = %6
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = load i64, i64* %5
%20 = add nsw i64 %19, 1
store i64 %20, i64* %5
br label %21
21: ; preds = %18, %11
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
br label %6
24: ; preds = %6
%25 = load i64, i64* %5
ret i64 %25
}

LLVM IR (-O2):
define i64 @count_entries(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i64 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i64
%11 = add nuw nsw i64 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %11, %5 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ Base64Decode(char *, char *, int);
int /*<<< orphan*/ printf(char *);
void DecodeBase64(char *str) {
  char buf[255] = "";
  int b = 0;
  Base64Decode(str, buf, 255);
  printf(buf);
  printf("\n");
}


x86 assembly (clang, -O0):
<DecodeBase64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1040 <memset@plt>
movl   $0x0,-0x114(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0xff,%edx
call   1050 <Base64Decode@plt>
lea    -0x110(%rbp),%rdi
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecodeBase64>:
push   %rbx
sub    $0x100,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0xef(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0xff,%edx
call   1050 <Base64Decode@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @DecodeBase64(i8* %0) {
%2 = alloca i8*
%3 = alloca [255 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = bitcast [255 x i8]* %3 to i8*
store i32 0, i32* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = call i32 @Base64Decode(i8* %6, i8* %7, i32 255)
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @DecodeBase64(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @Base64Decode(i8* %0, i8* %3, i32 255)
%5 = call i32 @printf(i8* %3)
%6 = call i32 @putchar(i32 10)
ret void
}
int local_getRequiredDigits(int numFiles) {
  int digits = 1;
  int divisor = 10;
  while (digits < 7 && numFiles / divisor != 0) {
    digits++;
    divisor *= 10;
  }
  return digits;
}


x86 assembly (clang, -O0):
<local_getRequiredDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x7,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jge    1134 <local_getRequiredDigits+0x34>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <local_getRequiredDigits+0x44>
jmp    1159 <local_getRequiredDigits+0x59>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <local_getRequiredDigits+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_getRequiredDigits>:
lea    0x9(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x13,%ecx
jb     116a <local_getRequiredDigits+0x6a>
lea    0x63(%rdi),%ecx
mov    $0x2,%eax
cmp    $0xc7,%ecx
jb     116a <local_getRequiredDigits+0x6a>
lea    0x3e7(%rdi),%ecx
mov    $0x3,%eax
cmp    $0x7cf,%ecx
jb     116a <local_getRequiredDigits+0x6a>
lea    0x270f(%rdi),%ecx
mov    $0x4,%eax
cmp    $0x4e1f,%ecx
jb     116a <local_getRequiredDigits+0x6a>
lea    0x1869f(%rdi),%ecx
mov    $0x5,%eax
cmp    $0x30d3f,%ecx
jb     116a <local_getRequiredDigits+0x6a>
add    $0xf423f,%edi
cmp    $0x1e847f,%edi
mov    $0x7,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @local_getRequiredDigits(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %20, label %4
4: ; preds = %1
%5 = add i32 %0, 99
%6 = icmp ult i32 %5, 199
br i1 %6, label %20, label %7
7: ; preds = %4
%8 = add i32 %0, 999
%9 = icmp ult i32 %8, 1999
br i1 %9, label %20, label %10
10: ; preds = %7
%11 = add i32 %0, 9999
%12 = icmp ult i32 %11, 19999
br i1 %12, label %20, label %13
13: ; preds = %10
%14 = add i32 %0, 99999
%15 = icmp ult i32 %14, 199999
br i1 %15, label %20, label %16
16: ; preds = %13
%17 = add i32 %0, 999999
%18 = icmp ult i32 %17, 1999999
%19 = select i1 %18, i32 6, i32 7
br label %20
20: ; preds = %16, %13, %10, %7, %4, %1
%21 = phi i32 [ 1, %1 ], [ 2, %4 ], [ 3, %7 ], [ 4, %10 ], [ 5, %13 ], [ %19, %16 ]
ret i32 %21
}
/* Variables and functions */
char *getenv(char const *);
const char *env_else(const char *env, const char *def) {
  const char *c = getenv(env);
  return c ? c : def;
}


x86 assembly (clang, -O0):
<env_else>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <env_else+0x35>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    114d <env_else+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_else>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @env_else(i8* nocapture %0, i8* readnone %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* %1, i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ usage();
void usagex(void) {
  usage();
  exit(-1);
}


x86 assembly (clang, -O0):
<usagex>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <usage@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usagex>:
push   %rax
xor    %eax,%eax
call   1030 <usage@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @usagex() {
%1 = call i32 (...) @usage()
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @usagex() {
%1 = tail call i32 (...) @usage()
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ utexpect(char *, char *);
void test_api_two(void) { utexpect("failure", "success"); }


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

x86 assembly (clang, -O2):
<test_api_two>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
jmp    1030 <utexpect@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"failure\00"
@.str.1 = [8 x i8] c"success\00"
define void @test_api_two() {
%1 = call i32 @utexpect(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"failure\00"
@.str.1 = [8 x i8] c"success\00"
define void @test_api_two() {
%1 = tail call i32 @utexpect(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bad_selector(struct __test_metadata *);
void wrapper_bad_selector(struct __test_metadata *_metadata,
                          struct __fixture_variant_metadata *variant) {
  bad_selector(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_bad_selector>:
jmp    1030 <bad_selector@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_bad_selector(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @bad_selector(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_bad_selector(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @bad_selector(%struct.__test_metadata* %0)
ret void
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ptrace_detach(int /*<<< orphan*/);
int /*<<< orphan*/ ptrace_setregs(int /*<<< orphan*/,
                                  struct user_regs_struct *);
int /*<<< orphan*/ ptrace_write(int /*<<< orphan*/, unsigned long, void *, int);
void restoreStateAndDetach(pid_t target, unsigned long addr, void *backup,
                           int datasize, struct user_regs_struct oldregs) {
  ptrace_write(target, addr, backup, datasize);
  ptrace_setregs(target, &oldregs);
  ptrace_detach(target);
}


x86 assembly (clang, -O0):
<restoreStateAndDetach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <ptrace_write@plt>
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <ptrace_setregs@plt>
mov    -0xc(%rbp),%edi
call   1040 <ptrace_detach@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restoreStateAndDetach>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %r8d,0x8(%rsp)
call   1030 <ptrace_write@plt>
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
call   1050 <ptrace_setregs@plt>
mov    %ebx,%edi
call   1040 <ptrace_detach@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @restoreStateAndDetach(i32 %0, i64 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca %struct.user_regs_struct
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32
%11 = getelementptr inbounds %struct.user_regs_struct, %struct.user_regs_struct* %6, i32 0, i32 0
store i32 %4, i32* %11
store i32 %0, i32* %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
%12 = load i32, i32* %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @ptrace_write(i32 %12, i64 %13, i8* %14, i32 %15)
%17 = load i32, i32* %7
%18 = call i32 @ptrace_setregs(i32 %17, %struct.user_regs_struct* %6)
%19 = load i32, i32* %7
%20 = call i32 @ptrace_detach(i32 %19)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @restoreStateAndDetach(i32 %0, i64 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca %struct.user_regs_struct
%7 = getelementptr inbounds %struct.user_regs_struct, %struct.user_regs_struct* %6, i64 0, i32 0
store i32 %4, i32* %7
%8 = tail call i32 @ptrace_write(i32 %0, i64 %1, i8* %2, i32 %3)
%9 = call i32 @ptrace_setregs(i32 %0, %struct.user_regs_struct* %6)
%10 = call i32 @ptrace_detach(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u64_xxh64s_data32(float const *, size_t, uintptr_t);
uint64_t rgph_u64_xxh64s_f32a(const float *key, size_t len, uintptr_t seed) {
  return rgph_u64_xxh64s_data32(key, len, seed);
}


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

x86 assembly (clang, -O2):
<rgph_u64_xxh64s_f32a>:
jmp    1030 <rgph_u64_xxh64s_data32@plt>

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

LLVM IR (-O2):
define i32 @rgph_u64_xxh64s_f32a(float* %0, i64 %1, i64 %2) {
%4 = tail call i32 @rgph_u64_xxh64s_data32(float* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
int sys_execve(const char *name, char *const argv[], char *const envp[]) {
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<sys_execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_execve>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @sys_execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i32, i32* @ENOMEM
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @sys_execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @ENOMEM
store i32 %4, i32* @errno
ret i32 -1
}
void b(int y) { int z = y; }


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

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

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

LLVM IR (-O2):
define void @b(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dvector(double *v, int nl, int nh) { free((char *)(v + nl - 1)); }


x86 assembly (clang, -O0):
<free_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dvector>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_dvector(double* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = getelementptr inbounds double, double* %5, i64 -1
%7 = bitcast double* %6 to i8*
%8 = tail call i32 @free(i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sdb_lock(char const *);
int /*<<< orphan*/ usleep(int);
void sdb_lock_wait(const char *s) {
  while (!sdb_lock(s))
    usleep(100);
}


x86 assembly (clang, -O0):
<sdb_lock_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sdb_lock@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <sdb_lock_wait+0x2a>
jmp    1159 <sdb_lock_wait+0x39>
mov    $0x64,%edi
call   1040 <usleep@plt>
jmp    112c <sdb_lock_wait+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdb_lock_wait>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <sdb_lock@plt>
test   %eax,%eax
jne    1148 <sdb_lock_wait+0x28>
mov    $0x64,%edi
call   1040 <usleep@plt>
mov    %rbx,%rdi
jmp    1130 <sdb_lock_wait+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @sdb_lock_wait(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = call i32 @sdb_lock(i8* %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 @usleep(i32 100)
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @sdb_lock_wait(i8* %0) {
%2 = tail call i32 @sdb_lock(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @usleep(i32 100)
%6 = tail call i32 @sdb_lock(i8* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msg_set_bits(struct tipc_msg *, int, int, int, int);
void msg_set_redundant_link(struct tipc_msg *m) {
  msg_set_bits(m, 5, 12, 0x1, 1);
}


x86 assembly (clang, -O0):
<msg_set_redundant_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0xc,%edx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <msg_set_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_set_redundant_link>:
mov    $0x5,%esi
mov    $0xc,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <msg_set_bits@plt>

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define void @msg_set_redundant_link(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = call i32 @msg_set_bits(%struct.tipc_msg* %3, i32 5, i32 12, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define void @msg_set_redundant_link(%struct.tipc_msg* %0) {
%2 = tail call i32 @msg_set_bits(%struct.tipc_msg* %0, i32 5, i32 12, i32 1, i32 1)
ret void
}
/* Type definitions */
struct pagewordsFormatPartFormat {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void dictionaryWordsWrite_part(struct pagewordsFormatPartFormat *wordsPart,
                               FILE *FH, char *acl_allow, char *acl_denied) {
  int i;
}


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

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

LLVM IR (-O0):
%struct.pagewordsFormatPartFormat = type { i32 }
define void @dictionaryWordsWrite_part(%struct.pagewordsFormatPartFormat* %0, i32* %1, i8* %2, i8* %3) {
%5 = alloca %struct.pagewordsFormatPartFormat*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store %struct.pagewordsFormatPartFormat* %0, %struct.pagewordsFormatPartFormat** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
%struct.pagewordsFormatPartFormat = type { i32 }
define void @dictionaryWordsWrite_part(%struct.pagewordsFormatPartFormat* nocapture %0, i32* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
void g_key_file_load_from_data() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_load_from_data() {
ret void
}
char *quotation_marks(int depth, int type) {
  if (depth >= 2)
    return (!type) ? "`" : "'";
  else
    return (!type) ? "``" : "''";
}


x86 assembly (clang, -O0):
<quotation_marks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x2,-0xc(%rbp)
jl     113c <quotation_marks+0x3c>
cmpl   $0x0,-0x10(%rbp)
setne  %dl
xor    $0xff,%dl
lea    0xedf(%rip),%rax
lea    0xed5(%rip),%rcx
test   $0x1,%dl
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    115f <quotation_marks+0x5f>
cmpl   $0x0,-0x10(%rbp)
setne  %dl
xor    $0xff,%dl
lea    0xeb6(%rip),%rax
lea    0xeac(%rip),%rcx
test   $0x1,%dl
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quotation_marks>:
test   %esi,%esi
lea    0xef8(%rip),%rax
lea    0xef4(%rip),%rcx
cmove  %rax,%rcx
lea    0xee5(%rip),%rdx
lea    0xee1(%rip),%rax
cmove  %rdx,%rax
cmp    $0x2,%edi
cmovge %rcx,%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"`\00"
@.str.1 = [2 x i8] c"'\00"
@.str.2 = [3 x i8] c"``\00"
@.str.3 = [3 x i8] c"''\00"
define i8* @quotation_marks(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
store i8* %13, i8** %3
br label %20
14: ; preds = %2
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i64
%19 = select i1 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
store i8* %19, i8** %3
br label %20
20: ; preds = %14, %8
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [2 x i8] c"`\00"
@.str.1 = [2 x i8] c"'\00"
@.str.2 = [3 x i8] c"``\00"
@.str.3 = [3 x i8] c"''\00"
define i8* @quotation_marks(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 1
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%6 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%7 = select i1 %3, i8* %5, i8* %6
ret i8* %7
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void AnsiTerm_bg24(uint32_t c) {
  uint8_t r = (c >> 16) & 0xff;
  uint8_t g = (c >> 8) & 0xff;
  uint8_t b = c & 0xff;
  printf("\x1B[48;2;%d;%d;%dm", r, g, b);
}


x86 assembly (clang, -O0):
<AnsiTerm_bg24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AnsiTerm_bg24>:
mov    %edi,%eax
movzbl %ah,%edx
movzbl %al,%ecx
shr    $0x10,%eax
movzbl %al,%esi
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\1B[48;2;%d;%d;%dm\00"
define void @AnsiTerm_bg24(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = and i32 %7, 255
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = and i32 %12, 255
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\1B[48;2;%d;%d;%dm\00"
define void @AnsiTerm_bg24(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = and i32 %0, 255
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %6)
ret void
}
int ft_iswhitespace(int c) {
  if ((c >= 9 && c <= 13) || c == ' ')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_iswhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jl     111b <ft_iswhitespace+0x1b>
cmpl   $0xd,-0x8(%rbp)
jle    1125 <ft_iswhitespace+0x25>
cmpl   $0x20,-0x8(%rbp)
jne    1131 <ft_iswhitespace+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <ft_iswhitespace+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_iswhitespace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <ft_iswhitespace+0xe>
ret
cmp    $0x20,%edi
je     110d <ft_iswhitespace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_iswhitespace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 12, label %3
i32 11, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ expression();
char *getname();
int /*<<< orphan*/ match(char);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void assignment(void) {
  char outputstr[64];
  char *name = getname();
  match('=');
  expression();
  snprintf(outputstr, 64, "LEA %s(PC),A0", name);
  emitln(outputstr);
  emitln("MOVE D0,(A0)");
}


x86 assembly (clang, -O0):
<assignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x0,%al
call   1050 <getname@plt>
mov    %rax,-0x48(%rbp)
mov    $0x3d,%edi
call   1070 <match@plt>
mov    $0x0,%al
call   1060 <expression@plt>
lea    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rcx
mov    $0x40,%esi
lea    0xe78(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <emitln@plt>
lea    0xe71(%rip),%rdi
call   1030 <emitln@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assignment>:
push   %r14
push   %rbx
sub    $0x48,%rsp
xor    %eax,%eax
call   1050 <getname@plt>
mov    %rax,%rbx
mov    $0x3d,%edi
call   1070 <match@plt>
xor    %eax,%eax
call   1060 <expression@plt>
lea    0xe87(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
mov    %rbx,%rcx
call   1040 <snprintf@plt>
mov    %r14,%rdi
call   1030 <emitln@plt>
lea    0xe73(%rip),%rdi
call   1030 <emitln@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"LEA %s(PC),A0\00"
@.str.1 = [13 x i8] c"MOVE D0,(A0)\00"
define void @assignment() {
%1 = alloca [64 x i8]
%2 = alloca i8*
%3 = call i8* (...) @getname()
store i8* %3, i8** %2
%4 = call i32 @match(i8 signext 61)
%5 = call i32 (...) @expression()
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%10 = call i32 @emitln(i8* %9)
%11 = call i32 @emitln(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"LEA %s(PC),A0\00"
@.str.1 = [13 x i8] c"MOVE D0,(A0)\00"
define void @assignment() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i8* (...) @getname()
%4 = tail call i32 @match(i8 signext 61)
%5 = tail call i32 (...) @expression()
%6 = call i32 @snprintf(i8* %2, i32 64, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 @emitln(i8* %2)
%8 = call i32 @emitln(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}