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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
int /*<<< orphan*/ pr_indent(int /*<<< orphan*/ *, int);
void pr_int(FILE *fp, int indent, char *title, int i) {
  pr_indent(fp, indent);
  fprintf(fp, "%-20s = %d\n", title, i);
}


x86 assembly (clang, -O0):
<pr_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <pr_indent@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_int>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
call   1040 <pr_indent@plt>
lea    0xec7(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%-20s = %d\0A\00"
define void @pr_int(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @pr_indent(i32* %9, i32 %10)
%12 = load i32*, i32** %5
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%-20s = %d\0A\00"
define void @pr_int(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pr_indent(i32* %0, i32 %1)
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clearScreen() { printf("\x1b[2J\x1b[1;1H"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @clearScreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @clearScreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x58() {
  Assert_real((isbdigit(88) == 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_isbdigit.c",
              445, ("isbdigit should be 0 for X"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x58>:
push   %rax
mov    $0x58,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1bd,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for X\00"
define void @t_isbdigit_0x58() {
%1 = call i64 @isbdigit(i32 88)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for X\00"
define void @t_isbdigit_0x58() {
%1 = tail call i64 @isbdigit(i32 88)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rte_mempool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _rte_mempool_sp_put(struct rte_mempool *, void *);
void rte_mempool_put(struct rte_mempool *mp, void *obj) {
  _rte_mempool_sp_put(mp, obj);
}


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

x86 assembly (clang, -O2):
<rte_mempool_put>:
jmp    1030 <_rte_mempool_sp_put@plt>

LLVM IR (-O0):
%struct.rte_mempool = type { i32 }
define void @rte_mempool_put(%struct.rte_mempool* %0, i8* %1) {
%3 = alloca %struct.rte_mempool*
%4 = alloca i8*
store %struct.rte_mempool* %0, %struct.rte_mempool** %3
store i8* %1, i8** %4
%5 = load %struct.rte_mempool*, %struct.rte_mempool** %3
%6 = load i8*, i8** %4
%7 = call i32 @_rte_mempool_sp_put(%struct.rte_mempool* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.rte_mempool = type { i32 }
define void @rte_mempool_put(%struct.rte_mempool* %0, i8* %1) {
%3 = tail call i32 @_rte_mempool_sp_put(%struct.rte_mempool* %0, i8* %1)
ret void
}
int test_imm_CAint16_mem(short *val) {
  return ((*val) & (0xCA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CAint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 202
%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_CAint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 202
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int get_4bytes(const unsigned char *p) {
  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}


x86 assembly (clang, -O0):
<get_4bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_4bytes(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ csi11_init();
int /*<<< orphan*/ csi11_send(char *, int);
int main(void) {
  csi11_init();
  (void)csi11_send("Hello, RL78 [:\n", 14);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <csi11_init@plt>
lea    0xec3(%rip),%rdi
mov    $0xe,%esi
call   1040 <csi11_send@plt>
jmp    1147 <main+0x27>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <csi11_init@plt>
lea    0xed1(%rip),%rdi
mov    $0xe,%esi
call   1040 <csi11_send@plt>
nopl   0x0(%rax)
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, RL78 [:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @csi11_init()
%3 = call i32 @csi11_send(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 14)
br label %4
4: ; preds = %4, %0
br label %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello, RL78 [:\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @csi11_init()
%2 = tail call i32 @csi11_send(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 14)
br label %3
3: ; preds = %3, %0
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double);
void grace_output_horizontal_line_at_point(FILE *output_pipe,
                                           double horizontal_line_at_point) {
  fprintf(output_pipe,
          "@with line\n"
          "@	line on\n"
          "@	line loctype world\n"
          "@	line g0\n"
          "@	line 0, %.1lf, 100, %.1lf\n"
          "@	line linewidth 1.5\n"
          "@	line linestyle 1\n"
          "@	line color 1\n"
          "@	line arrow 0\n"
          "@	line arrow type 0\n"
          "@	line arrow length 1.0\n"
          "@	line arrow layout 1.0,1.0\n"
          "@line def\n",
          horizontal_line_at_point, horizontal_line_at_point);
}


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

x86 assembly (clang, -O2):
<grace_output_horizontal_line_at_point>:
lea    0xee9(%rip),%rsi
movaps %xmm0,%xmm1
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [233 x i8] c"@with line\0A@\09line on\0A@\09line loctype world\0A@\09line g0\0A@\09line 0, %.1lf, 100, %.1lf\0A@\09line linewidth 1.5\0A@\09line linestyle 1\0A@\09line color 1\0A@\09line arrow 0\0A@\09line arrow type 0\0A@\09line arrow length 1.0\0A@\09line arrow layout 1.0,1.0\0A@line def\0A\00"
define void @grace_output_horizontal_line_at_point(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
store i32* %0, i32** %3
store double %1, double* %4
%5 = load i32*, i32** %3
%6 = load double, double* %4
%7 = load double, double* %4
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0), double %6, double %7)
ret void
}

LLVM IR (-O2):
@.str = [233 x i8] c"@with line\0A@\09line on\0A@\09line loctype world\0A@\09line g0\0A@\09line 0, %.1lf, 100, %.1lf\0A@\09line linewidth 1.5\0A@\09line linestyle 1\0A@\09line color 1\0A@\09line arrow 0\0A@\09line arrow type 0\0A@\09line arrow length 1.0\0A@\09line arrow layout 1.0,1.0\0A@line def\0A\00"
define void @grace_output_horizontal_line_at_point(i32* nocapture %0, double %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0), double %1, double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *result = malloc(size);
  if (result == NULL) {
    fprintf(stderr, "error: malloc failed to allocate %ud bytes, now abort\n",
            (unsigned int)size);
    abort();
  }
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1176 <xmalloc+0x46>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"error: malloc failed to allocate %ud bytes, now abort\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = trunc i64 %10 to i32
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"error: malloc failed to allocate %ud bytes, now abort\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = trunc i64 %0 to i32
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1
ret i8* %2
}
void RTMemCacheFree(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemCacheFree() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ucpp_init_cppm();
void init_cpp(void) { ucpp_init_cppm(); }


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

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

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

LLVM IR (-O2):
define void @init_cpp() {
%1 = tail call i32 (...) @ucpp_init_cppm()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x82() {
  Assert_real((islower(130) == 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_islower.c",
              655, ("islower should be 0 for 0x82"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x82>:
push   %rax
mov    $0x82,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28f,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x82\00"
define void @t_islower_0x82() {
%1 = call i64 @islower(i32 130)
%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 655, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x82\00"
define void @t_islower_0x82() {
%1 = tail call i64 @islower(i32 130)
%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 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: rand_emmc_perf [ -r | -w ] [-o] <size_in_mb> <block_dev>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: rand_emmc_perf [ -r | -w ] [-o] <size_in_mb> <block_dev>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: rand_emmc_perf [ -r | -w ] [-o] <size_in_mb> <block_dev>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strrchr(char const *, int);
char *os_strrchr(const char *s, int c) { return strrchr(s, c); }


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

x86 assembly (clang, -O2):
<os_strrchr>:
jmp    1030 <strrchr@plt>

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

LLVM IR (-O2):
define i8* @os_strrchr(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ memory_exhausted(int /*<<< orphan*/);
void *check_nonnull(void *p) {
  if (!p)
    memory_exhausted(errno);
  return p;
}


x86 assembly (clang, -O0):
<check_nonnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1135 <check_nonnull+0x25>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <memory_exhausted@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_nonnull>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1127 <check_nonnull+0x17>
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <memory_exhausted@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i8* @check_nonnull(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @errno
%5 = tail call i32 @memory_exhausted(i32 %4)
br label %6
6: ; preds = %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, unsigned long);
void ft_putstr_fd_len(char const *s, int f, unsigned long l) {
  (void)write(f, s, l);
  return;
}


x86 assembly (clang, -O0):
<ft_putstr_fd_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd_len>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putstr_fd_len(i8* nocapture %0, i32 %1, i64 %2) {
%4 = tail call i32 @write(i32 %1, i8* %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_get_prebuf() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_get_prebuf"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_prebuf\0A\00"
define i32 @pa_memblockq_get_prebuf() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_prebuf\00"
define i32 @pa_memblockq_get_prebuf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int buildinfo_rtwmakecfg_src(int i) { return i; }


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

x86 assembly (clang, -O2):
<buildinfo_rtwmakecfg_src>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @buildinfo_rtwmakecfg_src(i32 returned %0) {
ret i32 %0
}
void doUpdate() {}


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

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

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

LLVM IR (-O2):
define void @doUpdate() {
ret void
}
int sync_test_and_clear_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  __asm__ __volatile__("lock; btrl %2,%1\n\tsbbl %0,%0"
                       : "=r"(oldbit), "+m"((*(volatile long *)addr))
                       : "Ir"(nr)
                       : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<sync_test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock btr %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_test_and_clear_bit>:
lock btr %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sync_test_and_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "lock; btrl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @sync_test_and_clear_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "lock; btrl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Variables and functions */
long fpathconf(int, int);
long pathconf(const char *path, int name) { return fpathconf(-1, name); }


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

x86 assembly (clang, -O2):
<pathconf>:
mov    $0xffffffff,%edi
jmp    1030 <fpathconf@plt>

LLVM IR (-O0):
define i64 @pathconf(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 = call i64 @fpathconf(i32 -1, i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @pathconf(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i64 @fpathconf(i32 -1, i32 %1)
ret i64 %3
}
int main(int argc, char **argv) {
  int *ptr;
  printf("%x\n", &(argv[1]));
  int i = atol(argv[1]);
  printf("%x\n", &i);
  unsigned int j = 0;
  if (i < 10) {
    j = i;
    ptr = (int *)malloc(j);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1050 <atol@plt>
mov    %eax,-0x1c(%rbp)
lea    0xe8b(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    11a5 <main+0x75>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
add    $0x8,%rsi
lea    0xece(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rdi
xor    %eax,%eax
call   1040 <atol@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %4)
%6 = bitcast i32* %3 to i8*
%7 = load i8*, i8** %4
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atol to i32 (i8*, ...)*)(i8* %7)
store i32 %8, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
ret i32 0
}
/* Variables and functions */
void *__span_realloc(void *, size_t);
void *span_realloc(void *ptr, size_t size) { return __span_realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<span_realloc>:
jmp    1030 <__span_realloc@plt>

LLVM IR (-O0):
define i8* @span_realloc(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 = call i8* @__span_realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @span_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @__span_realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_rotation_z(float *, float);
__attribute__((always_)) struct mat4 *psmat4_rotation_z(struct mat4 *result,
                                                        float angle) {
  mat4_rotation_z((float *)result, angle);
  return result;
}


x86 assembly (clang, -O0):
<psmat4_rotation_z>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1030 <mat4_rotation_z@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat4_rotation_z>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_rotation_z@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_rotation_z(%struct.mat4* %0, float %1) {
%3 = alloca %struct.mat4*
%4 = alloca float
store %struct.mat4* %0, %struct.mat4** %3
store float %1, float* %4
%5 = load %struct.mat4*, %struct.mat4** %3
%6 = bitcast %struct.mat4* %5 to float*
%7 = load float, float* %4
%8 = call i32 @mat4_rotation_z(float* %6, float %7)
%9 = load %struct.mat4*, %struct.mat4** %3
ret %struct.mat4* %9
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_rotation_z(%struct.mat4* returned %0, float %1) {
%3 = bitcast %struct.mat4* %0 to float*
%4 = tail call i32 @mat4_rotation_z(float* %3, float %1)
ret %struct.mat4* %0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_set_num_temporal_layers(uint8_t *p, uint8_t val) {
  p[21] &= ~0x38;
  p[21] |= val << 3;
}


x86 assembly (clang, -O0):
<h265hvcc_set_num_temporal_layers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x54(%rax),%ecx
and    $0xffffffc7,%ecx
mov    %ecx,0x54(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
mov    -0x8(%rbp),%rax
or     0x54(%rax),%ecx
mov    %ecx,0x54(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_set_num_temporal_layers>:
mov    0x54(%rdi),%eax
and    $0xffffffc7,%eax
shl    $0x3,%esi
or     %eax,%esi
mov    %esi,0x54(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_num_temporal_layers(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 21
%7 = load i32, i32* %6
%8 = and i32 %7, -57
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 21
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_num_temporal_layers(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 21
%4 = load i32, i32* %3
%5 = and i32 %4, -57
%6 = shl i32 %1, 3
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}
unsigned int reg_get_bit(volatile unsigned int *reg, unsigned int bit) {
  unsigned int temp;
  temp = *reg;
  temp = (temp >> bit) & 1;
  return temp;
}


x86 assembly (clang, -O0):
<reg_get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_get_bit>:
mov    %esi,%ecx
mov    (%rdi),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @reg_get_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = lshr i32 %8, %9
%11 = and i32 %10, 1
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @reg_get_bit(i32* %0, i32 %1) {
%3 = load volatile i32, i32* %0
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
int median_of(elements, count)
int *count;
short elements[];
{
  short median;
  fsort_elements(elements, count);
  median = elements[*count / 2];
  return (median);
}


x86 assembly (clang, -O0):
<median_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <fsort_elements@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%ax
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_of>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <fsort_elements@plt>
mov    (%rbx),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
movswl (%r14,%rax,2),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @median_of(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
%5 = alloca i16
store i16* %0, i16** %3
store i32* %1, i32** %4
%6 = load i16*, i16** %3
%7 = load i32*, i32** %4
%8 = call i32 (i16*, i32*, ...) bitcast (i32 (...)* @fsort_elements to i32 (i16*, i32*, ...)*)(i16* %6, i32* %7)
%9 = load i16*, i16** %3
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i16, i16* %9, i64 %13
%15 = load i16, i16* %14
store i16 %15, i16* %5
%16 = load i16, i16* %5
%17 = sext i16 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @median_of(i16* %0, i32* %1) {
%3 = tail call i32 (i16*, i32*, ...) bitcast (i32 (...)* @fsort_elements to i32 (i16*, i32*, ...)*)(i16* %0, i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i16, i16* %0, i64 %6
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_get_stream_group() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_get_stream_group"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_proplist_get_stream_group\0A\00"
define i32 @pa_proplist_get_stream_group() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_proplist_get_stream_group\00"
define i32 @pa_proplist_get_stream_group() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int sqrt(double);
double fz(double *y, double t, double *par) { return -1. / sqrt(-t + y[0]); }


x86 assembly (clang, -O0):
<fz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xea6(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz>:
push   %rax
movsd  (%rdi),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xecf(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fz(double* %0, double %1, double* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double*
store double* %0, double** %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double, double* %5
%8 = fneg double %7
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = fadd double %8, %11
%13 = call i32 @sqrt(double %12)
%14 = sitofp i32 %13 to double
%15 = fdiv double -1.000000e+00, %14
ret double %15
}

LLVM IR (-O2):
define double @fz(double* nocapture %0, double %1, double* nocapture readnone %2) {
%4 = load double, double* %0
%5 = fsub double %4, %1
%6 = tail call i32 @sqrt(double %5)
%7 = sitofp i32 %6 to double
%8 = fdiv double -1.000000e+00, %7
ret double %8
}
/* Variables and functions */
int __cxa_atexit(void (*)(void *), void *, void *);
int __aeabi_atexit(void *object, void (*func)(void *), void *dso) {
  return __cxa_atexit(func, object, dso);
}


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

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

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

LLVM IR (-O2):
define i32 @__aeabi_atexit(i8* %0, void (i8*)* %1, i8* %2) {
%4 = tail call i32 @__cxa_atexit(void (i8*)* %1, i8* %0, i8* %2)
ret i32 %4
}
void MEM0_set_fp_exception(int num, void *handler) {
  unsigned long *exception_ptr =
      (unsigned long *)((long)0x0000011C + 0x10 * num);
  *exception_ptr = *((unsigned long *)handler);
}


x86 assembly (clang, -O0):
<MEM0_set_fp_exception>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
cltq
add    $0x11c,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MEM0_set_fp_exception>:
movslq %edi,%rax
shl    $0x4,%rax
mov    (%rsi),%rcx
mov    %rcx,0x11c(%rax)
ret

LLVM IR (-O0):
define void @MEM0_set_fp_exception(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = mul nsw i32 16, %6
%8 = sext i32 %7 to i64
%9 = add nsw i64 284, %8
%10 = inttoptr i64 %9 to i64*
store i64* %10, i64** %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
%14 = load i64*, i64** %5
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
define void @MEM0_set_fp_exception(i32 %0, i8* nocapture %1) {
%3 = shl nsw i32 %0, 4
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, 284
%6 = inttoptr i64 %5 to i64*
%7 = bitcast i8* %1 to i64*
%8 = load i64, i64* %7
store i64 %8, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_logical_shift_right(void) {
  gen_pop();
  gen_call("_asl");
}


x86 assembly (clang, -O0):
<gen_logical_shift_right>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_logical_shift_right>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"_asl\00"
define void @gen_logical_shift_right() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"_asl\00"
define void @gen_logical_shift_right() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ afficher_aide();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int help(int argc, char **argv) {
  if (argc != 1) {
    fprintf(stderr, "Philsh: Usage: %s : Print help\n", argv[0]);
    return 2;
  }
  afficher_aide();
  return 0;
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1161 <help+0x41>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    116f <help+0x4f>
mov    $0x0,%al
call   1040 <afficher_aide@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
cmp    $0x1,%edi
jne    1131 <help+0x11>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <afficher_aide@plt>
jmp    114e <help+0x2e>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Philsh: Usage: %s : Print help\0A\00"
define i32 @help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 2, i32* %3
br label %16
14: ; preds = %2
%15 = call i32 (...) @afficher_aide()
store i32 0, i32* %3
br label %16
16: ; preds = %14, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Philsh: Usage: %s : Print help\0A\00"
define i32 @help(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @afficher_aide()
br label %10
10: ; preds = %8, %4
%11 = phi i32 [ 2, %4 ], [ 0, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void show_usage() {
  fprintf(stderr,
          "usage: hlld [-h] [-f filename] [-w num]\n\n    -h : Displays this "
          "help info\n    -f : Reads the hlld configuration from this file\n   "
          " -w : Sets the number of worker threads\n\n");
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [172 x i8] c"usage: hlld [-h] [-f filename] [-w num]\0A\0A -h : Displays this help info\0A -f : Reads the hlld configuration from this file\0A -w : Sets the number of worker threads\0A\0A\00"
define void @show_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [172 x i8] c"usage: hlld [-h] [-f filename] [-w num]\0A\0A -h : Displays this help info\0A -f : Reads the hlld configuration from this file\0A -w : Sets the number of worker threads\0A\0A\00"
define void @show_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct darr {
  int dummy;
};

/* Variables and functions */
void const *darr_first(struct darr *);
const void *darr_first_const(const struct darr *d) {
  return darr_first((struct darr *)d);
}


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

x86 assembly (clang, -O2):
<darr_first_const>:
jmp    1030 <darr_first@plt>

LLVM IR (-O0):
%struct.darr = type { i32 }
define i8* @darr_first_const(%struct.darr* %0) {
%2 = alloca %struct.darr*
store %struct.darr* %0, %struct.darr** %2
%3 = load %struct.darr*, %struct.darr** %2
%4 = call i8* @darr_first(%struct.darr* %3)
ret i8* %4
}

LLVM IR (-O2):
%struct.darr = type { i32 }
define i8* @darr_first_const(%struct.darr* %0) {
%2 = tail call i8* @darr_first(%struct.darr* %0)
ret i8* %2
}