xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int stringToInt(char str[]) {
  int result;
  sscanf(str, "%d", &result);
  if ((result < -999999 && result != -9999999) || (result > 999999))
    return -8888888;
  return result;
}


x86 assembly (clang, -O0):
<stringToInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <sscanf@plt>
cmpl   $0xfff0bdc1,-0x14(%rbp)
jge    114a <stringToInt+0x3a>
cmpl   $0xff676981,-0x14(%rbp)
jne    1157 <stringToInt+0x47>
cmpl   $0xf423f,-0x14(%rbp)
jle    1163 <stringToInt+0x53>
movl   $0xff785dc8,-0x4(%rbp)
jmp    1169 <stringToInt+0x59>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringToInt>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%ecx
cmp    $0xff676981,%ecx
mov    $0xff785dc8,%edx
mov    %ecx,%eax
cmovne %edx,%eax
cmp    $0xfff0bdc1,%ecx
cmovge %ecx,%eax
cmp    $0xf4240,%ecx
cmovge %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @stringToInt(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, -999999
%7 = icmp ne i32 %5, -9999999
%8 = and i1 %6, %7
%9 = icmp sgt i32 %5, 999999
%10 = or i1 %9, %8
%11 = select i1 %10, i32 -8888888, i32 %5
ret i32 %11
}
/* Variables and functions */
char tolower(char);
char towlower(char x) { return tolower(x); }


x86 assembly (clang, -O0):
<towlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towlower>:
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define signext i8 @towlower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @tolower(i8 signext %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @towlower(i8 signext %0) {
%2 = tail call signext i8 @tolower(i8 signext %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char const, int);
void ft_putstr_fd(char const *str, int fd) {
  while (*str) {
    ft_putchar_fd(*str, fd);
    str++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <ft_putstr_fd+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   1030 <ft_putchar_fd@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <ft_putstr_fd+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <ft_putstr_fd+0x35>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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


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

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

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

LLVM IR (-O2):
define void @opt_readline_init(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t next_pow_of_2(uint32_t x) {
  --x;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  return x + 1;
}


x86 assembly (clang, -O0):
<next_pow_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_pow_of_2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @next_pow_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
ret i32 %26
}

LLVM IR (-O2):
define i32 @next_pow_of_2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
char itox(int i) {
  i &= 0xF;
  return (char)(i > 9 ? i + 55 : i + '0');
}


x86 assembly (clang, -O0):
<itox>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    1128 <itox+0x28>
mov    -0x4(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <itox+0x31>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itox>:
and    $0xf,%edi
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
cmp    $0xa,%edi
movzbl %cl,%ecx
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @itox(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 9
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 55
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 48
br label %13
13: ; preds = %10, %7
%14 = phi i32 [ %9, %7 ], [ %12, %10 ]
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @itox(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp ugt i32 %2, 9
%4 = add nuw nsw i32 %2, 55
%5 = or i32 %2, 48
%6 = select i1 %3, i32 %4, i32 %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    printf("%d\n", i * 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1172 <main+0x52>
mov    -0xc(%rbp),%esi
shl    $0x1,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1166 <main+0x46>
xor    %ebp,%ebp
mov    $0x2,%ebx
lea    0xeb5(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x2,%ebx
cmp    0xc(%rsp),%ebp
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %7, %0
ret i32 0
7: ; preds = %0, %7
%8 = phi i32 [ %11, %7 ], [ 1, %0 ]
%9 = shl nuw nsw i32 %8, 1
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i32 %8, 1
%12 = load i32, i32* %1
%13 = icmp slt i32 %8, %12
br i1 %13, label %7, label %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, char *, char);
void term_set_title(char *title) {
  printf("%s%d;%s%c", "\033]", 0, title, '\007');
}


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

x86 assembly (clang, -O2):
<term_set_title>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
mov    $0x7,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s%d;%s%c\00"
@.str.1 = [3 x i8] c"\1B]\00"
define void @term_set_title(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0, i8* %3, i8 signext 7)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s%d;%s%c\00"
@.str.1 = [3 x i8] c"\1B]\00"
define void @term_set_title(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0, i8* %0, i8 signext 7)
ret void
}
int test21(int *q, int *x) {
  if (q)
    ;
  if (x)
    ;
  int *p = q;
  return *p;
}


x86 assembly (clang, -O0):
<test21>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111c <test21+0x1c>
jmp    111c <test21+0x1c>
cmpq   $0x0,-0x10(%rbp)
je     112c <test21+0x2c>
jmp    112c <test21+0x2c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test21>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @test21(i32* nocapture %0, i32* nocapture readnone %1) {
%3 = load i32, i32* %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t bytecode_store(uint8_t r0, uint16_t addr) {
  return _bytecode_write(7, 0, addr, r0, 0, 0);
}


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

x86 assembly (clang, -O2):
<bytecode_store>:
mov    %esi,%edx
mov    %edi,%ecx
mov    $0x7,%edi
xor    %esi,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_bytecode_write@plt>

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

LLVM IR (-O2):
define i32 @bytecode_store(i32 %0, i32 %1) {
%3 = tail call i32 @_bytecode_write(i32 7, i32 0, i32 %1, i32 %0, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("EOF = [%d]\n", (int)EOF);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"EOF = [%d]\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = load i64, i64* @EOF
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int sort_source(void const *, void const *);
int sort_source_reverse(const void *a, const void *b) {
  return sort_source(b, a);
}


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

x86 assembly (clang, -O2):
<sort_source_reverse>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <sort_source@plt>

LLVM IR (-O0):
define i32 @sort_source_reverse(i8* %0, i8* %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
%7 = call i32 @sort_source(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sort_source_reverse(i8* %0, i8* %1) {
%3 = tail call i32 @sort_source(i8* %1, i8* %0)
ret i32 %3
}
void sd_packarg(unsigned char *argument, unsigned int value) {
  argument[3] = (unsigned char)(value >> 24);
  argument[2] = (unsigned char)(value >> 16);
  argument[1] = (unsigned char)(value >> 8);
  argument[0] = (unsigned char)(value);
}


x86 assembly (clang, -O0):
<sd_packarg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_packarg>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @sd_packarg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 3
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8 %12, i8* %14
%15 = load i32, i32* %4
%16 = lshr i32 %15, 8
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
%20 = load i32, i32* %4
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @sd_packarg(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %4, i8* %5
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %8
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %10, i8* %11
%12 = trunc i32 %1 to i8
store i8 %12, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
scalar_t__ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          void *(*)(void *), void *);
int /*<<< orphan*/ terminal_error(char *);
void create_pthread(pthread_t *thread, pthread_attr_t *attr,
                    void *(*start_routine)(void *), void *arg) {
  if (pthread_create(thread, attr, start_routine, arg))
    terminal_error("pthread_create");
}


x86 assembly (clang, -O0):
<create_pthread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <pthread_create@plt>
cmp    $0x0,%rax
je     1163 <create_pthread+0x43>
lea    0xea2(%rip),%rdi
call   1040 <terminal_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_pthread>:
push   %rax
call   1030 <pthread_create@plt>
test   %rax,%rax
je     1138 <create_pthread+0x18>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <terminal_error@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"pthread_create\00"
define void @create_pthread(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = tail call i64 @pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @terminal_error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int strlen(char *);
void chomp(char *str) {
  int i = strlen(str) - 1;
  while ((i > 0) && (str[i] < ' ')) {
    str[i--] = 0;
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    114f <chomp+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115f <chomp+0x4f>
jmp    117a <chomp+0x6a>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    112b <chomp+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     1147 <chomp+0x37>
mov    %eax,%eax
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x2(%rax),%ecx
cmpb   $0x1f,(%rbx,%rcx,1)
jg     1147 <chomp+0x37>
movb   $0x0,(%rbx,%rcx,1)
add    $0xffffffffffffffff,%rax
cmp    $0x2,%rax
ja     1130 <chomp+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %15
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ %5, %4 ], [ %8, %13 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp slt i8 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %6
store i8 0, i8* %10
%14 = icmp ugt i64 %7, 2
br i1 %14, label %6, label %15
15: ; preds = %6, %13, %1
ret void
}
int fun294() { return 294; }


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

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

LLVM IR (-O0):
define i32 @fun294() {
ret i32 294
}

LLVM IR (-O2):
define i32 @fun294() {
ret i32 294
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
ssize_t pwritev(int fd, const struct iovec *vector, int count, off_t offset) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<pwritev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwritev>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
@ENOSYS = global i32 0
define i32 @pwritev(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.iovec*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.iovec* %1, %struct.iovec** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret i32 -1
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@ENOSYS = global i32 0
define i32 @pwritev(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2, i32 %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
puts(s) char *s;
{
  while (*s)
    putchar(*s++);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <puts+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %12)
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @puts(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 i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int __set_memory(unsigned long, int, unsigned long);
int set_memory_ro(unsigned long addr, int numpages) {
  return __set_memory(addr, numpages, 1UL);
}


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

x86 assembly (clang, -O2):
<set_memory_ro>:
mov    $0x1,%edx
jmp    1030 <__set_memory@plt>

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

LLVM IR (-O2):
define i32 @set_memory_ro(i64 %0, i32 %1) {
%3 = tail call i32 @__set_memory(i64 %0, i32 %1, i64 1)
ret i32 %3
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
unsigned int mput1(unsigned int value, uint8_t *data) {
  data[0] = value & 0xff;
  return data[0];
}


x86 assembly (clang, -O0):
<mput1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mput1>:
movzbl %dil,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define i32 @mput1(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mput1(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
store i32 %3, i32* %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ignore_whitespace(int /*<<< orphan*/ *);
int /*<<< orphan*/ sysbuild_warning(char *);
int read_equal(FILE *config_fp) {
  int c;
  if ((c = ignore_whitespace(config_fp)) != '=') {
    sysbuild_warning("Failed to find expected '='");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<read_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ignore_whitespace@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x3d,%eax
je     1159 <read_equal+0x39>
lea    0xeb8(%rip),%rdi
call   1040 <sysbuild_warning@plt>
movl   $0x0,-0x4(%rbp)
jmp    1160 <read_equal+0x40>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_equal>:
push   %rax
call   1030 <ignore_whitespace@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x3d,%ecx
je     1140 <read_equal+0x20>
lea    0xec7(%rip),%rdi
call   1040 <sysbuild_warning@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Failed to find expected '='\00"
define i32 @read_equal(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @ignore_whitespace(i32* %5)
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 61
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @sysbuild_warning(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [28 x i8] c"Failed to find expected '='\00"
define i32 @read_equal(i32* %0) {
%2 = tail call i32 @ignore_whitespace(i32* %0)
%3 = icmp eq i32 %2, 61
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @sysbuild_warning(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_mode_change_event_get_status(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<hci_event_mode_change_event_get_status>:
mov    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hci_event_mode_change_event_get_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_mode_change_event_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int close_xml_(int fd) {
  char *XML_close = "</sphinx:docset>";
  int bwrite = 0;
  bwrite = write(fd, XML_close, strlen(XML_close));
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<close_xml_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_xml_>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xec3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"</sphinx:docset>\00"
define i32 @close_xml_(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"</sphinx:docset>\00"
define i32 @close_xml_(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @close(i32 %0)
ret i32 0
}
/* Variables and functions */
scalar_t__ SQL_connect();
int sql_init() {
  if (SQL_connect()) {
    return (-1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<sql_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <SQL_connect@plt>
cmp    $0x0,%rax
je     1135 <sql_init+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    113c <sql_init+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sql_init>:
push   %rax
xor    %eax,%eax
call   1030 <SQL_connect@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sql_init() {
%1 = alloca i32
%2 = call i64 (...) @SQL_connect()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @sql_init() {
%1 = tail call i64 (...) @SQL_connect()
%2 = icmp ne i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ STDERR_FILENO;
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
int write(int /*<<< orphan*/, char *, int);
int vprintf(const char *fmt, va_list ap) {
  int result;
  char buf[BUFSIZ];
  result = vsnprintf(buf, BUFSIZ, fmt, ap);
  return write(STDERR_FILENO, buf, result);
}


x86 assembly (clang, -O0):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    -0x28(%rbp),%rsi
mov    %eax,-0x10(%rbp)
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
call   1040 <write@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <vsnprintf@plt>
mov    0x2e81(%rip),%rcx
mov    (%rcx),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@STDERR_FILENO = global i32 0
define i32 @vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* @BUFSIZ
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %6
%11 = alloca i8, i64 %9
store i64 %9, i64* %7
%12 = load i32, i32* @BUFSIZ
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @vsnprintf(i8* %11, i32 %12, i8* %13, i32 %14)
store i32 %15, i32* %5
%16 = load i32, i32* @STDERR_FILENO
%17 = load i32, i32* %5
%18 = call i32 @write(i32 %16, i8* %11, i32 %17)
%19 = load i8*, i8** %6
ret i32 %18
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@STDERR_FILENO = global i32 0
define i32 @vprintf(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @vsnprintf(i8* %5, i32 %3, i8* %0, i32 %1)
%7 = load i32, i32* @STDERR_FILENO
%8 = call i32 @write(i32 %7, i8* %5, i32 %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EOF;
int /*<<< orphan*/ csyntax(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  csyntax(EOF);
  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)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <csyntax@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <csyntax@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
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 = load i32, i32* @EOF
%7 = call i32 @csyntax(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EOF
%4 = tail call i32 @csyntax(i32 %3)
ret i32 0
}
/* Variables and functions */
int tailleChaine(char *);
char caractereChaine(char chaine[], int indice) {
  if (indice >= tailleChaine(chaine)) {
    return -1;
  }
  return chaine[indice];
}


x86 assembly (clang, -O0):
<caractereChaine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <tailleChaine@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jl     1144 <caractereChaine+0x34>
movb   $0xff,-0x1(%rbp)
jmp    1152 <caractereChaine+0x42>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caractereChaine>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <tailleChaine@plt>
mov    %eax,%ecx
mov    $0xff,%al
cmp    %ebp,%ecx
jle    112b <caractereChaine+0x1b>
movslq %ebp,%rax
mov    (%rbx,%rax,1),%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @caractereChaine(i8* %0, i32 %1) {
%3 = tail call i32 @tailleChaine(i8* %0)
%4 = icmp sgt i32 %3, %1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
br label %9
9: ; preds = %2, %5
%10 = phi i8 [ %8, %5 ], [ -1, %2 ]
ret i8 %10
}
float hms2d(float hms) {
  int hours;
  float decimals;
  hours = (int)hms;
  decimals = (hms - hours) * 10 / 6;
  return (hours + decimals);
}


x86 assembly (clang, -O0):
<hms2d>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  0xedd(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xecd(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hms2d>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
mulss  0xeed(%rip),%xmm0
divss  0xee9(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @hms2d(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = fptosi float %5 to i32
store i32 %6, i32* %3
%7 = load float, float* %2
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to float
%10 = fsub float %7, %9
%11 = fmul float %10, 1.000000e+01
%12 = fdiv float %11, 6.000000e+00
store float %12, float* %4
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to float
%15 = load float, float* %4
%16 = fadd float %14, %15
ret float %16
}

LLVM IR (-O2):
define float @hms2d(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fsub float %0, %3
%5 = fmul float %4, 1.000000e+01
%6 = fdiv float %5, 6.000000e+00
%7 = fadd float %6, %3
ret float %7
}
/* Type definitions */
struct oscap_stringlist {
  int dummy;
};

/* Variables and functions */
scalar_t__ oscap_list_new();
struct oscap_stringlist *oscap_stringlist_new(void) {
  return (struct oscap_stringlist *)oscap_list_new();
}


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

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

LLVM IR (-O0):
%struct.oscap_stringlist = type { i32 }
define %struct.oscap_stringlist* @oscap_stringlist_new() {
%1 = call i64 (...) @oscap_list_new()
%2 = inttoptr i64 %1 to %struct.oscap_stringlist*
ret %struct.oscap_stringlist* %2
}

LLVM IR (-O2):
%struct.oscap_stringlist = type { i32 }
define %struct.oscap_stringlist* @oscap_stringlist_new() {
%1 = tail call i64 (...) @oscap_list_new()
%2 = inttoptr i64 %1 to %struct.oscap_stringlist*
ret %struct.oscap_stringlist* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_errlogf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ menu_reset_console();
void int_handler(int sig) {
  menu_reset_console();
  log_errlogf(0, "Interrupt\n");
  exit(1);
}


x86 assembly (clang, -O0):
<int_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <menu_reset_console@plt>
xor    %edi,%edi
lea    0xeb5(%rip),%rsi
call   1030 <log_errlogf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<int_handler>:
push   %rax
xor    %eax,%eax
call   1040 <menu_reset_console@plt>
lea    0xec1(%rip),%rsi
xor    %edi,%edi
call   1030 <log_errlogf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Interrupt\0A\00"
define void @int_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @menu_reset_console()
%4 = call i32 @log_errlogf(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Interrupt\0A\00"
define void @int_handler(i32 %0) {
%2 = tail call i32 (...) @menu_reset_console()
%3 = tail call i32 @log_errlogf(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
int kgsl_mmu_stop(struct kgsl_device *device) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kgsl_device = type opaque
define i32 @kgsl_mmu_stop(%struct.kgsl_device* nocapture readnone %0) {
ret i32 0
}
void swr_drop_output() {}


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

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

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

LLVM IR (-O2):
define void @swr_drop_output() {
ret void
}
/* Variables and functions */
int db_revision();
int pi_db_revision(void) { return db_revision(); }


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

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

LLVM IR (-O0):
define i32 @pi_db_revision() {
%1 = call i32 (...) @db_revision()
ret i32 %1
}

LLVM IR (-O2):
define i32 @pi_db_revision() {
%1 = tail call i32 (...) @db_revision()
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void LCDRasterSubPanelEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000038))) |= 0x80000000;
}


x86 assembly (clang, -O0):
<LCDRasterSubPanelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rcx
movabs $0x80000000,%rdx
or     %rdx,%rcx
mov    %rcx,0x38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterSubPanelEnable>:
mov    $0x80000000,%eax
or     %rax,0x38(%rdi)
ret

LLVM IR (-O0):
define void @LCDRasterSubPanelEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 56
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 2147483648
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @LCDRasterSubPanelEnable(i64 %0) {
%2 = add nsw i64 %0, 56
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 2147483648
store volatile i64 %5, i64* %3
ret void
}