xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ BIO_info_cb;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
long BIO_callback_ctrl(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *BIO_next(int /*<<< orphan*/ *);
long b64_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp) {
  long ret = 1;
  BIO *next = BIO_next(b);
  if (next == NULL)
    return 0;
  switch (cmd) {
  default:
    ret = BIO_callback_ctrl(next, cmd, fp);
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<b64_callback_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <BIO_next@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1160 <b64_callback_ctrl+0x40>
movq   $0x0,-0x8(%rbp)
jmp    117c <b64_callback_ctrl+0x5c>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <BIO_callback_ctrl@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_callback_ctrl>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <BIO_next@plt>
test   %rax,%rax
je     1145 <b64_callback_ctrl+0x25>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <BIO_callback_ctrl@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @b64_callback_ctrl(i32* %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i64 1, i64* %8
%10 = load i32*, i32** %5
%11 = call i32* @BIO_next(i32* %10)
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %3
store i64 0, i64* %4
br label %24
15: ; preds = %3
%16 = load i32, i32* %6
switch i32 %16, label %17 [
]
17: ; preds = %15
%18 = load i32*, i32** %9
%19 = load i32, i32* %6
%20 = load i32*, i32** %7
%21 = call i64 @BIO_callback_ctrl(i32* %18, i32 %19, i32* %20)
store i64 %21, i64* %8
br label %22
22: ; preds = %17
%23 = load i64, i64* %8
store i64 %23, i64* %4
br label %24
24: ; preds = %22, %14
%25 = load i64, i64* %4
ret i64 %25
}

LLVM IR (-O2):
define i64 @b64_callback_ctrl(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32* @BIO_next(i32* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i64 @BIO_callback_ctrl(i32* %4, i32 %1, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i64 [ %7, %6 ], [ 0, %3 ]
ret i64 %9
}
/* Variables and functions */
char *find_escaped(char *, char *, char *, int);
char *mod_start(char *s, int mark) {
  return find_escaped(s, "<<", "@<<", mark);
}


x86 assembly (clang, -O0):
<mod_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xed4(%rip),%rsi
lea    0xecc(%rip),%rdx
call   1030 <find_escaped@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_start>:
mov    %esi,%ecx
lea    0xee8(%rip),%rsi
lea    0xee0(%rip),%rdx
jmp    1030 <find_escaped@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"<<\00"
@.str.1 = [4 x i8] c"@<<\00"
define i8* @mod_start(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @find_escaped(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"<<\00"
@.str.1 = [4 x i8] c"@<<\00"
define i8* @mod_start(i8* %0, i32 %1) {
%3 = tail call i8* @find_escaped(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i8* %3
}
main() {
  int a;
  int b = 3;
  a = 2;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void unsigned_char_shr_signed_char_unsigned_int(unsigned char *LHS,
                                                unsigned int RHS) {
  (*LHS) >>= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_shr_signed_char_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
sar    %cl,%edx
mov    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_shr_signed_char_unsigned_int>:
mov    %esi,%ecx
movzbl (%rdi),%eax
shr    %cl,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_shr_signed_char_unsigned_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @unsigned_char_shr_signed_char_unsigned_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = lshr i32 %4, %1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ puts(char *);
int strlen(char *);
void str2array(char *str) {
  int len = strlen(str);
  char arr[len + 1];
  memcpy(arr, str, len + 1);
  puts(arr);
}


x86 assembly (clang, -O0):
<str2array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1050 <memcpy@plt>
mov    -0x28(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2array>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edx
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @str2array(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %4
%12 = alloca i8, i64 %10
store i64 %10, i64* %5
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
%16 = call i32 @memcpy(i8* %12, i8* %13, i32 %15)
%17 = call i32 @puts(i8* %12)
%18 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @str2array(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @memcpy(i8* %5, i8* %0, i32 %3)
%7 = call i32 @puts(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_8828() {
  Assert_real((isqrt(8828) == 93),
              "/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/stdlib/isqrt.c",
              1460, ("Integer square root of 8828 should be 93"));
}


x86 assembly (clang, -O0):
<t_sqrt_8828>:
push   %rbp
mov    %rsp,%rbp
mov    $0x227c,%edi
call   1030 <isqrt@plt>
cmp    $0x5d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x5b4,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_8828>:
push   %rax
mov    $0x227c,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x5d,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5b4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 8828 should be 93\00"
define void @t_sqrt_8828() {
%1 = call i32 @isqrt(i32 8828)
%2 = icmp eq i32 %1, 93
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1460, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 8828 should be 93\00"
define void @t_sqrt_8828() {
%1 = tail call i32 @isqrt(i32 8828)
%2 = icmp eq i32 %1, 93
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1460, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_hexdigit(int);
void print_hex(int n) {
  print_hexdigit((n & 0xF0) >> 4);
  print_hexdigit(n & 0x0F);
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xf0,%edi
sar    $0x4,%edi
call   1030 <print_hexdigit@plt>
mov    -0x4(%rbp),%edi
and    $0xf,%edi
call   1030 <print_hexdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %rbx
mov    %edi,%ebx
shr    $0x4,%edi
and    $0xf,%edi
call   1030 <print_hexdigit@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <print_hexdigit@plt>

LLVM IR (-O0):
define void @print_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 240
%5 = ashr i32 %4, 4
%6 = call i32 @print_hexdigit(i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 15
%9 = call i32 @print_hexdigit(i32 %8)
ret void
}

LLVM IR (-O2):
define void @print_hex(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = tail call i32 @print_hexdigit(i32 %3)
%5 = and i32 %0, 15
%6 = tail call i32 @print_hexdigit(i32 %5)
ret void
}
float C_K(float n) {
  n += 273.15;
  return n;
}


x86 assembly (clang, -O0):
<C_K>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_K>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @C_K(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 2.731500e+02
%6 = fptrunc double %5 to float
store float %6, float* %2
%7 = load float, float* %2
ret float %7
}

LLVM IR (-O2):
define float @C_K(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 2.731500e+02
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
int main(void) {
  puts("puts(\"hello, world\")");
  fputs("fputs(\"hello, world\", stdout)", stdout);
  fputc('\n', stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1050 <fputc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rbx
mov    (%rbx),%esi
lea    0xec8(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1050 <fputc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"puts(\22hello, world\22)\00"
@.str.1 = [30 x i8] c"fputs(\22hello, world\22, stdout)\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fputc(i8 signext 10, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"puts(\22hello, world\22)\00"
@.str.1 = [30 x i8] c"fputs(\22hello, world\22, stdout)\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputc(i8 signext 10, i32 %4)
ret i32 0
}
void setType(int *entry, int type) { *(entry + 4) = type; }


x86 assembly (clang, -O0):
<setType>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @setType(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int voidstrs_eq(void *str1, void *str2) {
  return strcmp((char *)str1, (char *)str2) == 0;
}


x86 assembly (clang, -O0):
<voidstrs_eq>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voidstrs_eq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @voidstrs_eq(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 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @voidstrs_eq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ ptr;
};
typedef TYPE_1__ UDF_INIT;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
void jfget_deinit(UDF_INIT *initid) {
  free(initid->ptr);
  return;
}


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

x86 assembly (clang, -O2):
<jfget_deinit>:
mov    (%rdi),%edi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define void @jfget_deinit(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @free(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define void @jfget_deinit(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @free(i32 %3)
ret void
}
void INT_Excep_ELC_ELSR8I(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ELC_ELSR8I() {
ret void
}
int test_imm_EEint8_mem(signed char *val) {
  return ((*val) & (-0xEE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EEint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff12,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EEint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff12,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EEint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -238
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_EEint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -238
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY_CTX;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EVP_MD_CTX;
typedef int /*<<< orphan*/ EVP_MD;
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int do_sigver_init(int /*<<< orphan*/ *, int /*<<< orphan*/ **,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int);
int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
                         const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey) {
  return do_sigver_init(ctx, pctx, type, e, pkey, 1);
}


x86 assembly (clang, -O0):
<EVP_DigestVerifyInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <do_sigver_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_DigestVerifyInit>:
mov    $0x1,%r9d
jmp    1030 <do_sigver_init@plt>

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

LLVM IR (-O2):
define i32 @EVP_DigestVerifyInit(i32* %0, i32** %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @do_sigver_init(i32* %0, i32** %1, i32* %2, i32* %3, i32* %4, i32 1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int *data, int n) {
  for (int i = 0; i < n; i++)
    printf("%d ", data[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
struct l_struct_OC_std_KD__KD__Vector_base {
  int dummy;
};
struct l_class_OC_std_KD__KD_vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ZNSt12_Vector_baseIPiSaIS0_EEC2Ev(
    struct l_struct_OC_std_KD__KD__Vector_base *);
void _ZNSt6vectorIPiSaIS0_EEC2Ev(
    struct l_class_OC_std_KD__KD_vector *llvm_cbe_this) {
  struct l_class_OC_std_KD__KD_vector *llvm_cbe_this_2e_addr;
  struct l_class_OC_std_KD__KD_vector *llvm_cbe_this1;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  _ZNSt12_Vector_baseIPiSaIS0_EEC2Ev(
      (((struct l_struct_OC_std_KD__KD__Vector_base *)llvm_cbe_this1)));
  return;
}


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

x86 assembly (clang, -O2):
<_ZNSt6vectorIPiSaIS0_EEC2Ev>:
jmp    1030 <_ZNSt12_Vector_baseIPiSaIS0_EEC2Ev@plt>

LLVM IR (-O0):
%struct.l_class_OC_std_KD__KD_vector = type { i32 }
%struct.l_struct_OC_std_KD__KD__Vector_base = type { i32 }
define void @_ZNSt6vectorIPiSaIS0_EEC2Ev(%struct.l_class_OC_std_KD__KD_vector* %0) {
%2 = alloca %struct.l_class_OC_std_KD__KD_vector*
%3 = alloca %struct.l_class_OC_std_KD__KD_vector*
%4 = alloca %struct.l_class_OC_std_KD__KD_vector*
store %struct.l_class_OC_std_KD__KD_vector* %0, %struct.l_class_OC_std_KD__KD_vector** %2
%5 = load %struct.l_class_OC_std_KD__KD_vector*, %struct.l_class_OC_std_KD__KD_vector** %2
store %struct.l_class_OC_std_KD__KD_vector* %5, %struct.l_class_OC_std_KD__KD_vector** %3
%6 = load %struct.l_class_OC_std_KD__KD_vector*, %struct.l_class_OC_std_KD__KD_vector** %3
store %struct.l_class_OC_std_KD__KD_vector* %6, %struct.l_class_OC_std_KD__KD_vector** %4
%7 = load %struct.l_class_OC_std_KD__KD_vector*, %struct.l_class_OC_std_KD__KD_vector** %4
%8 = bitcast %struct.l_class_OC_std_KD__KD_vector* %7 to %struct.l_struct_OC_std_KD__KD__Vector_base*
%9 = call i32 @_ZNSt12_Vector_baseIPiSaIS0_EEC2Ev(%struct.l_struct_OC_std_KD__KD__Vector_base* %8)
ret void
}

LLVM IR (-O2):
%struct.l_class_OC_std_KD__KD_vector = type { i32 }
%struct.l_struct_OC_std_KD__KD__Vector_base = type { i32 }
define void @_ZNSt6vectorIPiSaIS0_EEC2Ev(%struct.l_class_OC_std_KD__KD_vector* %0) {
%2 = bitcast %struct.l_class_OC_std_KD__KD_vector* %0 to %struct.l_struct_OC_std_KD__KD__Vector_base*
%3 = tail call i32 @_ZNSt12_Vector_baseIPiSaIS0_EEC2Ev(%struct.l_struct_OC_std_KD__KD__Vector_base* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spi_write16(int, unsigned char);
void MCP23s17_WriteGPIO_A(unsigned char data) { spi_write16((0x12), data); }


x86 assembly (clang, -O0):
<MCP23s17_WriteGPIO_A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x12,%edi
movzbl -0x1(%rbp),%esi
call   1030 <spi_write16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MCP23s17_WriteGPIO_A>:
mov    %edi,%esi
mov    $0x12,%edi
jmp    1030 <spi_write16@plt>

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

LLVM IR (-O2):
define void @MCP23s17_WriteGPIO_A(i8 zeroext %0) {
%2 = tail call i32 @spi_write16(i32 18, i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fsqrts(int s, int d) {
  assem_debug("fsqrts d%d,s%d\n", d, s);
  output_w32(0xeeb10ac0 | ((d & 14) << 11) | ((d & 1) << 22) | ((s & 14) >> 1) |
             ((s & 1) << 5));
}


x86 assembly (clang, -O0):
<emit_fsqrts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0xe,%edi
shl    $0xb,%edi
or     $0xeeb10ac0,%edi
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x16,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0xe,%eax
sar    $0x1,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fsqrts>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%edx
call   1030 <assem_debug@plt>
mov    %ebx,%eax
and    $0xe,%eax
shl    $0xb,%eax
and    $0x1,%ebx
shl    $0x16,%ebx
mov    %ebp,%ecx
shr    %ecx
and    $0x7,%ecx
shl    $0x5,%ebp
movzbl %bpl,%edi
or     %ecx,%edi
or     %ebx,%edi
or     %eax,%edi
or     $0xeeb10ac0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"fsqrts d%d,s%d\0A\00"
define void @emit_fsqrts(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 14
%10 = shl i32 %9, 11
%11 = or i32 -290387264, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 22
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 14
%18 = ashr i32 %17, 1
%19 = or i32 %15, %18
%20 = load i32, i32* %3
%21 = and i32 %20, 1
%22 = shl i32 %21, 5
%23 = or i32 %19, %22
%24 = call i32 @output_w32(i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"fsqrts d%d,s%d\0A\00"
define void @emit_fsqrts(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 11
%5 = and i32 %4, 28672
%6 = shl i32 %1, 22
%7 = and i32 %6, 4194304
%8 = lshr i32 %0, 1
%9 = and i32 %8, 7
%10 = shl i32 %0, 5
%11 = and i32 %10, 32
%12 = or i32 %9, %11
%13 = or i32 %12, %7
%14 = or i32 %13, %5
%15 = or i32 %14, -290387264
%16 = tail call i32 @output_w32(i32 %15)
ret void
}
/* Variables and functions */
long double nearbyint(double);
long double nearbyintl(long double x) { return nearbyint((double)x); }


x86 assembly (clang, -O0):
<nearbyintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <nearbyint@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearbyintl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <nearbyint@plt>

LLVM IR (-O0):
define x86_fp80 @nearbyintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @nearbyint(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @nearbyintl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @nearbyint(double %2)
ret x86_fp80 %3
}
unsigned xrop3_0_0_0(unsigned char s, unsigned char t) {
  unsigned stk1;
  stk1 = 0x0000;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_0_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_0_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 0, i32* %5
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @xrop3_0_0_0(i8 zeroext %0, i8 zeroext %1) {
ret i32 0
}
int foo() {
  int k = 0;
  while (100 > k) {
    int i = 0;
    int j = k;
    while (j > i) {
      i = i + 1;
      j = j - 1;
    }
    k = k + 1;
  }
  return k;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%eax
cmp    -0x4(%rbp),%eax
jle    1157 <foo+0x57>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1149 <foo+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <foo+0x26>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 100
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[BEGIN] env-DYLD_FALLBACK_FRAMEWORK_PATH\n");
  if (foo() == 42)
    printf("[PASS] env-DYLD_FALLBACK_FRAMEWORK_PATH\n");
  else
    printf("[FAIL] env-DYLD_FALLBACK_FRAMEWORK_PATH\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x2a,%eax
jne    115c <main+0x3c>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x48>
lea    0xef0(%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
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x2a,%eax
lea    0xf13(%rip),%rax
lea    0xee4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"[BEGIN] env-DYLD_FALLBACK_FRAMEWORK_PATH\0A\00"
@.str.1 = [41 x i8] c"[PASS] env-DYLD_FALLBACK_FRAMEWORK_PATH\0A\00"
@.str.2 = [41 x i8] c"[FAIL] env-DYLD_FALLBACK_FRAMEWORK_PATH\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @foo()
%4 = icmp eq i32 %3, 42
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"[BEGIN] env-DYLD_FALLBACK_FRAMEWORK_PATH\00"
@str.3 = [40 x i8] c"[FAIL] env-DYLD_FALLBACK_FRAMEWORK_PATH\00"
@str.4 = [40 x i8] c"[PASS] env-DYLD_FALLBACK_FRAMEWORK_PATH\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @foo()
%3 = icmp eq i32 %2, 42
%4 = select i1 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @str.3, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void foo(int (*a)[40]) {
  int x = (*(a + 29))[7];
  assert(x == 23);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x123c(%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x17,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmpl   $0x17,0x123c(%rdi)
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @foo([40 x i32]* %0) {
%2 = alloca [40 x i32]*
%3 = alloca i32
store [40 x i32]* %0, [40 x i32]** %2
%4 = load [40 x i32]*, [40 x i32]** %2
%5 = getelementptr inbounds [40 x i32], [40 x i32]* %4, i64 29
%6 = getelementptr inbounds [40 x i32], [40 x i32]* %5, i64 0, i64 7
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 23
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
define void @foo([40 x i32]* nocapture %0) {
%2 = getelementptr inbounds [40 x i32], [40 x i32]* %0, i64 29, i64 7
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 23
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("SO. you're name is %s\n", "JORGE");
  printf("You're age is %d \n", 20);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"SO. you're name is %s\0A\00"
@.str.1 = [6 x i8] c"JORGE\00"
@.str.2 = [19 x i8] c"You're age is %d \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 20)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"SO. you're name is %s\0A\00"
@.str.1 = [6 x i8] c"JORGE\00"
@.str.2 = [19 x i8] c"You're age is %d \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 20)
ret i32 0
}
int mkostemp(template, flags)
char *template;
int flags;
{ return __gen_tempname(template, 0, flags, 0); }


x86 assembly (clang, -O0):
<mkostemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <__gen_tempname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkostemp>:
mov    %esi,%edx
xor    %esi,%esi
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1030 <__gen_tempname@plt>

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

LLVM IR (-O2):
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @__gen_tempname to i32 (i8*, i32, i32, i32, ...)*)(i8* %0, i32 0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void _cleanup_fclose(FILE **p) {
  if (*p)
    fclose(*p);
}


x86 assembly (clang, -O0):
<_cleanup_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <_cleanup_fclose+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cleanup_fclose>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <_cleanup_fclose+0xd>
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
define void @_cleanup_fclose(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
int recupNomFichier(char *path) {
  int i = 0;
  int j = 0;
  while (path[i] != '\0') {
    if (path[i] == '/')
      j = i;
    i++;
  }
  return j;
}


x86 assembly (clang, -O0):
<recupNomFichier>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1154 <recupNomFichier+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1146 <recupNomFichier+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <recupNomFichier+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<recupNomFichier>:
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1116 <recupNomFichier+0x16>
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%eax
add    $0x1,%rcx
movzbl (%rdi,%rcx,1),%edx
cmp    $0x2f,%dl
je     1110 <recupNomFichier+0x10>
test   %dl,%dl
jne    1112 <recupNomFichier+0x12>
ret

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

LLVM IR (-O2):
define i32 @recupNomFichier(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 47, label %7
]
7: ; preds = %2
%8 = trunc i64 %3 to i32
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int wait_for_child(int /*<<< orphan*/);
int kill_child_and_wait(pid_t child_pid) {
  kill(child_pid, SIGTERM);
  return wait_for_child(child_pid);
}


x86 assembly (clang, -O0):
<kill_child_and_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
mov    -0x4(%rbp),%edi
call   1040 <wait_for_child@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_child_and_wait>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <wait_for_child@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define i32 @kill_child_and_wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = call i32 @kill(i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @wait_for_child(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define i32 @kill_child_and_wait(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @kill(i32 %0, i32 %2)
%4 = tail call i32 @wait_for_child(i32 %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x0d() {
  Assert_real((isalpha(13) == 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_isalpha.c",
              70, ("isalpha should be 0 for 0x0d"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x0d>:
push   %rax
mov    $0xd,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x0d\00"
define void @t_isalpha_0x0d() {
%1 = call i64 @isalpha(i32 13)
%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 70, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x0d\00"
define void @t_isalpha_0x0d() {
%1 = tail call i64 @isalpha(i32 13)
%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 70, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_C0uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xC0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C0uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xc0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C0uint64_midword_mem>:
testb  $0xc0,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C0uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 192
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_C0uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12582912
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int setenv(char const *, char const *, int);
int /*<<< orphan*/ unix_error(char *);
int Setenv(const char *name, const char *value, int overwrite) {
  int rc;
  if ((rc = setenv(name, value, overwrite)) < 0)
    unix_error("Setenv error");
  return rc;
}


x86 assembly (clang, -O0):
<Setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <setenv@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    115b <Setenv+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <unix_error@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setenv>:
push   %rbx
call   1030 <setenv@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Setenv+0x18>
lea    0xecd(%rip),%rdi
call   1040 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Setenv error\00"
define i32 @Setenv(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @setenv(i8* %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}