xunge/DecIR huggingface dataset:
int closepower(unsigned long n) {
  int power = 0;
  if (n < 10) {
    return (10);
  }
  while (n > 0) {
    n >>= 1;
    power++;
  }
  return (1 << power);
}


x86 assembly (clang, -O0):
<closepower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0xa,-0x10(%rbp)
jae    1126 <closepower+0x26>
movl   $0xa,-0x4(%rbp)
jmp    115d <closepower+0x5d>
jmp    112b <closepower+0x2b>
cmpq   $0x0,-0x10(%rbp)
jbe    1150 <closepower+0x50>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <closepower+0x2b>
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<closepower>:
mov    $0xa,%eax
cmp    $0xa,%rdi
jb     1136 <closepower+0x36>
mov    $0xffffffff,%ecx
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
shr    %rax
add    $0x1,%ecx
cmp    $0x1,%rdi
mov    %rax,%rdi
ja     1120 <closepower+0x20>
mov    $0x2,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @closepower(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 0, i32* %4
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 10, i32* %2
br label %20
8: ; preds = %1
br label %9
9: ; preds = %12, %8
%10 = load i64, i64* %3
%11 = icmp ugt i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i64, i64* %3
%14 = lshr i64 %13, 1
store i64 %14, i64* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %9
17: ; preds = %9
%18 = load i32, i32* %4
%19 = shl i32 1, %18
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @closepower(i64 %0) {
%2 = icmp ult i64 %0, 10
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = shl i32 2, %4
br label %11
11: ; preds = %1, %9
%12 = phi i32 [ %10, %9 ], [ 10, %1 ]
ret i32 %12
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sqlGetOptQuoteString(char **);
int sqlSetParse(int /*<<< orphan*/, char **, struct hash **);
unsigned sqlSetComma(char **pS, char **values, struct hash **valHashPtr) {
  return sqlSetParse(sqlGetOptQuoteString(pS), values, valHashPtr);
}


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

x86 assembly (clang, -O2):
<sqlSetComma>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <sqlGetOptQuoteString@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sqlSetParse@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define i32 @sqlSetComma(i8** %0, i8** %1, %struct.hash** %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca %struct.hash**
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store %struct.hash** %2, %struct.hash*** %6
%7 = load i8**, i8*** %4
%8 = call i32 @sqlGetOptQuoteString(i8** %7)
%9 = load i8**, i8*** %5
%10 = load %struct.hash**, %struct.hash*** %6
%11 = call i32 @sqlSetParse(i32 %8, i8** %9, %struct.hash** %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define i32 @sqlSetComma(i8** %0, i8** %1, %struct.hash** %2) {
%4 = tail call i32 @sqlGetOptQuoteString(i8** %0)
%5 = tail call i32 @sqlSetParse(i32 %4, i8** %1, %struct.hash** %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
f(int b[], int size) {
  if (size > 0) {
    f(&b[1], size - 1);
    printf("%d ", b[0]);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115e <f+0x3e>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1030 <f@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %esi,%esi
jle    1143 <f+0x23>
push   %rbx
mov    %rdi,%rbx
add    $0x4,%rdi
add    $0xffffffff,%esi
call   1030 <f@plt>
mov    (%rbx),%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @f(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret i32 undef
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = add nsw i32 %1, -1
%8 = tail call i32 @f(i32* %6, i32 %7)
%9 = load i32, i32* %0
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void xt_par1(char *control_sequence, int parameter1) {
  printf(control_sequence, parameter1);
}


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

x86 assembly (clang, -O2):
<xt_par1>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @xt_par1(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* %0, i32 %1)
ret void
}
int pal(char s[], int start, int end) {
  if (start >= end) {
    return 1;
  }
  if (s[start] == s[end]) {
    return pal(s, start + 1, end - 1);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<pal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     113a <pal+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    117e <pal+0x6e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1177 <pal+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
call   1030 <pal@plt>
mov    %eax,-0x4(%rbp)
jmp    117e <pal+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pal>:
mov    $0x1,%eax
cmp    %edx,%esi
jge    113b <pal+0x3b>
movslq %edx,%r8
movslq %esi,%rdx
add    $0xffffffffffffffff,%r8
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rdi,%rdx,1),%ecx
cmp    0x1(%rdi,%r8,1),%cl
jne    113c <pal+0x3c>
add    $0x1,%rdx
lea    -0x1(%r8),%rcx
cmp    %r8,%rdx
mov    %rcx,%r8
jl     1120 <pal+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pal(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %20
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %16
%9 = phi i64 [ %7, %5 ], [ %17, %16 ]
%10 = phi i64 [ %6, %5 ], [ %18, %16 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
br i1 %15, label %16, label %20
16: ; preds = %8
%17 = add nsw i64 %9, 1
%18 = add nsw i64 %10, -1
%19 = icmp slt i64 %17, %18
br i1 %19, label %8, label %20
20: ; preds = %16, %8, %3
%21 = phi i32 [ 1, %3 ], [ 0, %8 ], [ 1, %16 ]
ret i32 %21
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_close;
int syscall(int /*<<< orphan*/, int);
int usfs_close(uint64_t ret_fh) { return syscall(SYS_close, (int)ret_fh); }


x86 assembly (clang, -O0):
<usfs_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usfs_close>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_close = global i32 0
define i32 @usfs_close(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @SYS_close
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i32 @syscall(i32 %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@SYS_close = global i32 0
define i32 @usfs_close(i64 %0) {
%2 = load i32, i32* @SYS_close
%3 = trunc i64 %0 to i32
%4 = tail call i32 @syscall(i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scia_tx(char);
void scia_tx_string(char *data) {
  int i = 0;
  while (data[i] != '\0') {
    scia_tx(data[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<scia_tx_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <scia_tx_string+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <scia_tx@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <scia_tx_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scia_tx_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <scia_tx_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <scia_tx@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <scia_tx_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @scia_tx_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @scia_tx(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void PGMShwMakePageWritable(void) {}


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

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

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

LLVM IR (-O2):
define void @PGMShwMakePageWritable() {
ret void
}
struct node *make_node(int data) {}


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

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

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @make_node(i32 %0) {
%2 = alloca %struct.node*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load %struct.node*, %struct.node** %2
ret %struct.node* %4
}

LLVM IR (-O2):
%struct.node = type opaque
define noalias %struct.node* @make_node(i32 %0) {
ret %struct.node* undef
}
/* Variables and functions */
int /*<<< orphan*/ SLsmg_write_nchars(char *, int);
void SLsmg_write_char(char ch) { SLsmg_write_nchars(&ch, 1); }


x86 assembly (clang, -O0):
<SLsmg_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <SLsmg_write_nchars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLsmg_write_char>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <SLsmg_write_nchars@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SLsmg_write_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @SLsmg_write_nchars(i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @SLsmg_write_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @SLsmg_write_nchars(i8* %2, i32 1)
ret void
}
void IV_FD_PUMP_INIT(struct iv_fd_pump *this) {}


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

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

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

LLVM IR (-O2):
%struct.iv_fd_pump = type opaque
define void @IV_FD_PUMP_INIT(%struct.iv_fd_pump* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int bits_setb(uint8_t *vec, size_t size, uint8_t bit) {
  if (size <= (bit >> 3)) {
    return -1;
  }
  *(vec + (bit >> 3)) |= (uint8_t)(1 << (bit & 0x07));
  return 1;
}


x86 assembly (clang, -O0):
<bits_setb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
ja     1131 <bits_setb+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <bits_setb+0x58>
mov    -0x1c(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_setb>:
mov    %edx,%eax
sar    $0x3,%eax
movslq %eax,%r8
mov    $0xffffffff,%eax
cmp    %rsi,%r8
jae    1127 <bits_setb+0x27>
and    $0x7,%dl
mov    $0x1,%esi
mov    %edx,%ecx
shl    %cl,%esi
mov    $0x1,%eax
or     %esi,(%rdi,%r8,4)
ret

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

LLVM IR (-O2):
define i32 @bits_setb(i32* nocapture %0, i64 %1, i32 %2) {
%4 = ashr i32 %2, 3
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %5, %1
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = and i32 %2, 7
%9 = shl nuw nsw i32 1, %8
%10 = getelementptr inbounds i32, i32* %0, i64 %5
%11 = load i32, i32* %10
%12 = or i32 %11, %9
store i32 %12, i32* %10
br label %13
13: ; preds = %3, %7
%14 = phi i32 [ 1, %7 ], [ -1, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void displayHelp(void) { puts("\nUsage: runner [threadCount]"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"\0AUsage: runner [threadCount]\00"
define void @displayHelp() {
%1 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0AUsage: runner [threadCount]\00"
define void @displayHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct cbor_buf {
  int dummy;
};

/* Variables and functions */
int cbor_add_utf8_str(struct cbor_buf *, char *, size_t);
size_t strlen(char *);
bool cbor_add_utf8_cstr(struct cbor_buf *buf, char *str) {
  size_t len = strlen(str);
  return cbor_add_utf8_str(buf, str, len);
}


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

x86 assembly (clang, -O2):
<cbor_add_utf8_cstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cbor_add_utf8_str@plt>

LLVM IR (-O0):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_utf8_cstr(%struct.cbor_buf* %0, i8* %1) {
%3 = alloca %struct.cbor_buf*
%4 = alloca i8*
%5 = alloca i64
store %struct.cbor_buf* %0, %struct.cbor_buf** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load %struct.cbor_buf*, %struct.cbor_buf** %3
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = call i32 @cbor_add_utf8_str(%struct.cbor_buf* %8, i8* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_utf8_cstr(%struct.cbor_buf* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @cbor_add_utf8_str(%struct.cbor_buf* %0, i8* %1, i64 %3)
ret i32 %4
}
int getMin(int value1, int value2) {
  if (value1 < value2) {
    return value1;
  } else {
    return value2;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @getMin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
size_t spinel_strnlen(const char *s, size_t maxlen) {
  size_t ret;
  for (ret = 0; (ret < maxlen) && (s[ret] != 0); ret++) {
  }
  return ret;
}


x86 assembly (clang, -O0):
<spinel_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <spinel_strnlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <spinel_strnlen+0x4c>
jmp    1162 <spinel_strnlen+0x62>
jmp    1151 <spinel_strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <spinel_strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spinel_strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <spinel_strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <spinel_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <spinel_strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @spinel_strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void report_unsupported_ioctl(char *name) {
  printf("The %s ioctl is not supported by the kernel\n", name);
}


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

x86 assembly (clang, -O2):
<report_unsupported_ioctl>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"The %s ioctl is not supported by the kernel\0A\00"
define void @report_unsupported_ioctl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"The %s ioctl is not supported by the kernel\0A\00"
define void @report_unsupported_ioctl(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int evhtp_is_hex_query_char(unsigned char ch) {
  switch (ch) {
  case 'a':
  case 'A':
  case 'b':
  case 'B':
  case 'c':
  case 'C':
  case 'd':
  case 'D':
  case 'e':
  case 'E':
  case 'f':
  case 'F':
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<evhtp_is_hex_query_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffd0,%eax
sub    $0xa,%eax
jb     114a <evhtp_is_hex_query_char+0x4a>
jmp    1122 <evhtp_is_hex_query_char+0x22>
mov    -0xc(%rbp),%eax
add    $0xffffffbf,%eax
sub    $0x6,%eax
jb     114a <evhtp_is_hex_query_char+0x4a>
jmp    1136 <evhtp_is_hex_query_char+0x36>
mov    -0xc(%rbp),%eax
add    $0xffffff9f,%eax
sub    $0x5,%eax
ja     1156 <evhtp_is_hex_query_char+0x56>
jmp    114a <evhtp_is_hex_query_char+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    115d <evhtp_is_hex_query_char+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evhtp_is_hex_query_char>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0x36,%dil
ja     111a <evhtp_is_hex_query_char+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @evhtp_is_hex_query_char(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %7 [
i32 97, label %6
i32 65, label %6
i32 98, label %6
i32 66, label %6
i32 99, label %6
i32 67, label %6
i32 100, label %6
i32 68, label %6
i32 101, label %6
i32 69, label %6
i32 102, label %6
i32 70, label %6
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 56, label %6
i32 57, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.evhtp_is_hex_query_char = [55 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @evhtp_is_hex_query_char(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 55
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [55 x i32], [55 x i32]* @switch.table.evhtp_is_hex_query_char, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
void l2(int a, int b) {}


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

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

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

LLVM IR (-O2):
define void @l2(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void svg_export_path_end(FILE *f) { fprintf(f, "</path>\n"); }


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

x86 assembly (clang, -O2):
<svg_export_path_end>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"</path>\0A\00"
define void @svg_export_path_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"</path>\0A\00"
define void @svg_export_path_end(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i64 1, i32* %0)
ret void
}
int main(void) {
  5 || "&";
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_sqrt();
scalar_t__ sqrt(double);
void test_sqrt(double d) {
  if (sqrt(d) != sqrt(d))
    link_failure_sqrt();
}


x86 assembly (clang, -O0):
<test_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_sqrt+0x3c>
mov    $0x0,%al
call   1040 <link_failure_sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sqrt>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sqrt@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <sqrt@plt>
cmp    %rax,%rbx
jne    1149 <test_sqrt+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_sqrt@plt>

LLVM IR (-O0):
define void @test_sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @sqrt(double %3)
%5 = load double, double* %2
%6 = call i64 @sqrt(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_sqrt()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_sqrt(double %0) {
%2 = tail call i64 @sqrt(double %0)
%3 = tail call i64 @sqrt(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_sqrt()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int ueld_block_signal(int signum) {
  sigset_t set, oset;
  sigemptyset(&set);
  sigaddset(&set, signum);
  return sigprocmask(SIG_BLOCK, &set, &oset);
}


x86 assembly (clang, -O0):
<ueld_block_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ueld_block_signal>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
mov    %r14,%rsi
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @ueld_block_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @sigaddset(i32* %3, i32 %6)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %3, i32* %4)
ret i32 %9
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @ueld_block_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sigemptyset(i32* %2)
%7 = call i32 @sigaddset(i32* %2, i32 %0)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32* %3)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ abort_if_null(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *obtain_file_handle(char *filename, char *attr) {
  FILE *fp;
  fp = fopen(filename, attr);
  abort_if_null(fp, "Imposible abrir el archivo para escribir.\n");
  return fp;
}


x86 assembly (clang, -O0):
<obtain_file_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <abort_if_null@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obtain_file_handle>:
push   %rbx
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xed0(%rip),%rsi
mov    %rax,%rdi
call   1030 <abort_if_null@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Imposible abrir el archivo para escribir.\0A\00"
define i32* @obtain_file_handle(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = call i32 @abort_if_null(i32* %9, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%11 = load i32*, i32** %5
ret i32* %11
}

LLVM IR (-O2):
@.str = [43 x i8] c"Imposible abrir el archivo para escribir.\0A\00"
define i32* @obtain_file_handle(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = tail call i32 @abort_if_null(i32* %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ perror(char *);
int posix_memalign(void **, int, unsigned int);
void *malloc_aligned(unsigned int size) {
  void *ptr;
  int r = posix_memalign(&ptr, 256, size);
  if (r != 0) {
    perror("malloc error");
    abort();
  }
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<malloc_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    -0x10(%rbp),%rdi
mov    $0x100,%esi
call   1060 <posix_memalign@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     117c <malloc_aligned+0x3c>
lea    0xe90(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_aligned>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
mov    $0x100,%esi
mov    %ebx,%edx
call   1060 <posix_memalign@plt>
test   %eax,%eax
jne    1175 <malloc_aligned+0x35>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1040 <memset@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe84(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"malloc error\00"
define i8* @malloc_aligned(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @posix_memalign(i8** %3, i32 256, i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = load i32, i32* %2
%15 = call i32 @memset(i8* %13, i32 0, i32 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [13 x i8] c"malloc error\00"
define i8* @malloc_aligned(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @posix_memalign(i8** %2, i32 256, i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @memset(i8* %10, i32 0, i32 %0)
%12 = load i8*, i8** %2
ret i8* %12
}
void ble_evt_system_script_failure(
    const struct ble_msg_system_script_failure_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_script_failure_evt_t = type opaque
define void @ble_evt_system_script_failure(%struct.ble_msg_system_script_failure_evt_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float stdlib_strided_sdsmeanors(int /*<<< orphan*/ const, float const *,
                                int /*<<< orphan*/ const);
float stdlib_strided_sdsmean(const int64_t N, const float *X,
                             const int64_t stride) {
  return stdlib_strided_sdsmeanors(N, X, stride);
}


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

x86 assembly (clang, -O2):
<stdlib_strided_sdsmean>:
jmp    1030 <stdlib_strided_sdsmeanors@plt>

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

LLVM IR (-O2):
define float @stdlib_strided_sdsmean(i32 %0, float* %1, i32 %2) {
%4 = tail call float @stdlib_strided_sdsmeanors(i32 %0, float* %1, i32 %2)
ret float %4
}
/* Variables and functions */
int partition(char *, int, int);
void __quick_sort(char str[], int low, int high) {
  int pivot;
  if (low < high) {
    pivot = partition(str, low, high);
    __quick_sort(str, low, pivot - 1);
    __quick_sort(str, pivot + 1, high);
  }
}


x86 assembly (clang, -O0):
<__quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <__quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <__quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <__quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <__quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <__quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <__quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @__quick_sort(i8* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i8* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @__quick_sort(i8* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ executeProgram(char *, int);
int /*<<< orphan*/ initializeProcessTable();
int /*<<< orphan*/ makeInterrupt21();
int /*<<< orphan*/ makeTimerInterrupt();
int main() {
  makeInterrupt21();
  initializeProcessTable();
  executeProgram("shell", 8 + 2);
  makeTimerInterrupt();
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <makeInterrupt21@plt>
mov    $0x0,%al
call   1040 <initializeProcessTable@plt>
lea    0xe9c(%rip),%rdi
mov    $0xa,%esi
call   1060 <executeProgram@plt>
mov    $0x0,%al
call   1030 <makeTimerInterrupt@plt>
jmp    1175 <main+0x35>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <makeInterrupt21@plt>
xor    %eax,%eax
call   1040 <initializeProcessTable@plt>
lea    0xeaa(%rip),%rdi
mov    $0xa,%esi
call   1060 <executeProgram@plt>
xor    %eax,%eax
call   1030 <makeTimerInterrupt@plt>
nopw   0x0(%rax,%rax,1)
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [6 x i8] c"shell\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @makeInterrupt21()
%3 = call i32 (...) @initializeProcessTable()
%4 = call i32 @executeProgram(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = call i32 (...) @makeTimerInterrupt()
br label %6
6: ; preds = %0, %6
br label %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"shell\00"
define i32 @main() {
%1 = tail call i32 (...) @makeInterrupt21()
%2 = tail call i32 (...) @initializeProcessTable()
%3 = tail call i32 @executeProgram(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = tail call i32 (...) @makeTimerInterrupt()
br label %5
5: ; preds = %0, %5
br label %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool SysCtlPeripheralReady(uint32_t ui32Peripheral) {
  ;
  return ((*(
      (volatile unsigned long
           *)(((unsigned long)(0x400fea00 + ((ui32Peripheral & 0xff00) >> 8)) &
               0xF0000000) |
              0x02000000 |
              (((unsigned long)(0x400fea00 + ((ui32Peripheral & 0xff00) >> 8)) &
                0x000FFFFF)
               << 5) |
              ((ui32Peripheral & 0xff) << 2)))));
}


x86 assembly (clang, -O0):
<SysCtlPeripheralReady>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
add    $0x400fea00,%eax
cltq
movabs $0xf0000000,%rcx
and    %rcx,%rax
or     $0x2000000,%rax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
add    $0x400fea00,%ecx
movslq %ecx,%rcx
and    $0xfffff,%rcx
shl    $0x5,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPeripheralReady>:
movzbl %dil,%eax
shr    $0x3,%edi
and    $0x1fe0,%edi
shl    $0x2,%eax
or     %edi,%eax
mov    0x43fd4000(%rax),%rax
ret

LLVM IR (-O0):
define i32 @SysCtlPeripheralReady(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = add nsw i32 1074784768, %5
%7 = sext i32 %6 to i64
%8 = and i64 %7, 4026531840
%9 = or i64 %8, 33554432
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = add nsw i32 1074784768, %12
%14 = sext i32 %13 to i64
%15 = and i64 %14, 1048575
%16 = shl i64 %15, 5
%17 = or i64 %9, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 255
%20 = shl i32 %19, 2
%21 = sext i32 %20 to i64
%22 = or i64 %17, %21
%23 = inttoptr i64 %22 to i64*
%24 = load volatile i64, i64* %23
%25 = trunc i64 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @SysCtlPeripheralReady(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 8160
%4 = shl i32 %0, 2
%5 = and i32 %4, 1020
%6 = or i32 %5, %3
%7 = or i32 %6, 1140670464
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ wt(unsigned int, int);
void clear_meter(int meter_id) {
  unsigned int meter_addr_base;
  meter_addr_base = 0x49000000 | (meter_id << 0x08);
  wt(meter_addr_base, 1);
  wt(meter_addr_base + 4, 1);
}


x86 assembly (clang, -O0):
<clear_meter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
or     $0x49000000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <wt@plt>
mov    -0x8(%rbp),%edi
add    $0x4,%edi
mov    $0x1,%esi
call   1030 <wt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_meter>:
push   %rbx
mov    %edi,%ebx
shl    $0x8,%ebx
mov    %ebx,%edi
or     $0x49000000,%edi
mov    $0x1,%esi
call   1030 <wt@plt>
or     $0x49000004,%ebx
mov    %ebx,%edi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <wt@plt>

LLVM IR (-O0):
define void @clear_meter(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 8
%6 = or i32 1224736768, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @wt(i32 %7, i32 1)
%9 = load i32, i32* %3
%10 = add i32 %9, 4
%11 = call i32 @wt(i32 %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @clear_meter(i32 %0) {
%2 = shl i32 %0, 8
%3 = or i32 %2, 1224736768
%4 = tail call i32 @wt(i32 %3, i32 1)
%5 = or i32 %2, 1224736772
%6 = tail call i32 @wt(i32 %5, i32 1)
ret void
}