xunge/DecIR huggingface dataset:
void commonVoid(void) {}


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

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

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

LLVM IR (-O2):
define void @commonVoid() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xb9() {
  Assert_real((ispunct(185) == 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_ispunct.c",
              930, ("ispunct should be 0 for 0xb9"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xb9>:
push   %rax
mov    $0xb9,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3a2,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb9\00"
define void @t_ispunct_0xb9() {
%1 = call i64 @ispunct(i32 185)
%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 930, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb9\00"
define void @t_ispunct_0xb9() {
%1 = tail call i64 @ispunct(i32 185)
%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 930, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_stuff();
int foo(int x) { do_stuff(); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <do_stuff@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 (...) @do_stuff()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int s_isdir(mode_t mode) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @s_isdir(i32 %0) {
ret i32 -1
}
int xmlUCSIsCatMe(int code) {
  return (((code >= 0x488) && (code <= 0x489)) || (code == 0x6de) ||
          ((code >= 0x20dd) && (code <= 0x20e0)) ||
          ((code >= 0x20e2) && (code <= 0x20e4)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCatMe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x488,-0x4(%rbp)
jl     1126 <xmlUCSIsCatMe+0x26>
mov    $0x1,%al
cmpl   $0x489,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    117c <xmlUCSIsCatMe+0x7c>
mov    $0x1,%al
cmpl   $0x6de,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     117c <xmlUCSIsCatMe+0x7c>
cmpl   $0x20dd,-0x4(%rbp)
jl     1157 <xmlUCSIsCatMe+0x57>
mov    $0x1,%al
cmpl   $0x20e0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    117c <xmlUCSIsCatMe+0x7c>
xor    %eax,%eax
cmpl   $0x20e2,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1176 <xmlUCSIsCatMe+0x76>
cmpl   $0x20e4,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCatMe>:
mov    $0x1,%eax
lea    -0x488(%rdi),%ecx
cmp    $0x2,%ecx
jb     1131 <xmlUCSIsCatMe+0x31>
cmp    $0x6de,%edi
je     1131 <xmlUCSIsCatMe+0x31>
lea    -0x20dd(%rdi),%ecx
cmp    $0x4,%ecx
jb     1131 <xmlUCSIsCatMe+0x31>
add    $0xffffdf1e,%edi
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCatMe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 1160
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 1161
br i1 %7, label %25, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1758
br i1 %10, label %25, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 8413
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 8416
br i1 %16, label %25, label %17
17: ; preds = %14, %11
%18 = load i32, i32* %2
%19 = icmp sge i32 %18, 8418
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 8420
br label %23
23: ; preds = %20, %17
%24 = phi i1 [ false, %17 ], [ %22, %20 ]
br label %25
25: ; preds = %23, %14, %8, %5
%26 = phi i1 [ true, %14 ], [ true, %8 ], [ true, %5 ], [ %24, %23 ]
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @xmlUCSIsCatMe(i32 %0) {
switch i32 %0, label %2 [
i32 1758, label %9
i32 1161, label %9
i32 1160, label %9
]
2: ; preds = %1
%3 = add i32 %0, -8413
%4 = icmp ult i32 %3, 4
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = add i32 %0, -8418
%7 = icmp ult i32 %6, 3
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %1, %1, %1, %2, %5
%10 = phi i32 [ %8, %5 ], [ 1, %1 ], [ 1, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_css_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("css", " /*comment*/"),
                            "comment", "/*comment*/");
}


x86 assembly (clang, -O0):
<test_css_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xed1(%rip),%rsi
lea    0xebe(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_css_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xed6(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"css\00"
@.str.1 = [13 x i8] c" /*comment*/\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [12 x i8] c"/*comment*/\00"
define void @test_css_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"css\00"
@.str.1 = [13 x i8] c" /*comment*/\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [12 x i8] c"/*comment*/\00"
define void @test_css_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *escreve(void *numero) {
  int *n = (int *)numero;
  printf("Sistemas Operativos II thread n. = %d\n", *n);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<escreve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escreve>:
push   %rax
mov    (%rdi),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Sistemas Operativos II thread n. = %d\0A\00"
define i8* @escreve(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @pthread_exit(i32* null)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [39 x i8] c"Sistemas Operativos II thread n. = %d\0A\00"
define noalias i8* @escreve(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
char const *getenv(char *);
const char *fh_shr_cfg_home() {
  return (getenv("FH_HOME") == NULL) ? "/opt/csi/fh" : getenv("FH_HOME");
}


x86 assembly (clang, -O0):
<fh_shr_cfg_home>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
jne    113e <fh_shr_cfg_home+0x2e>
lea    0xed3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <fh_shr_cfg_home+0x3e>
lea    0xebb(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fh_shr_cfg_home>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee1(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"FH_HOME\00"
@.str.1 = [12 x i8] c"/opt/csi/fh\00"
define i8* @fh_shr_cfg_home() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %4
3: ; preds = %0
br label %6
4: ; preds = %0
%5 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %3
%7 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %3 ], [ %5, %4 ]
ret i8* %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"FH_HOME\00"
@.str.1 = [12 x i8] c"/opt/csi/fh\00"
define i8* @fh_shr_cfg_home() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
void set_A1(int A1[2], int M, int N) {
  A1[0] = M / 2;
  A1[1] = N / 2;
}


x86 assembly (clang, -O0):
<set_A1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_A1>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,(%rdi)
mov    %edx,%eax
shr    $0x1f,%eax
add    %edx,%eax
sar    %eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @set_A1(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = sdiv i32 %7, 2
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32, i32* %6
%12 = sdiv i32 %11, 2
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @set_A1(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sdiv i32 %1, 2
store i32 %4, i32* %0
%5 = sdiv i32 %2, 2
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
unsigned char enshift(unsigned char x) { return x & 0x0000001f; }


x86 assembly (clang, -O0):
<enshift>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1f,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enshift>:
mov    %edi,%eax
and    $0x1f,%al
ret

LLVM IR (-O0):
define zeroext i8 @enshift(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 31
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @enshift(i8 zeroext %0) {
%2 = and i8 %0, 31
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_lisp_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("lisp", " ;comment"),
                            "comment", ";comment");
}


x86 assembly (clang, -O0):
<test_lisp_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec7(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lisp_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecc(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"lisp\00"
@.str.1 = [10 x i8] c" ;comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c";comment\00"
define void @test_lisp_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"lisp\00"
@.str.1 = [10 x i8] c" ;comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c";comment\00"
define void @test_lisp_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int ilog2(int n) {
  if (n == 0)
    return 0;
  if (n == 1)
    return 0;
  else
    return ilog2(n >> 1) + 1;
}


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <ilog2+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1158 <ilog2+0x48>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <ilog2+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1158 <ilog2+0x48>
mov    -0x8(%rbp),%edi
sar    $0x1,%edi
call   1030 <ilog2@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = ashr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
unsigned long long a(unsigned long i) { return ~(unsigned long long)0 << i; }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mov    %rdi,%rcx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @a(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 -1, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @a(i64 %0) {
%2 = shl nsw i64 -1, %0
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_api_routines;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int spatialdb_init(int /*<<< orphan*/ *, char const **,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/);
int /*<<< orphan*/ spatialdb_spatialite2_schema();
int sqlite3_gpkg_spl2_init(sqlite3 *db, const char **pzErrMsg,
                           const sqlite3_api_routines *pThunk) {
  return spatialdb_init(db, pzErrMsg, pThunk, spatialdb_spatialite2_schema());
}


x86 assembly (clang, -O0):
<sqlite3_gpkg_spl2_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <spatialdb_spatialite2_schema@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1030 <spatialdb_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3_gpkg_spl2_init>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <spatialdb_spatialite2_schema@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <spatialdb_init@plt>

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

LLVM IR (-O2):
define i32 @sqlite3_gpkg_spl2_init(i32* %0, i8** %1, i32* %2) {
%4 = tail call i32 (...) @spatialdb_spatialite2_schema()
%5 = tail call i32 @spatialdb_init(i32* %0, i8** %1, i32* %2, i32 %4)
ret i32 %5
}
int ppro_with_ram_bug(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @ppro_with_ram_bug() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ppro_with_ram_bug() {
ret i32 0
}
int rtl839x_dma_if_rx_ring_cntr(int i) { return (0x603c) + ((i >> 3) << 2); }


x86 assembly (clang, -O0):
<rtl839x_dma_if_rx_ring_cntr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
shl    $0x2,%eax
add    $0x603c,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl839x_dma_if_rx_ring_cntr>:
sar    %edi
lea    0x603c(%rdi),%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @rtl839x_dma_if_rx_ring_cntr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 3
%5 = shl i32 %4, 2
%6 = add nsw i32 24636, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @rtl839x_dma_if_rx_ring_cntr(i32 %0) {
%2 = ashr i32 %0, 1
%3 = add nsw i32 %2, 24636
%4 = and i32 %3, -4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sc1200wdt_write_data(unsigned char, unsigned char);
void sc1200wdt_stop(void) {
  {
    sc1200wdt_write_data((unsigned char)5, (unsigned char)0);
    return;
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <sc1200wdt_write_data@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sc1200wdt_stop() {
%1 = call i32 @sc1200wdt_write_data(i8 zeroext 5, i8 zeroext 0)
ret void
}

LLVM IR (-O2):
define void @sc1200wdt_stop() {
%1 = tail call i32 @sc1200wdt_write_data(i8 zeroext 5, i8 zeroext 0)
ret void
}
/* Variables and functions */
bool nrf91_errata_23(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf91_errata_23() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf91_errata_23() {
ret i32 0
}
void no_llseek(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<no_llseek>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_llseek>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.no_llseek = [10 x i8] c"no_llseek\00"
define void @no_llseek() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.no_llseek, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.no_llseek = [10 x i8] c"no_llseek\00"
define void @no_llseek() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.no_llseek, i64 0, i64 0))
ret void
}
void wifi_rsp_tcpip_start_udp_server(
    const struct wifi_msg_tcpip_start_udp_server_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_tcpip_start_udp_server_rsp_t = type opaque
define void @wifi_rsp_tcpip_start_udp_server(%struct.wifi_msg_tcpip_start_udp_server_rsp_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ _real_syscall(int /*<<< orphan*/);
__attribute__((visibility("hidden"))) pid_t _real_gettid(void) {
  return (pid_t)_real_syscall(SYS_gettid);
}


x86 assembly (clang, -O0):
<_real_gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <_real_syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_real_gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_real_syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define hidden i32 @_real_gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = call i32 @_real_syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define hidden i32 @_real_gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @_real_syscall(i32 %1)
ret i32 %2
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *s) {
  char *d;
  d = malloc(sizeof(char) * (strlen(s) + 1));
  if (!d)
    return NULL;
  strcpy(d, s);
  return d;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1171 <strdup+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1186 <strdup+0x56>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <strdup+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ignore_whitespace(int /*<<< orphan*/ *);
int read_char(FILE *config_fp, int *value) {
  int c;
  c = ignore_whitespace(config_fp);
  *value = c;
  return 1;
}


x86 assembly (clang, -O0):
<read_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ignore_whitespace@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_char>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ignore_whitespace@plt>
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_char(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 = call i32 @ignore_whitespace(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32*, i32** %4
store i32 %8, i32* %9
ret i32 1
}

LLVM IR (-O2):
define i32 @read_char(i32* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @ignore_whitespace(i32* %0)
store i32 %3, i32* %1
ret i32 1
}
void I_StartupGraphics(void) {}


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

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

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

LLVM IR (-O2):
define void @I_StartupGraphics() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ extern_func1_3(int, char *, unsigned long);
void extern_func1_2(int a, char *b, unsigned long c) {
  extern_func1_3(a, b, c);
}


x86 assembly (clang, -O0):
<extern_func1_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <extern_func1_3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extern_func1_2>:
jmp    1030 <extern_func1_3@plt>

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

LLVM IR (-O2):
define void @extern_func1_2(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @extern_func1_3(i32 %0, i8* %1, i64 %2)
ret void
}
long long foo(long long a, unsigned char *b, signed char *c) {
  return a + (long long)*b * (long long)*c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
mov    -0x18(%rbp),%rdx
movsbq (%rdx),%rdx
imul   %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movzbl (%rsi),%ecx
movsbq (%rdx),%rax
imul   %rcx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0, i8* %1, i8* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = load i8*, i8** %6
%12 = load i8, i8* %11
%13 = sext i8 %12 to i64
%14 = mul nsw i64 %10, %13
%15 = add nsw i64 %7, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i8* nocapture %1, i8* nocapture %2) {
%4 = load i8, i8* %1
%5 = zext i8 %4 to i64
%6 = load i8, i8* %2
%7 = sext i8 %6 to i64
%8 = mul nsw i64 %7, %5
%9 = add nsw i64 %8, %0
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char a;
  int b;
  printf("%d\n", sizeof(a));
  printf("%d\n", sizeof(b));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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


x86 assembly (clang, -O0):
<op_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_eq>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @op_eq(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *const, unsigned int);
unsigned int pcm_dummy_write(const void *const device_st,
                             unsigned char *const buffer, unsigned int length) {
  memcpy((unsigned char *)device_st, buffer, length);
  return 0;
}


x86 assembly (clang, -O0):
<pcm_dummy_write>:
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 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcm_dummy_write>:
push   %rax
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pcm_dummy_write(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int ert_log_init(char *);
int /*<<< orphan*/ ert_process_register_backtrace_handler();
int ert_test_init() {
  ert_process_register_backtrace_handler();
  int result = ert_log_init("zlog.conf");
  return result;
}


x86 assembly (clang, -O0):
<ert_test_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ert_process_register_backtrace_handler@plt>
lea    0xeca(%rip),%rdi
call   1030 <ert_log_init@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"zlog.conf\00"
define i32 @ert_test_init() {
%1 = alloca i32
%2 = call i32 (...) @ert_process_register_backtrace_handler()
%3 = call i32 @ert_log_init(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"zlog.conf\00"
define i32 @ert_test_init() {
%1 = tail call i32 (...) @ert_process_register_backtrace_handler()
%2 = tail call i32 @ert_log_init(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void guard_footer(FILE *fp) { fprintf(fp, "#endif\n"); }


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

x86 assembly (clang, -O2):
<guard_footer>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"#endif\0A\00"
define void @guard_footer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"#endif\0A\00"
define void @guard_footer(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
ret void
}
/* Type definitions */
struct mcuio_packet {
  int dummy;
};

/* Variables and functions */
int BIT(int);
int mcuio_packet_type(struct mcuio_packet *);
int mcuio_packet_is_error(struct mcuio_packet *p) {
  return mcuio_packet_type(p) & BIT(5);
}


x86 assembly (clang, -O0):
<mcuio_packet_is_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mcuio_packet_type@plt>
mov    %eax,-0xc(%rbp)
mov    $0x5,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcuio_packet_is_error>:
push   %rbx
call   1040 <mcuio_packet_type@plt>
mov    %eax,%ebx
mov    $0x5,%edi
call   1030 <BIT@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mcuio_packet = type { i32 }
define i32 @mcuio_packet_is_error(%struct.mcuio_packet* %0) {
%2 = alloca %struct.mcuio_packet*
store %struct.mcuio_packet* %0, %struct.mcuio_packet** %2
%3 = load %struct.mcuio_packet*, %struct.mcuio_packet** %2
%4 = call i32 @mcuio_packet_type(%struct.mcuio_packet* %3)
%5 = call i32 @BIT(i32 5)
%6 = and i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.mcuio_packet = type { i32 }
define i32 @mcuio_packet_is_error(%struct.mcuio_packet* %0) {
%2 = tail call i32 @mcuio_packet_type(%struct.mcuio_packet* %0)
%3 = tail call i32 @BIT(i32 5)
%4 = and i32 %3, %2
ret i32 %4
}
const char *db_list_entities_report_sql(void) {
  static const char *query = "SELECT"
                             "  id AS 'User ID',"
                             "  name AS 'Entity Name',"
                             "  currency AS 'Currency',"
                             "  parent AS 'Parent'"
                             "  FROM entities"
                             "  ORDER BY id";
  return query;
}


x86 assembly (clang, -O0):
<db_list_entities_report_sql>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_list_entities_report_sql>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@db_list_entities_report_sql.query = internal global i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i32 0, i32 0)
@.str = [122 x i8] c"SELECT id AS 'User ID', name AS 'Entity Name', currency AS 'Currency', parent AS 'Parent' FROM entities ORDER BY id\00"
define i8* @db_list_entities_report_sql() {
%1 = load i8*, i8** @db_list_entities_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [122 x i8] c"SELECT id AS 'User ID', name AS 'Entity Name', currency AS 'Currency', parent AS 'Parent' FROM entities ORDER BY id\00"
define i8* @db_list_entities_report_sql() {
ret i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sink(void *);
__attribute__((noipa)) void *return_vla(int n) {
  char a[n];
  void *p = a;
  sink(p);
  return p;
}


x86 assembly (clang, -O0):
<return_vla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <sink@plt>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_vla>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <sink@plt>
mov    %rbx,%rax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @return_vla(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @sink(i8* %10)
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @return_vla(i32 %0) {
%2 = zext i32 %0 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @sink(i8* %3)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x08() {
  Assert_real((ispunct(8) == 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_ispunct.c",
              45, ("ispunct should be 0 for 0x08"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x08>:
push   %rax
mov    $0x8,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x08\00"
define void @t_ispunct_0x08() {
%1 = call i64 @ispunct(i32 8)
%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 45, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x08\00"
define void @t_ispunct_0x08() {
%1 = tail call i64 @ispunct(i32 8)
%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 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_read_multprec_system(int deci) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(440, &deci, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_read_multprec_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1b8,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @syscon_read_multprec_system(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 440, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_read_multprec_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 440, i32* %2, i32* undef, double* undef)
ret i32 %3
}
int cvFloor(double value) {
  int i = (int)value;
  return i - (i > value);
}


x86 assembly (clang, -O0):
<cvFloor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sdl -0xc(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvFloor>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cvFloor(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = load double, double* %2
%10 = fcmp ogt double %8, %9
%11 = zext i1 %10 to i32
%12 = sub nsw i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @cvFloor(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fcmp ogt double %3, %0
%5 = sext i1 %4 to i32
%6 = add i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ testSwap_16();
int /*<<< orphan*/ testSwap_16_ptr();
int /*<<< orphan*/ testSwap_4();
int /*<<< orphan*/ testSwap_8();
void testSwap(void) {
  testSwap_4();
  testSwap_8();
  testSwap_16();
  testSwap_16_ptr();
}


x86 assembly (clang, -O0):
<testSwap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <testSwap_4@plt>
mov    $0x0,%al
call   1030 <testSwap_8@plt>
mov    $0x0,%al
call   1050 <testSwap_16@plt>
mov    $0x0,%al
call   1060 <testSwap_16_ptr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testSwap>:
push   %rax
xor    %eax,%eax
call   1040 <testSwap_4@plt>
xor    %eax,%eax
call   1030 <testSwap_8@plt>
xor    %eax,%eax
call   1050 <testSwap_16@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <testSwap_16_ptr@plt>

LLVM IR (-O0):
define void @testSwap() {
%1 = call i32 (...) @testSwap_4()
%2 = call i32 (...) @testSwap_8()
%3 = call i32 (...) @testSwap_16()
%4 = call i32 (...) @testSwap_16_ptr()
ret void
}

LLVM IR (-O2):
define void @testSwap() {
%1 = tail call i32 (...) @testSwap_4()
%2 = tail call i32 (...) @testSwap_8()
%3 = tail call i32 (...) @testSwap_16()
%4 = tail call i32 (...) @testSwap_16_ptr()
ret void
}