xunge/DecIR huggingface dataset:
/* Variables and functions */
int ft_strlen(char *);
char *ft_strrev(char *str) {
  int len;
  int i;
  i = 0;
  len = ft_strlen(str);
  while (len > 0) {
    str = &str[len - 1];
    len--;
    str++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<ft_strrev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1167 <ft_strrev+0x57>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ft_strrev+0x1f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strrev>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ft_strlen@plt>
test   %eax,%eax
jle    113c <ft_strrev+0x2c>
lea    -0x1(%rax),%ecx
lea    0x1(%rcx),%rdx
imul   %rcx,%rdx
add    $0xfffffffe,%eax
imul   %rcx,%rax
shr    %rax
sub    %rax,%rdx
add    %rdx,%rbx
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_strrev(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = add nuw nsw i64 %6, 1
%8 = mul nuw nsw i64 %7, %6
%9 = add nuw nsw i64 %8, 1
%10 = zext i32 %5 to i64
%11 = add nsw i32 %2, -2
%12 = zext i32 %11 to i64
%13 = mul nuw nsw i64 %10, %12
%14 = lshr i64 %13, 1
%15 = sub nsw i64 %9, %14
%16 = getelementptr i8, i8* %0, i64 %15
br label %17
17: ; preds = %4, %1
%18 = phi i8* [ %0, %1 ], [ %16, %4 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void stack_underflow(void) {
  printf("Not enough operands\n");
  exit(1);
}


x86 assembly (clang, -O0):
<stack_underflow>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stack_underflow>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Not enough operands\0A\00"
define void @stack_underflow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [20 x i8] c"Not enough operands\00"
define void @stack_underflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void f(int p) {}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
unsigned long ULONG_MAX;
int expect_unsigned_long_sum(unsigned long (*f)(unsigned long, unsigned long)) {
  return f(ULONG_MAX - 1, 1) == ULONG_MAX;
}


x86 assembly (clang, -O0):
<expect_unsigned_long_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%rdi
sub    $0x1,%rdi
mov    $0x1,%esi
call   *%rax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_unsigned_long_sum>:
push   %rbx
mov    %rdi,%rax
mov    0x2ecd(%rip),%rbx
mov    (%rbx),%rdi
add    $0xffffffffffffffff,%rdi
mov    $0x1,%esi
call   *%rax
xor    %ecx,%ecx
cmp    (%rbx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@ULONG_MAX = global i64 0
define i32 @expect_unsigned_long_sum(i64 (i64, i64)* %0) {
%2 = alloca i64 (i64, i64)*
store i64 (i64, i64)* %0, i64 (i64, i64)** %2
%3 = load i64 (i64, i64)*, i64 (i64, i64)** %2
%4 = load i64, i64* @ULONG_MAX
%5 = sub i64 %4, 1
%6 = call i64 %3(i64 %5, i64 1)
%7 = load i64, i64* @ULONG_MAX
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@ULONG_MAX = global i64 0
define i32 @expect_unsigned_long_sum(i64 (i64, i64)* nocapture %0) {
%2 = load i64, i64* @ULONG_MAX
%3 = add i64 %2, -1
%4 = tail call i64 %0(i64 %3, i64 1)
%5 = load i64, i64* @ULONG_MAX
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ isalnum(int);
int _isalnum(int c) { return isalnum(c) && c < 0x7f; }


x86 assembly (clang, -O0):
<_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     113f <_isalnum+0x2f>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x7f,%ebx
setl   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 127
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @_isalnum(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp slt i32 %0, 127
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int japi_menubar(int);
int j_menubar(int arg0) { return (japi_menubar(arg0)); }


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

x86 assembly (clang, -O2):
<j_menubar>:
jmp    1030 <japi_menubar@plt>

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

LLVM IR (-O2):
define i32 @j_menubar(i32 %0) {
%2 = tail call i32 @japi_menubar(i32 %0)
ret i32 %2
}
void write_ss(unsigned val) {
  asm volatile("mov %0, %%ss" : : "rm"(val) : "memory");
}


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

x86 assembly (clang, -O2):
<write_ss>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%ss
ret

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

LLVM IR (-O2):
define void @write_ss(i32 %0) {
tail call void asm sideeffect "mov $0, %ss", "rm,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
void rot_word(unsigned char *w) {
  unsigned char tmp;
  tmp = w[0];
  w[0] = w[1];
  w[1] = w[2];
  w[2] = w[3];
  w[3] = tmp;
}


x86 assembly (clang, -O0):
<rot_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot_word>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
mov    %cl,(%rdi)
movzwl 0x2(%rdi),%ecx
mov    %cx,0x1(%rdi)
mov    %al,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @rot_word(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %2, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_calories(double, double, double);
int main() {
  display_calories(115.2, 11.3, 0.79);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  0xed9(%rip),%xmm1
movsd  0xed9(%rip),%xmm2
call   1030 <display_calories@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
movsd  0xee7(%rip),%xmm2
call   1030 <display_calories@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @display_calories(double 1.152000e+02, double 1.130000e+01, double 7.900000e-01)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @display_calories(double 1.152000e+02, double 1.130000e+01, double 7.900000e-01)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void endNcurses() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @endNcurses() {
%1 = tail call i32 (...) @endwin()
ret void
}
void link_error4() {}


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

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

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

LLVM IR (-O2):
define void @link_error4() {
ret void
}
void strcpys(char *s, char *t) {
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<strcpys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strcpys+0x3b>
jmp    110c <strcpys+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpys>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpys+0x10>
ret

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

LLVM IR (-O2):
define void @strcpys(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int reverseNumber(int num) {
  int reversed = 0;
  while (num > 1) {
    reversed += num % 10;
    num /= 10;
    if (num >= 1)
      reversed *= 10;
  }
  if (num == 1)
    reversed += 1;
  return reversed;
}


x86 assembly (clang, -O0):
<reverseNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    114d <reverseNumber+0x4d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     1148 <reverseNumber+0x48>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110e <reverseNumber+0xe>
cmpl   $0x1,-0x4(%rbp)
jne    1160 <reverseNumber+0x60>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseNumber>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jl     113b <reverseNumber+0x3b>
xor    %ecx,%ecx
mov    $0xcccccccd,%r8d
nop
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%eax
sub    %esi,%eax
add    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    $0xa,%edi
lea    (%rcx,%rcx,4),%ecx
cmovb  %eax,%ecx
cmp    $0x13,%edi
mov    %edx,%edi
ja     1110 <reverseNumber+0x10>
jmp    113d <reverseNumber+0x3d>
mov    %edi,%edx
xor    %eax,%eax
cmp    $0x1,%edx
sete   %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @reverseNumber(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32, i32* %2
%9 = srem i32 %8, 10
%10 = load i32, i32* %3
%11 = add nsw i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 10
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = icmp sge i32 %14, 1
br i1 %15, label %16, label %19
16: ; preds = %7
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 10
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %7
br label %4
20: ; preds = %4
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %26
26: ; preds = %23, %20
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @reverseNumber(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = udiv i32 %5, 10
%9 = icmp ugt i32 %5, 9
%10 = mul nsw i32 %7, 10
%11 = select i1 %9, i32 %10, i32 %7
%12 = icmp ugt i32 %5, 19
br i1 %12, label %3, label %13
13: ; preds = %3, %1
%14 = phi i32 [ %0, %1 ], [ %8, %3 ]
%15 = phi i32 [ 0, %1 ], [ %11, %3 ]
%16 = icmp eq i32 %14, 1
%17 = zext i1 %16 to i32
%18 = add nsw i32 %15, %17
ret i32 %18
}
void gnttab_unmap_grant_ref() {}


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

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

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

LLVM IR (-O2):
define void @gnttab_unmap_grant_ref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x19() {
  Assert_real((isalnum(25) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              130, ("isalnum should be 0 for 0x19"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x19>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x82,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x19>:
push   %rax
mov    $0x19,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x82,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x19\00"
define void @t_isalnum_0x19() {
%1 = call i64 @isalnum(i32 25)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x19\00"
define void @t_isalnum_0x19() {
%1 = tail call i64 @isalnum(i32 25)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_persist_str(char *str) { free(str); }


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

x86 assembly (clang, -O2):
<free_persist_str>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_persist_str(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void send_cmd(unsigned cmd) { (*(volatile unsigned char *)0x4E000008) = cmd; }


x86 assembly (clang, -O0):
<send_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x4e000008,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd>:
mov    %dil,0x4e000008
4e
ret

LLVM IR (-O0):
define void @send_cmd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 1308622856 to i8*)
ret void
}

LLVM IR (-O2):
define void @send_cmd(i32 %0) {
%2 = trunc i32 %0 to i8
store volatile i8 %2, i8* inttoptr (i64 1308622856 to i8*)
ret void
}
char *__attribute__((stdcall)) AIL_set_redist_directory(const char *dir) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @AIL_set_redist_directory(i8* nocapture readnone %0) {
ret i8* null
}
int Scale(int counter) {
  int a;
  int result = 0;
  for (a = 1; a <= counter; a++) {
    result = result * 0x02 + 0x01;
  }
  return result;
}


x86 assembly (clang, -O0):
<Scale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113b <Scale+0x3b>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <Scale+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scale>:
test   %edi,%edi
jle    1115 <Scale+0x15>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    1118 <Scale+0x18>
xor    %eax,%eax
jmp    112d <Scale+0x2d>
xor    %eax,%eax
ret
and    $0xfffffff8,%edi
xor    %eax,%eax
nopl   (%rax)
shl    $0x8,%eax
or     $0xff,%eax
add    $0xfffffff8,%edi
jne    1120 <Scale+0x20>
test   %ecx,%ecx
je     114a <Scale+0x4a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %eax,%eax
add    $0x1,%eax
add    $0xffffffff,%ecx
jne    1140 <Scale+0x40>
ret

LLVM IR (-O0):
define i32 @Scale(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %13, %1
%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* %4
%11 = mul nsw i32 %10, 2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
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
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @Scale(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %27, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %16, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 0, %7 ], [ %13, %9 ]
%11 = phi i32 [ 0, %7 ], [ %14, %9 ]
%12 = shl i32 %10, 8
%13 = or i32 %12, 255
%14 = add i32 %11, 8
%15 = icmp eq i32 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %3
%17 = phi i32 [ undef, %3 ], [ %13, %9 ]
%18 = phi i32 [ 0, %3 ], [ %13, %9 ]
%19 = icmp eq i32 %5, 0
br i1 %19, label %27, label %20
20: ; preds = %16, %20
%21 = phi i32 [ %24, %20 ], [ %18, %16 ]
%22 = phi i32 [ %25, %20 ], [ 0, %16 ]
%23 = shl nsw i32 %21, 1
%24 = or i32 %23, 1
%25 = add i32 %22, 1
%26 = icmp eq i32 %25, %5
br i1 %26, label %27, label %20
27: ; preds = %16, %20, %1
%28 = phi i32 [ 0, %1 ], [ %17, %16 ], [ %24, %20 ]
ret i32 %28
}
/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateGPIORetentionDisable(void) {
  (*((volatile unsigned long *)(0x400FC010))) &= ~(0x40000000 | 0x00000100);
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateGPIORetentionDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rcx
and    $0xffffffffbffffeff,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateGPIORetentionDisable>:
andq   $0xffffffffbffffeff,0x400fc010
40 ff fe ff bf
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateGPIORetentionDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, -1073742081
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateGPIORetentionDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, -1073742081
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
void set_envs(void) {}


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

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

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

LLVM IR (-O2):
define void @set_envs() {
ret void
}
int st_numcmp(x, y)
char *x;
char *y;
{ return ((x) != (y)); }


x86 assembly (clang, -O0):
<st_numcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_numcmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @st_numcmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _hex2str(unsigned long, char *);
char *hex2str(unsigned long val, char *out) {
  _hex2str(val, out);
  return out;
}


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

x86 assembly (clang, -O2):
<hex2str>:
push   %rbx
mov    %rsi,%rbx
call   1030 <_hex2str@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @hex2str(i64 %0, i8* returned %1) {
%3 = tail call i32 @_hex2str(i64 %0, i8* %1)
ret i8* %1
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *str) {
  char *new_str = NULL;
  if (str != NULL) {
    new_str = malloc(strlen(str) + 1);
    if (new_str)
      strcpy(new_str, str);
  }
  return new_str;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1185 <strdup+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1180 <strdup+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1185 <strdup+0x55>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <strdup+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <strdup+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <strdup+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
br label %17
17: ; preds = %13, %6
br label %18
18: ; preds = %17, %1
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %3, %8, %1
%11 = phi i8* [ %6, %8 ], [ null, %3 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
scalar_t__ portWrite(char *);
int abortSlew() {
  if (portWrite("#:Q#") < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<abortSlew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <portWrite@plt>
cmp    $0x0,%rax
jge    113a <abortSlew+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <abortSlew+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abortSlew>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <portWrite@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"#:Q#\00"
define i32 @abortSlew() {
%1 = alloca i32
%2 = call i64 @portWrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt 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):
@.str = [5 x i8] c"#:Q#\00"
define i32 @abortSlew() {
%1 = tail call i64 @portWrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = ashr i64 %1, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%i %i", &a, &b);
  printf("%i\n", a + b);
  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
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [4 x i8] c"%i\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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ this_comparison_is_true();
void bla3ne(int var) {
  if (var - 10 != INT_MAX - 9)
    this_comparison_is_true();
}


x86 assembly (clang, -O0):
<bla3ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x9,%ecx
cmp    %ecx,%eax
je     113c <bla3ne+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_true@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla3ne>:
mov    0x2ed1(%rip),%rax
add    $0xffffffff,%edi
cmp    (%rax),%edi
jne    111f <bla3ne+0xf>
ret
xor    %eax,%eax
jmp    1030 <this_comparison_is_true@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @bla3ne(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 10
%5 = load i32, i32* @INT_MAX
%6 = sub nsw i32 %5, 9
%7 = icmp ne i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @this_comparison_is_true()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @bla3ne(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, %2
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @this_comparison_is_true()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_free_all(int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_reset(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ lib_cleanup();
void close_all(BIO *bio, SSL_CTX *ctx) {
  if (bio != NULL)
    BIO_reset(bio);
  if (bio != NULL)
    BIO_free_all(bio);
  if (ctx != NULL)
    SSL_CTX_free(ctx);
  lib_cleanup();
}


x86 assembly (clang, -O0):
<close_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1164 <close_all+0x24>
mov    -0x8(%rbp),%rdi
call   1060 <BIO_reset@plt>
cmpq   $0x0,-0x8(%rbp)
je     1178 <close_all+0x38>
mov    -0x8(%rbp),%rdi
call   1050 <BIO_free_all@plt>
cmpq   $0x0,-0x10(%rbp)
je     118c <close_all+0x4c>
mov    -0x10(%rbp),%rdi
call   1040 <SSL_CTX_free@plt>
mov    $0x0,%al
call   1030 <lib_cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_all>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %rdi,%rdi
je     115c <close_all+0x1c>
mov    %rdi,%rbx
call   1060 <BIO_reset@plt>
mov    %rbx,%rdi
call   1050 <BIO_free_all@plt>
test   %r14,%r14
je     1169 <close_all+0x29>
mov    %r14,%rdi
call   1040 <SSL_CTX_free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <lib_cleanup@plt>

LLVM IR (-O0):
define void @close_all(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 = icmp ne i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = call i32 @BIO_reset(i32* %8)
br label %10
10: ; preds = %7, %2
%11 = load i32*, i32** %3
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32*, i32** %3
%15 = call i32 @BIO_free_all(i32* %14)
br label %16
16: ; preds = %13, %10
%17 = load i32*, i32** %4
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32*, i32** %4
%21 = call i32 @SSL_CTX_free(i32* %20)
br label %22
22: ; preds = %19, %16
%23 = call i32 (...) @lib_cleanup()
ret void
}

LLVM IR (-O2):
define void @close_all(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @BIO_reset(i32* %0)
%6 = tail call i32 @BIO_free_all(i32* %0)
br label %7
7: ; preds = %2, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @SSL_CTX_free(i32* %1)
br label %11
11: ; preds = %9, %7
%12 = tail call i32 (...) @lib_cleanup()
ret void
}
/* Variables and functions */
char tolower(char const);
char toupper(char const);
unsigned int testerTouche(const char touche, const char actionTouche) {
  char minuscule, majuscule;
  minuscule = tolower(actionTouche);
  majuscule = toupper(actionTouche);
  return touche == minuscule || touche == majuscule;
}


x86 assembly (clang, -O0):
<testerTouche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1040 <tolower@plt>
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x4(%rbp)
movsbl -0x1(%rbp),%ecx
movsbl -0x3(%rbp),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
je     1171 <testerTouche+0x51>
movsbl -0x1(%rbp),%eax
movsbl -0x4(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testerTouche>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <tolower@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <toupper@plt>
cmp    %bpl,%r14b
sete   %cl
cmp    %bpl,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @testerTouche(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %5
%9 = load i8, i8* %4
%10 = call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %6
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %12, %14
br i1 %15, label %22, label %16
16: ; preds = %2
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = load i8, i8* %6
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %18, %20
br label %22
22: ; preds = %16, %2
%23 = phi i1 [ true, %2 ], [ %21, %16 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @testerTouche(i8 signext %0, i8 signext %1) {
%3 = tail call signext i8 @tolower(i8 signext %1)
%4 = tail call signext i8 @toupper(i8 signext %1)
%5 = icmp eq i8 %3, %0
%6 = icmp eq i8 %4, %0
%7 = select i1 %5, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void ff_hevc_put_hevc_uni_epel_h6_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h6_8_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
void osDelay(time_t delay) {}


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

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

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

LLVM IR (-O2):
define void @osDelay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *malloc(int const);
char *str_alloc(const int length) {
  assert(length > 0);
  return malloc((length + 1) * sizeof(char));
}


x86 assembly (clang, -O0):
<str_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_alloc>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1030 <assert@plt>
add    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define i8* @str_alloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @str_alloc(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = add nsw i32 %0, 1
%6 = tail call i8* @malloc(i32 %5)
ret i8* %6
}
int is_utf8_part(char c) {
  if (c & 0x80)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_utf8_part>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1128 <is_utf8_part+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <is_utf8_part+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_utf8_part>:
shr    $0x7,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @is_utf8_part(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_utf8_part(i8 signext %0) {
%2 = lshr i8 %0, 7
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void sleepMilliseconds(unsigned int msecs) {
  struct timespec ts;
  ts.tv_sec = msecs / 1000;
  ts.tv_nsec = (msecs % 1000) * 1000000;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<sleepMilliseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepMilliseconds>:
push   %rax
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %eax,(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @sleepMilliseconds(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000
%9 = mul i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @sleepMilliseconds(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = udiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = urem i32 %0, 1000
%7 = mul nuw nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
void init(void) {
  int x;
  x = *((int *)0xbad1dea);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbad1dea,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 195894762 to i32*)
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @init() {
ret void
}
void set(int **y, int *x) { *y = x; }


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

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

LLVM IR (-O0):
define void @set(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
store i32* %5, i32** %6
ret void
}

LLVM IR (-O2):
define void @set(i32** nocapture writeonly %0, i32* %1) {
store i32* %1, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Temperatures(double);
int scanf(char *, double *);
int main() {
  double fahrenheit;
  while ((scanf("%lf", &fahrenheit) == 1)) {
    Temperatures(fahrenheit);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
cmp    $0x1,%eax
jne    1157 <main+0x37>
movsd  -0x10(%rbp),%xmm0
call   1040 <Temperatures@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1030 <scanf@plt>
cmp    $0x1,%eax
jne    116a <main+0x4a>
lea    0xec1(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rsp),%xmm0
call   1040 <Temperatures@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
cmp    $0x1,%eax
je     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load double, double* %2
%8 = call i32 @Temperatures(double %7)
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load double, double* %1
%7 = call i32 @Temperatures(double %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printAns(int);
void doMult(int a, int b) { printAns(a * b); }


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

x86 assembly (clang, -O2):
<doMult>:
imul   %esi,%edi
jmp    1030 <printAns@plt>

LLVM IR (-O0):
define void @doMult(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = call i32 @printAns(i32 %7)
ret void
}

LLVM IR (-O2):
define void @doMult(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @printAns(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fexcept_t;

/* Variables and functions */
int fegetexceptflag(fexcept_t *flagp, int excepts) { return 1; }


x86 assembly (clang, -O0):
<fegetexceptflag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fegetexceptflag(i32* nocapture readnone %0, i32 %1) {
ret i32 1
}