xunge/DecIR huggingface dataset:
int tls_engine_init(struct tls_connection *conn, const char *engine_id,
                    const char *pin, const char *key_id) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.tls_connection = type opaque
define i32 @tls_engine_init(%struct.tls_connection* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void mapstore(void) { write(2, "\nMAPSTORE NOT IMPLEMENTED\n", 26); }


x86 assembly (clang, -O0):
<mapstore>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
mov    $0x1a,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapstore>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
mov    $0x1a,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\0AMAPSTORE NOT IMPLEMENTED\0A\00"
define void @mapstore() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 26)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0AMAPSTORE NOT IMPLEMENTED\0A\00"
define void @mapstore() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 26)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xa4() {
  Assert_real((isgraph(164) == 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_isgraph.c",
              825, ("isgraph should be 0 for 0xa4"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xa4>:
push   %rax
mov    $0xa4,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x339,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xa4\00"
define void @t_isgraph_0xa4() {
%1 = call i64 @isgraph(i32 164)
%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 825, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xa4\00"
define void @t_isgraph_0xa4() {
%1 = tail call i64 @isgraph(i32 164)
%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 825, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void __mmu_cache_on(void) {}


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

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

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

LLVM IR (-O2):
define void @__mmu_cache_on() {
ret void
}
/* Variables and functions */
double sqrt(double const);
char f_sqrt(double *a, const double *b) {
  if (*b < 0) {
    return (1);
  }
  *a = sqrt(*b);
  return (0);
}


x86 assembly (clang, -O0):
<f_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    113a <f_sqrt+0x2a>
movb   $0x1,-0x1(%rbp)
jmp    1153 <f_sqrt+0x43>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sqrt@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_sqrt>:
push   %rbx
movsd  (%rsi),%xmm0
mov    $0x1,%al
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     113b <f_sqrt+0x2b>
mov    %rdi,%rbx
ucomisd %xmm1,%xmm0
jb     1130 <f_sqrt+0x20>
sqrtsd %xmm0,%xmm0
jmp    1135 <f_sqrt+0x25>
call   1030 <sqrt@plt>
movsd  %xmm0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @f_sqrt(double* %0, double* %1) {
%3 = alloca i8
%4 = alloca double*
%5 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
%6 = load double*, double** %5
%7 = load double, double* %6
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %2
store i8 1, i8* %3
br label %15
10: ; preds = %2
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = call double @sqrt(double %12)
%14 = load double*, double** %4
store double %13, double* %14
store i8 0, i8* %3
br label %15
15: ; preds = %10, %9
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @f_sqrt(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call double @sqrt(double %3)
store double %6, double* %0
br label %7
7: ; preds = %2, %5
%8 = phi i8 [ 0, %5 ], [ 1, %2 ]
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ new_int(int);
int pop_int();
int /*<<< orphan*/ push(int /*<<< orphan*/);
void builtin_greater() {
  int b = pop_int();
  int a = pop_int();
  push(new_int(a > b));
}


x86 assembly (clang, -O0):
<builtin_greater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pop_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <new_int@plt>
mov    %eax,%edi
call   1050 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_greater>:
push   %rbx
xor    %eax,%eax
call   1030 <pop_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <pop_int@plt>
xor    %edi,%edi
cmp    %ebx,%eax
setg   %dil
call   1040 <new_int@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <push@plt>

LLVM IR (-O0):
define void @builtin_greater() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @pop_int()
store i32 %3, i32* %1
%4 = call i32 (...) @pop_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @new_int(i32 %8)
%10 = call i32 @push(i32 %9)
ret void
}

LLVM IR (-O2):
define void @builtin_greater() {
%1 = tail call i32 (...) @pop_int()
%2 = tail call i32 (...) @pop_int()
%3 = icmp sgt i32 %2, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @new_int(i32 %4)
%6 = tail call i32 @push(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fmt_err_exit(char *);
void *realloc(void *, size_t);
void *resize_buff(void *buff, size_t new_size) {
  void *tmp;
  tmp = realloc(buff, new_size);
  if (!tmp)
    fmt_err_exit("virtual memory exhausted");
  return tmp;
}


x86 assembly (clang, -O0):
<resize_buff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <resize_buff+0x38>
lea    0xead(%rip),%rdi
call   1040 <fmt_err_exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize_buff>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <resize_buff+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fmt_err_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @resize_buff(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @fmt_err_exit(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define noalias i8* @resize_buff(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fmt_err_exit(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void XClipBox() {}


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

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

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

LLVM IR (-O2):
define void @XClipBox() {
ret void
}
/* Variables and functions */
scalar_t__ ft_strcmp(char const *, char const *);
int ft_strequ(char const *s1, char const *s2) {
  if (!s1 || !s2)
    return (0);
  return (ft_strcmp(s1, s2) == 0 ? 1 : 0);
}


x86 assembly (clang, -O0):
<ft_strequ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <ft_strequ+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <ft_strequ+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1163 <ft_strequ+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ft_strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strequ>:
xor    %eax,%eax
test   %rdi,%rdi
je     1131 <ft_strequ+0x21>
test   %rsi,%rsi
je     1131 <ft_strequ+0x21>
push   %rax
call   1030 <ft_strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 0, i32* %3
br label %19
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i64 @ft_strcmp(i8* %13, i8* %14)
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
store i32 %18, i32* %3
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @ft_strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ DeferredPowerManagerP__0__ResourceDefaultOwner__requested();
void ArbiterP__1__ResourceDefaultOwner__requested(void) {
  DeferredPowerManagerP__0__ResourceDefaultOwner__requested();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__1__ResourceDefaultOwner__requested() {
%1 = tail call i32 (...) @DeferredPowerManagerP__0__ResourceDefaultOwner__requested()
ret void
}
/* Variables and functions */
unsigned char __lwpins64(unsigned long long, unsigned int, int);
unsigned char ___lwpins64(unsigned long long A, unsigned int B, int const I) {
  return __lwpins64(A, B, 1);
}


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

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

LLVM IR (-O0):
define zeroext i8 @___lwpins64(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %5
%9 = call zeroext i8 @__lwpins64(i64 %7, i32 %8, i32 1)
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @___lwpins64(i64 %0, i32 %1, i32 %2) {
%4 = tail call zeroext i8 @__lwpins64(i64 %0, i32 %1, i32 1)
ret i8 %4
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *begin = s;
  while (*(s++))
    ;
  return s - begin - 1;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen+0x2d>
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ cgload();
int /*<<< orphan*/ cgmul();
int /*<<< orphan*/ gentext();
void genmul(void) {
  gentext();
  cgload();
  cgmul();
}


x86 assembly (clang, -O0):
<genmul>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <gentext@plt>
mov    $0x0,%al
call   1030 <cgload@plt>
mov    $0x0,%al
call   1050 <cgmul@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genmul>:
push   %rax
xor    %eax,%eax
call   1040 <gentext@plt>
xor    %eax,%eax
call   1030 <cgload@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cgmul@plt>

LLVM IR (-O0):
define void @genmul() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @cgload()
%3 = call i32 (...) @cgmul()
ret void
}

LLVM IR (-O2):
define void @genmul() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @cgload()
%3 = tail call i32 (...) @cgmul()
ret void
}
/* Variables and functions */
int is_utf8_upper(char const *);
const char *skip_utf8_upper(const char *s) {
  int nb = is_utf8_upper(s);
  while (nb) {
    s += nb;
    nb = is_utf8_upper(s);
  }
  return s;
}


x86 assembly (clang, -O0):
<skip_utf8_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_utf8_upper@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1154 <skip_utf8_upper+0x44>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_utf8_upper@plt>
mov    %eax,-0xc(%rbp)
jmp    1128 <skip_utf8_upper+0x18>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_utf8_upper>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <is_utf8_upper@plt>
test   %eax,%eax
je     1133 <skip_utf8_upper+0x23>
cltq
add    %rax,%rbx
mov    %rbx,%rdi
jmp    1120 <skip_utf8_upper+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_utf8_upper(i8* %0) {
%2 = tail call i32 @is_utf8_upper(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = tail call i32 @is_utf8_upper(i8* %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i8* [ %0, %1 ], [ %8, %4 ]
ret i8* %12
}
int kgsl_process_init_debugfs(struct kgsl_process_private *priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kgsl_process_private = type opaque
define i32 @kgsl_process_init_debugfs(%struct.kgsl_process_private* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xfb() {
  Assert_real((isspace(251) == 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_isspace.c",
              1260, ("isspace should be 0 for 0xfb"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xfb>:
push   %rax
mov    $0xfb,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ec,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xfb\00"
define void @t_isspace_0xfb() {
%1 = call i64 @isspace(i32 251)
%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 1260, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xfb\00"
define void @t_isspace_0xfb() {
%1 = tail call i64 @isspace(i32 251)
%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 1260, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pfglDeleteTextures(int, unsigned int *);
void R_DeleteTexture(unsigned int texnum) { pfglDeleteTextures(1, &texnum); }


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

x86 assembly (clang, -O2):
<R_DeleteTexture>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
call   1030 <pfglDeleteTextures@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @R_DeleteTexture(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pfglDeleteTextures(i32 1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TELOPT_BINARY;
int /*<<< orphan*/ tel_opt_dont_send(int /*<<< orphan*/, int);
int /*<<< orphan*/ tel_opt_wont_send(int /*<<< orphan*/, int);
void tel_opt_bin_leave(int in_out) {
  if (in_out & 0x1)
    tel_opt_dont_send(TELOPT_BINARY, 1);
  if (in_out & 0x2)
    tel_opt_wont_send(TELOPT_BINARY, 1);
}


x86 assembly (clang, -O0):
<tel_opt_bin_leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114d <tel_opt_bin_leave+0x2d>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <tel_opt_dont_send@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     116f <tel_opt_bin_leave+0x4f>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <tel_opt_wont_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tel_opt_bin_leave>:
push   %rbx
mov    %edi,%ebx
test   $0x1,%bl
je     113b <tel_opt_bin_leave+0x1b>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <tel_opt_dont_send@plt>
test   $0x2,%bl
jne    1142 <tel_opt_bin_leave+0x22>
pop    %rbx
ret
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <tel_opt_wont_send@plt>

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

LLVM IR (-O2):
@TELOPT_BINARY = global i32 0
define void @tel_opt_bin_leave(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @TELOPT_BINARY
%6 = tail call i32 @tel_opt_dont_send(i32 %5, i32 1)
br label %7
7: ; preds = %4, %1
%8 = and i32 %0, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* @TELOPT_BINARY
%12 = tail call i32 @tel_opt_wont_send(i32 %11, i32 1)
br label %13
13: ; preds = %10, %7
ret void
}
void completed(void *ctx_) {}


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

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

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

LLVM IR (-O2):
define void @completed(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ acosf(int);
float mlRadToDeg(int /*<<< orphan*/);
int mlVectorDotProduct(float const *, float const *);
int mlVectorNorm(float const *);
void mlVectorAngleTo(const float *a, const float *b, float *angle) {
  *angle = mlRadToDeg(
      acosf(mlVectorDotProduct(a, b) / (mlVectorNorm(a) * mlVectorNorm(b))));
}


x86 assembly (clang, -O0):
<mlVectorAngleTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <mlVectorDotProduct@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mlVectorNorm@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mlVectorNorm@plt>
mov    -0x20(%rbp),%ecx
mov    %eax,%edx
mov    -0x1c(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <acosf@plt>
mov    %eax,%edi
call   1060 <mlRadToDeg@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlVectorAngleTo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1050 <mlVectorDotProduct@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <mlVectorNorm@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1030 <mlVectorNorm@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <acosf@plt>
mov    %eax,%edi
call   1060 <mlRadToDeg@plt>
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @mlVectorAngleTo(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float*, float** %5
%9 = call i32 @mlVectorDotProduct(float* %7, float* %8)
%10 = load float*, float** %4
%11 = call i32 @mlVectorNorm(float* %10)
%12 = load float*, float** %5
%13 = call i32 @mlVectorNorm(float* %12)
%14 = mul nsw i32 %11, %13
%15 = sdiv i32 %9, %14
%16 = call i32 @acosf(i32 %15)
%17 = call float @mlRadToDeg(i32 %16)
%18 = load float*, float** %6
store float %17, float* %18
ret void
}

LLVM IR (-O2):
define void @mlVectorAngleTo(float* %0, float* %1, float* nocapture writeonly %2) {
%4 = tail call i32 @mlVectorDotProduct(float* %0, float* %1)
%5 = tail call i32 @mlVectorNorm(float* %0)
%6 = tail call i32 @mlVectorNorm(float* %1)
%7 = mul nsw i32 %6, %5
%8 = sdiv i32 %4, %7
%9 = tail call i32 @acosf(i32 %8)
%10 = tail call float @mlRadToDeg(i32 %9)
store float %10, float* %2
ret void
}
extern void __attribute__((always_, __gnu___)) prefetch(void) {
  __builtin_prefetch(0, 0, 1);
}


x86 assembly (clang, -O0):
<prefetch>:
push   %rbp
mov    %rsp,%rbp
prefetcht2 0x0
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefetch>:
prefetcht2 0x0
ret

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

LLVM IR (-O2):
define void @prefetch() {
tail call void @llvm.prefetch.p0i8(i8* null, i32 0, i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ testChunkAndChunkArrayOverflow();
int /*<<< orphan*/ testFullChunk();
int /*<<< orphan*/ testSeveralChunks();
int /*<<< orphan*/ testSimpleAllocation();
int /*<<< orphan*/ testTooLongAllocation();
int main() {
  testSimpleAllocation();
  testTooLongAllocation();
  testChunkAndChunkArrayOverflow();
  testFullChunk();
  testSeveralChunks();
  puts("All tests was successfully passed");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testSimpleAllocation@plt>
mov    $0x0,%al
call   1080 <testTooLongAllocation@plt>
mov    $0x0,%al
call   1070 <testChunkAndChunkArrayOverflow@plt>
mov    $0x0,%al
call   1060 <testFullChunk@plt>
mov    $0x0,%al
call   1050 <testSeveralChunks@plt>
lea    0xe67(%rip),%rdi
call   1040 <puts@plt>
jmp    119e <main+0x3e>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testSimpleAllocation@plt>
xor    %eax,%eax
call   1080 <testTooLongAllocation@plt>
xor    %eax,%eax
call   1070 <testChunkAndChunkArrayOverflow@plt>
xor    %eax,%eax
call   1060 <testFullChunk@plt>
xor    %eax,%eax
call   1050 <testSeveralChunks@plt>
lea    0xe75(%rip),%rdi
call   1040 <puts@plt>
jmp    1190 <main+0x30>

LLVM IR (-O0):
@.str = [34 x i8] c"All tests was successfully passed\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testSimpleAllocation()
%3 = call i32 (...) @testTooLongAllocation()
%4 = call i32 (...) @testChunkAndChunkArrayOverflow()
%5 = call i32 (...) @testFullChunk()
%6 = call i32 (...) @testSeveralChunks()
%7 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %8
br label %8
}

LLVM IR (-O2):
@.str = [34 x i8] c"All tests was successfully passed\00"
define i32 @main() {
%1 = tail call i32 (...) @testSimpleAllocation()
%2 = tail call i32 (...) @testTooLongAllocation()
%3 = tail call i32 (...) @testChunkAndChunkArrayOverflow()
%4 = tail call i32 (...) @testFullChunk()
%5 = tail call i32 (...) @testSeveralChunks()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
br label %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t clz(uint32_t event_detect_status) {
  uint32_t pin = 0;
  uint32_t mask = 1UL;
  while (!(event_detect_status & mask)) {
    ++pin;
    mask <<= 1;
  }
  return pin;
}


x86 assembly (clang, -O0):
<clz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1130 <clz+0x30>
jmp    1147 <clz+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <clz+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clz>:
xor    %eax,%eax
test   $0x1,%dil
jne    1119 <clz+0x19>
xor    %eax,%eax
mov    $0x1,%ecx
nop
add    $0x1,%eax
add    %ecx,%ecx
test   %edi,%ecx
je     1110 <clz+0x10>
ret

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

LLVM IR (-O2):
define i32 @clz(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = shl i32 %5, 1
%9 = and i32 %8, %0
%10 = icmp eq i32 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
float __ocml_sub_rtp_f32(float, float);
float __fsub_rd(float x, float y) { return __ocml_sub_rtp_f32(x, y); }


x86 assembly (clang, -O0):
<__fsub_rd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__ocml_sub_rtp_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fsub_rd>:
jmp    1030 <__ocml_sub_rtp_f32@plt>

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

LLVM IR (-O2):
define float @__fsub_rd(float %0, float %1) {
%3 = tail call float @__ocml_sub_rtp_f32(float %0, float %1)
ret float %3
}
void f17() {
  extern void extfunc(__int128);
  __int128 x = 2;
  x--;
  extfunc(x);
}


x86 assembly (clang, -O0):
<f17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
adcq   $0xffffffffffffffff,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <extfunc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f17>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <extfunc@plt>

LLVM IR (-O0):
define void @f17() {
%1 = alloca i128
%2 = alloca i128
store i128 2, i128* %1
%3 = load i128, i128* %1
%4 = add nsw i128 %3, -1
store i128 %4, i128* %1
%5 = load i128, i128* %1
store i128 %5, i128* %2
%6 = bitcast i128* %2 to { i64, i64 }*
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 1
%10 = load i64, i64* %9
ret void
}

LLVM IR (-O2):
define void @f17() {
tail call void @extfunc(i64 1, i64 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void INC_HOST_REG(int host_reg) {
  if (host_reg & 8)
    addbyte(0x41);
  addbyte(0xff);
  addbyte(0xc0 | (host_reg & 7));
}


x86 assembly (clang, -O0):
<INC_HOST_REG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1134 <INC_HOST_REG+0x24>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xff,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xc0,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INC_HOST_REG>:
push   %rbx
mov    %edi,%ebx
test   $0x8,%bl
je     1122 <INC_HOST_REG+0x12>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xff,%edi
call   1030 <addbyte@plt>
and    $0x7,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @INC_HOST_REG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @addbyte(i32 65)
br label %8
8: ; preds = %6, %1
%9 = call i32 @addbyte(i32 255)
%10 = load i32, i32* %2
%11 = and i32 %10, 7
%12 = or i32 192, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @INC_HOST_REG(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @addbyte(i32 65)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @addbyte(i32 255)
%8 = and i32 %0, 7
%9 = or i32 %8, 192
%10 = tail call i32 @addbyte(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ end();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ initialize_ini();
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "calling initalize_ini().\n");
  initialize_ini();
  fprintf(stderr, "calling end().\n");
  end();
  fprintf(stderr, "Done.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <initialize_ini@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1040 <end@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <initialize_ini@plt>
mov    (%rbx),%edi
lea    0xec4(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1040 <end@plt>
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"calling initalize_ini().\0A\00"
@.str.1 = [16 x i8] c"calling end().\0A\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @initialize_ini()
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @end()
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"calling initalize_ini().\0A\00"
@.str.1 = [16 x i8] c"calling end().\0A\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @initialize_ini()
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @end()
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ mpack_store_u32(char *, int /*<<< orphan*/);
void mpack_store_i32(char *p, int32_t val) {
  mpack_store_u32(p, (uint32_t)val);
}


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

x86 assembly (clang, -O2):
<mpack_store_i32>:
jmp    1030 <mpack_store_u32@plt>

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

LLVM IR (-O2):
define void @mpack_store_i32(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @mpack_store_u32(i8* %0, i32 %3)
ret void
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_push(int /*<<< orphan*/ *, void const *);
int sk_OPENSSL_CSTRING_push(struct stack_st_OPENSSL_CSTRING *sk,
                            const char *ptr) {
  return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);
}


x86 assembly (clang, -O0):
<sk_OPENSSL_CSTRING_push>:
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 <OPENSSL_sk_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_push>:
jmp    1030 <OPENSSL_sk_push@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i32 @sk_OPENSSL_CSTRING_push(%struct.stack_st_OPENSSL_CSTRING* %0, i8* %1) {
%3 = alloca %struct.stack_st_OPENSSL_CSTRING*
%4 = alloca i8*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %3
store i8* %1, i8** %4
%5 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %3
%6 = bitcast %struct.stack_st_OPENSSL_CSTRING* %5 to i32*
%7 = load i8*, i8** %4
%8 = call i32 @OPENSSL_sk_push(i32* %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i32 @sk_OPENSSL_CSTRING_push(%struct.stack_st_OPENSSL_CSTRING* %0, i8* %1) {
%3 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%4 = tail call i32 @OPENSSL_sk_push(i32* %3, i8* %1)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned msb_pos(uint32_t mask) {
  unsigned pos = 0;
  while (mask) {
    pos++;
    mask >>= 1u;
  }
  return pos;
}


x86 assembly (clang, -O0):
<msb_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <msb_pos+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <msb_pos+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msb_pos>:
xor    %eax,%eax
test   %edi,%edi
je     111c <msb_pos+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <msb_pos+0x10>
ret

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

LLVM IR (-O2):
define i32 @msb_pos(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %4, 1
%7 = ashr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
__attribute__((__weak__, __always___)) char *
softboundmpx_strdup(const char *s) {
  void *ret_ptr = strdup(s);
  __softboundmpx_strdup_handler(ret_ptr);
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <__softboundmpx_strdup_handler@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %eax,%eax
call   1030 <__softboundmpx_strdup_handler@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundmpx_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @__softboundmpx_strdup_handler to i32 (i8*, ...)*)(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define weak i8* @softboundmpx_strdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @__softboundmpx_strdup_handler to i32 (i8*, ...)*)(i8* %2)
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t bmax_uint32(uint32_t a, uint32_t b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<bmax_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <bmax_uint32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <bmax_uint32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmax_uint32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @bmax_uint32(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ APP_Main();
int /*<<< orphan*/ BSP_PlatformInit();
int /*<<< orphan*/ SystemClock_Config();
int main(void) {
  SystemClock_Config();
  BSP_PlatformInit();
  APP_Main();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SystemClock_Config@plt>
mov    $0x0,%al
call   1050 <BSP_PlatformInit@plt>
mov    $0x0,%al
call   1040 <APP_Main@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <SystemClock_Config@plt>
xor    %eax,%eax
call   1050 <BSP_PlatformInit@plt>
xor    %eax,%eax
call   1040 <APP_Main@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @SystemClock_Config()
%2 = call i32 (...) @BSP_PlatformInit()
%3 = call i32 (...) @APP_Main()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @SystemClock_Config()
%2 = tail call i32 (...) @BSP_PlatformInit()
%3 = tail call i32 (...) @APP_Main()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getfont();
int /*<<< orphan*/ pushString(int /*<<< orphan*/);
void basGetFont() { pushString(getfont()); }


x86 assembly (clang, -O0):
<basGetFont>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getfont@plt>
mov    %eax,%edi
call   1030 <pushString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basGetFont>:
push   %rax
xor    %eax,%eax
call   1040 <getfont@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <pushString@plt>

LLVM IR (-O0):
define void @basGetFont() {
%1 = call i32 (...) @getfont()
%2 = call i32 @pushString(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basGetFont() {
%1 = tail call i32 (...) @getfont()
%2 = tail call i32 @pushString(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void _cairo_clip_path_reference() {
  int a;
  __sync_fetch_and_add(&a, 1);
}


x86 assembly (clang, -O0):
<_cairo_clip_path_reference>:
push   %rbp
mov    %rsp,%rbp
lock addl $0x1,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cairo_clip_path_reference>:
lock addl $0x1,-0x4(%rsp)
ret

LLVM IR (-O0):
define void @_cairo_clip_path_reference() {
%1 = alloca i32
%2 = atomicrmw add i32* %1, i32 1 seq_cst
ret void
}

LLVM IR (-O2):
define void @_cairo_clip_path_reference() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = atomicrmw add i32* %1, i32 1 seq_cst
ret void
}