xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char *ir_get_code();
int ir_hash_match(unsigned char *);
int ir_get_command(void) {
  unsigned char *code;
  code = ir_get_code();
  if (code) {
    return ir_hash_match(code);
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<ir_get_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ir_get_code@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114f <ir_get_command+0x2f>
mov    -0x10(%rbp),%rdi
call   1040 <ir_hash_match@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <ir_get_command+0x36>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_get_command>:
push   %rax
xor    %eax,%eax
call   1030 <ir_get_code@plt>
test   %rax,%rax
je     1136 <ir_get_command+0x16>
mov    %rax,%rdi
pop    %rax
jmp    1040 <ir_hash_match@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ir_get_command() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* (...) @ir_get_code()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @ir_hash_match(i8* %7)
store i32 %8, i32* %1
br label %10
9: ; preds = %0
store i32 -1, i32* %1
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @ir_get_command() {
%1 = tail call i8* (...) @ir_get_code()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @ir_hash_match(i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ crypto_auth_hmacsha256(unsigned char *,
                                          unsigned char const *,
                                          unsigned long long,
                                          unsigned char const *);
int crypto_verify_32(unsigned char const *, unsigned char *);
int crypto_auth_hmacsha256_verify(const unsigned char *h,
                                  const unsigned char *in,
                                  unsigned long long inlen,
                                  const unsigned char *k) {
  unsigned char correct[32];
  crypto_auth_hmacsha256(correct, in, inlen, k);
  return crypto_verify_32(h, correct);
}


x86 assembly (clang, -O0):
<crypto_auth_hmacsha256_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <crypto_auth_hmacsha256@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <crypto_verify_32@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_auth_hmacsha256_verify>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <crypto_auth_hmacsha256@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <crypto_verify_32@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @crypto_auth_hmacsha256_verify(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca [32 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = call i32 @crypto_auth_hmacsha256(i8* %10, i8* %11, i64 %12, i8* %13)
%15 = load i8*, i8** %5
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%17 = call i32 @crypto_verify_32(i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @crypto_auth_hmacsha256_verify(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = call i32 @crypto_auth_hmacsha256(i8* %6, i8* %1, i64 %2, i8* %3)
%8 = call i32 @crypto_verify_32(i8* %0, i8* %6)
ret i32 %8
}
int mychar2int(int c) { return (c - '0'); }


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

x86 assembly (clang, -O2):
<mychar2int>:
lea    -0x30(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @mychar2int(i32 %0) {
%2 = add nsw i32 %0, -48
ret i32 %2
}
/* Variables and functions */
char *strchr(char *, char);
void remove_spaces(char *name) {
  char *ptr = name;
  while ((ptr = strchr(ptr, ' ')))
    *ptr++ = '_';
}


x86 assembly (clang, -O0):
<remove_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1157 <remove_spaces+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x5f,(%rax)
jmp    1124 <remove_spaces+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_spaces>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <remove_spaces+0x2b>
movb   $0x5f,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
jmp    1120 <remove_spaces+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @remove_spaces(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = call i8* @strchr(i8* %6, i8 signext 32)
store i8* %7, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8 95, i8* %10
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @remove_spaces(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 32)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 95, i8* %5
%7 = tail call i8* @strchr(i8* dereferenceable(1) %6, i8 signext 32)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
int comparedouble(const void *a, const void *b) {
  double aa = *(double *)a, bb = *(double *)b;
  return (aa > bb ? 1 : (aa < bb ? -1 : 0));
}


x86 assembly (clang, -O0):
<comparedouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1143 <comparedouble+0x43>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115e <comparedouble+0x5e>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparedouble>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comparedouble(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
store double %9, double* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load double, double* %5
%19 = load double, double* %6
%20 = fcmp olt double %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 -1, i32 0
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ 1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @comparedouble(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void intr_disable(void) {
  asm volatile("# clear IF in EFLAGS\n\t"
               "cli\n\t"
               :
               :
               : "cc", "memory");
}


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

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

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

LLVM IR (-O2):
define void @intr_disable() {
tail call void asm sideeffect "# clear IF in EFLAGS\0A\09cli\0A\09", "~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setLift(int, int, int, int, int, int);
void setLiftTrim() { setLift(10, 10, 10, 10, 10, 10); }


x86 assembly (clang, -O0):
<setLiftTrim>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <setLift@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLiftTrim>:
mov    $0xa,%edi
mov    $0xa,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
mov    $0xa,%r8d
mov    $0xa,%r9d
jmp    1030 <setLift@plt>

LLVM IR (-O0):
define void @setLiftTrim() {
%1 = call i32 @setLift(i32 10, i32 10, i32 10, i32 10, i32 10, i32 10)
ret void
}

LLVM IR (-O2):
define void @setLiftTrim() {
%1 = tail call i32 @setLift(i32 10, i32 10, i32 10, i32 10, i32 10, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void handler(int sig) {
  cleanup();
  signal(sig, SIG_DFL);
  kill(getpid(), sig);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <cleanup@plt>
mov    -0x4(%rbp),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1050 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <cleanup@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <signal@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1050 <kill@plt>

LLVM IR (-O0):
@SIG_DFL = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
%4 = load i32, i32* %2
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = call i32 (...) @getpid()
%8 = load i32, i32* %2
%9 = call i32 @kill(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
define void @handler(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %0, i32 %3)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @kill(i32 %5, i32 %0)
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
void cu_add_pos(char *s, uint8_t pos) {
  *s = pos;
  *s >>= 4;
  *s += 'a';
  s++;
  *s = pos;
  *s &= 15;
  *s += '1';
}


x86 assembly (clang, -O0):
<cu_add_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sar    $0x4,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x61,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    $0xf,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x31,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cu_add_pos>:
mov    %esi,%eax
sar    $0x4,%al
add    $0x61,%al
mov    %al,(%rdi)
and    $0xf,%sil
add    $0x31,%sil
mov    %sil,0x1(%rdi)
ret

LLVM IR (-O0):
define void @cu_add_pos(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
store i8 %5, i8* %6
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = ashr i32 %9, 4
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, 97
%16 = trunc i32 %15 to i8
store i8 %16, i8* %12
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
%19 = load i8, i8* %4
%20 = load i8*, i8** %3
store i8 %19, i8* %20
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = and i32 %23, 15
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = add nsw i32 %28, 49
%30 = trunc i32 %29 to i8
store i8 %30, i8* %26
ret void
}

LLVM IR (-O2):
define void @cu_add_pos(i8* nocapture writeonly %0, i8 signext %1) {
%3 = ashr i8 %1, 4
%4 = add nsw i8 %3, 97
store i8 %4, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = and i8 %1, 15
%7 = add nuw nsw i8 %6, 49
store i8 %7, i8* %5
ret void
}
int min_int(int x, int y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<min_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min_int+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min_int+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int serial_connect(struct addrinfo *, int);
int ai_connect(struct addrinfo *ai, int die, int free_ai) {
  int res;
  res = serial_connect(ai, die);
  if (free_ai)
    freeaddrinfo(ai);
  return res;
}


x86 assembly (clang, -O0):
<ai_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <serial_connect@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1154 <ai_connect+0x34>
mov    -0x8(%rbp),%rdi
call   1040 <freeaddrinfo@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_connect>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <serial_connect@plt>
mov    %eax,%r14d
test   %ebp,%ebp
je     113d <ai_connect+0x1d>
mov    %rbx,%rdi
call   1040 <freeaddrinfo@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define i32 @ai_connect(%struct.addrinfo* %0, i32 %1, i32 %2) {
%4 = alloca %struct.addrinfo*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.addrinfo* %0, %struct.addrinfo** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.addrinfo*, %struct.addrinfo** %4
%9 = load i32, i32* %5
%10 = call i32 @serial_connect(%struct.addrinfo* %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load %struct.addrinfo*, %struct.addrinfo** %4
%15 = call i32 @freeaddrinfo(%struct.addrinfo* %14)
br label %16
16: ; preds = %13, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define i32 @ai_connect(%struct.addrinfo* %0, i32 %1, i32 %2) {
%4 = tail call i32 @serial_connect(%struct.addrinfo* %0, i32 %1)
%5 = icmp eq i32 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @freeaddrinfo(%struct.addrinfo* %0)
br label %8
8: ; preds = %6, %3
ret i32 %4
}
void Put(int plate[], int item) {
  for (int i = 0; i < 5; i++) {
    if (plate[i] == 0) {
      plate[i] = item;
      return;
    }
  }
}


x86 assembly (clang, -O0):
<Put>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1154 <Put+0x54>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1141 <Put+0x41>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1154 <Put+0x54>
jmp    1146 <Put+0x46>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <Put+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Put>:
cmpl   $0x0,(%rdi)
je     111e <Put+0x1e>
cmpl   $0x0,0x4(%rdi)
je     1124 <Put+0x24>
cmpl   $0x0,0x8(%rdi)
je     112d <Put+0x2d>
cmpl   $0x0,0xc(%rdi)
je     1136 <Put+0x36>
cmpl   $0x0,0x10(%rdi)
je     113f <Put+0x3f>
ret
xor    %eax,%eax
mov    %esi,(%rdi,%rax,4)
ret
mov    $0x1,%eax
mov    %esi,(%rdi,%rax,4)
ret
mov    $0x2,%eax
mov    %esi,(%rdi,%rax,4)
ret
mov    $0x3,%eax
mov    %esi,(%rdi,%rax,4)
ret
mov    $0x4,%eax
mov    %esi,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @Put(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %20, %16, %12, %8, %2
%6 = phi i64 [ 0, %2 ], [ 1, %8 ], [ 2, %12 ], [ 3, %16 ], [ 4, %20 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %1, i32* %7
br label %24
8: ; preds = %2
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %8
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %5, label %16
16: ; preds = %12
%17 = getelementptr inbounds i32, i32* %0, i64 3
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %5, label %20
20: ; preds = %16
%21 = getelementptr inbounds i32, i32* %0, i64 4
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 0
br i1 %23, label %5, label %24
24: ; preds = %20, %5
ret void
}
void ade7753_remove_trigger(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @ade7753_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main(void) {
  int *p1 = NULL;
  printf(" %p ", p1);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c" %p \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ pthread_setname_np(int /*<<< orphan*/, char const *);
void aeron_thread_set_name(const char *role_name) {
  pthread_setname_np(pthread_self(), role_name);
}


x86 assembly (clang, -O0):
<aeron_thread_set_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <pthread_setname_np@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_thread_set_name>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <pthread_setname_np@plt>

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

LLVM IR (-O2):
define void @aeron_thread_set_name(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_setname_np(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TTWAIN_EmptyMessageQueuePD();
void TTWAIN_EmptyMessageQueue(void) { TTWAIN_EmptyMessageQueuePD(); }


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

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

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

LLVM IR (-O2):
define void @TTWAIN_EmptyMessageQueue() {
%1 = tail call i32 (...) @TTWAIN_EmptyMessageQueuePD()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int ftp_open(const char *url, int port) {
  printf("ftp_open() called!\n");
  printf("ftp_open: not yet implemented\n");
  return -1;
}


x86 assembly (clang, -O0):
<ftp_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"ftp_open() called!\0A\00"
@.str.1 = [31 x i8] c"ftp_open: not yet implemented\0A\00"
define i32 @ftp_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@str = [19 x i8] c"ftp_open() called!\00"
@str.2 = [30 x i8] c"ftp_open: not yet implemented\00"
define i32 @ftp_open(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.2, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void delete_file_(char *fname) { unlink(fname); }


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

x86 assembly (clang, -O2):
<delete_file_>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @delete_file_(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (;;) {
    if (i > 0) {
      if (i == 5)
        goto end;
      printf("123\n");
    } else {
      if (i == -5)
        goto end;
      printf("456\n");
    }
    printf("789\n");
  }
end:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1149 <main+0x39>
cmpl   $0x5,-0x8(%rbp)
jne    1138 <main+0x28>
jmp    1175 <main+0x65>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1164 <main+0x54>
cmpl   $0xfffffffb,-0x8(%rbp)
jne    1158 <main+0x48>
jmp    1175 <main+0x65>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
lea    0xee2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1130 <main+0x20>

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

LLVM IR (-O2):
@str = [4 x i8] c"456\00"
@str.3 = [4 x i8] c"789\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
br label %1
}
int test_imm_D9uint16_reg(unsigned short val) {
  return ((val) & (-0xD9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D9uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff27,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D9uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -217
%6 = icmp ne i32 %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_D9uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -217
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int question(char c) { return c == '?'; }


x86 assembly (clang, -O0):
<question>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @question(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 63
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @question(i8 signext %0) {
%2 = icmp eq i8 %0, 63
%3 = zext i1 %2 to i32
ret i32 %3
}
int eq_it(int suc, int value) { return suc == value; }


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

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

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

LLVM IR (-O2):
define i32 @eq_it(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo(void) {
  static int a1 = 1 << 31;
  static int a2 = 10 << 30;
  static int a3 = 100 << 28;
  static int a4 = (-0x7fffffff - 1) / -1;
}


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

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

LLVM IR (-O0):
@foo.a1 = internal global i32 -2147483648
@foo.a2 = internal global i32 -2147483648
@foo.a3 = internal global i32 1073741824
@foo.a4 = internal global i32 -2147483648
define void @foo() {
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
void Ethernet_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Ethernet_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Ethernet_Handler+0x9>
jmp    1109 <Ethernet_Handler+0x9>

x86 assembly (clang, -O2):
<Ethernet_Handler>:
jmp    1100 <Ethernet_Handler>

LLVM IR (-O0):
define void @Ethernet_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Ethernet_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ check_nul();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, world!\n");
  check_nul();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @check_nul()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @check_nul()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int cbm_get_eoi(int f) { return ioctl(f, _IO(0xcb, 7)); }


x86 assembly (clang, -O0):
<cbm_get_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcb,%edi
mov    $0x7,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_get_eoi>:
push   %rbx
mov    %edi,%ebx
mov    $0xcb,%edi
mov    $0x7,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbm_get_eoi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 203, i32 7)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cbm_get_eoi(i32 %0) {
%2 = tail call i32 @_IO(i32 203, i32 7)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_weight_wxh(int /*<<< orphan*/ *, int,
                                        int /*<<< orphan*/ *, int, int, int,
                                        int);
void pixel_avg_weight_16x16(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                            int i_stride_pix2, int i_weight1) {
  pixel_avg_weight_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 16, 16,
                       i_weight1);
}


x86 assembly (clang, -O0):
<pixel_avg_weight_16x16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x10,%r9d
mov    %r9d,%r8d
mov    %eax,(%rsp)
call   1030 <pixel_avg_weight_wxh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_weight_16x16>:
push   %rax
mov    %r8d,(%rsp)
mov    $0x10,%r8d
mov    $0x10,%r9d
call   1030 <pixel_avg_weight_wxh@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pixel_avg_weight_16x16(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @pixel_avg_weight_wxh(i32* %11, i32 %12, i32* %13, i32 %14, i32 16, i32 16, i32 %15)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_weight_16x16(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @pixel_avg_weight_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 16, i32 16, i32 %4)
ret void
}
float calc_max_vc(float ra, float rb, float vdac) {
  return (rb / (ra + rb)) * vdac;
}


x86 assembly (clang, -O0):
<calc_max_vc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
mulss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_max_vc>:
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @calc_max_vc(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fadd float %8, %9
%11 = fdiv float %7, %10
%12 = load float, float* %6
%13 = fmul float %11, %12
ret float %13
}

LLVM IR (-O2):
define float @calc_max_vc(float %0, float %1, float %2) {
%4 = fadd float %0, %1
%5 = fdiv float %1, %4
%6 = fmul float %5, %2
ret float %6
}
/* Variables and functions */
int converter();
int /*<<< orphan*/ printf(char *);
int main() {
  int success;
  success = converter();
  if (success != 0)
    printf("Conversion failed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <converter@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114f <main+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <converter@plt>
test   %eax,%eax
je     1138 <main+0x18>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Conversion failed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @converter()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Conversion failed.\00"
define i32 @main() {
%1 = tail call i32 (...) @converter()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void imprimir_valores_impares(int *p, int longitud) {
  for (int i = 1; i < longitud; i = i + 2)
    printf("Valor de arreglo[%d]. p[%d]: %d\n", i, i, *(p + i));
}


x86 assembly (clang, -O0):
<imprimir_valores_impares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <imprimir_valores_impares+0x4d>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <imprimir_valores_impares+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_valores_impares>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     1148 <imprimir_valores_impares+0x38>
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0x1,%ebx
lea    0xed3(%rip),%r15
nopl   (%rax)
mov    (%r14,%rbx,4),%ecx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x2,%rbx
cmp    %ebp,%ebx
jl     1130 <imprimir_valores_impares+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"Valor de arreglo[%d]. p[%d]: %d\0A\00"
define void @imprimir_valores_impares(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 1, %2 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = trunc i64 %6 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %9, i32 %8)
%11 = add nuw i64 %6, 2
%12 = trunc i64 %11 to i32
%13 = icmp slt i32 %12, %1
br i1 %13, label %5, label %4
}
int newLabel(void) {
  static int lbl = 1000;
  return lbl++;
}


x86 assembly (clang, -O0):
<newLabel>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<newLabel>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@newLabel.lbl = internal global i32 1000
define i32 @newLabel() {
%1 = load i32, i32* @newLabel.lbl
%2 = add nsw i32 %1, 1
store i32 %2, i32* @newLabel.lbl
ret i32 %1
}

LLVM IR (-O2):
@newLabel.lbl = internal unnamed_addr global i32 1000
define i32 @newLabel() {
%1 = load i32, i32* @newLabel.lbl
%2 = add nsw i32 %1, 1
store i32 %2, i32* @newLabel.lbl
ret i32 %1
}
int d_ge_rr1(double a1, double a2) { return (((a1) >= (a2))); }


x86 assembly (clang, -O0):
<d_ge_rr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ge_rr1>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @d_ge_rr1(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
float flip(float input) {
  assert(sizeof(float) == 4);
  unsigned char *bytes = (unsigned char *)&input;
  int c;
  unsigned char temp;
  for (c = 0; c < 2; c++) {
    temp = bytes[c];
    bytes[c] = bytes[3 - c];
    bytes[3 - c] = temp;
  }
  return input;
}


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    118e <flip+0x7e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3,%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    $0x3,%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <flip+0x26>
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
movd   0x4(%rsp),%xmm0
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @flip(float %0) {
%2 = tail call i32 @assert(i32 1)
%3 = bitcast float %0 to i32
%4 = call i32 @llvm.bswap.i32(i32 %3)
%5 = bitcast i32 %4 to float
ret float %5
}
/* Variables and functions */
unsigned int UINT_MAX;
unsigned int __WORDSIZE;
unsigned int bits_extract(unsigned int start, unsigned int end,
                          unsigned int x) {
  unsigned int len = end - start;
  x >>= start;
  unsigned int maxshift = UINT_MAX >> (__WORDSIZE - len);
  return x & maxshift;
}


x86 assembly (clang, -O0):
<bits_extract>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    0x2eb7(%rip),%rcx
mov    (%rcx),%ecx
sub    -0x10(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_extract>:
mov    %edi,%ecx
sub    %esi,%edi
shr    %cl,%edx
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
mov    0x2ed2(%rip),%rcx
add    (%rcx),%edi
mov    %edi,%ecx
shr    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
@__WORDSIZE = global i32 0
define i32 @bits_extract(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = lshr i32 %13, %12
store i32 %14, i32* %6
%15 = load i32, i32* @UINT_MAX
%16 = load i32, i32* @__WORDSIZE
%17 = load i32, i32* %7
%18 = sub i32 %16, %17
%19 = lshr i32 %15, %18
store i32 %19, i32* %8
%20 = load i32, i32* %6
%21 = load i32, i32* %8
%22 = and i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
@__WORDSIZE = global i32 0
define i32 @bits_extract(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 %0, %1
%5 = lshr i32 %2, %0
%6 = load i32, i32* @UINT_MAX
%7 = load i32, i32* @__WORDSIZE
%8 = add i32 %4, %7
%9 = lshr i32 %6, %8
%10 = and i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
void GenLocalAlloc(int size) {
  GenPrintInstr2Operands(0x0A, 0, 0x0A, 0, 0x0D, size);
}


x86 assembly (clang, -O0):
<GenLocalAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%r9d
mov    $0xa,%edx
xor    %ecx,%ecx
mov    $0xd,%r8d
mov    %edx,%edi
mov    %ecx,%esi
call   1030 <GenPrintInstr2Operands@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenLocalAlloc>:
mov    %edi,%r9d
mov    $0xa,%edi
xor    %esi,%esi
mov    $0xa,%edx
xor    %ecx,%ecx
mov    $0xd,%r8d
jmp    1030 <GenPrintInstr2Operands@plt>

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

LLVM IR (-O2):
define void @GenLocalAlloc(i32 %0) {
%2 = tail call i32 @GenPrintInstr2Operands(i32 10, i32 0, i32 10, i32 0, i32 13, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ safe_exit(int /*<<< orphan*/);
void interrupt_handler(int sig) { safe_exit(0); }


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

x86 assembly (clang, -O2):
<interrupt_handler>:
xor    %edi,%edi
jmp    1030 <safe_exit@plt>

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

LLVM IR (-O2):
define void @interrupt_handler(i32 %0) {
%2 = tail call i32 @safe_exit(i32 0)
ret void
}