xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strcpy(char *dest, const char *src) {
  char *p = NULL;
  for (p = dest; *src != '\0'; p++, src++)
    *p = *src;
  *p = '\0';
  return (dest);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <strcpy+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <strcpy+0x1c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret i8* %0
}
short inw(short port) {
  short ret;
  asm volatile("inw %1, %0" : "=a"(ret) : "Nd"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define signext i16 @inw(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @inw(i16 signext %0) {
%2 = tail call i16 asm sideeffect "inw $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
int test_imm_EFuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xEF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EFuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 239
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ panic(char *);
__attribute__((visibility("hidden"))) void xfree(void *ptr) {
  if (ptr == NULL)
    panic("xfree: NULL pointer given as argument\n");
  free(ptr);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <xfree+0x23>
lea    0xec2(%rip),%rdi
call   1040 <panic@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1135 <xfree+0x15>
lea    0xed0(%rip),%rdi
call   1040 <panic@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"xfree: NULL pointer given as argument\0A\00"
define hidden void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @panic(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"xfree: NULL pointer given as argument\0A\00"
define hidden void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @panic(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @free(i8* %0)
ret void
}
int do_862() { return 862; }


x86 assembly (clang, -O0):
<do_862>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35e,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_862() {
ret i32 862
}

LLVM IR (-O2):
define i32 @do_862() {
ret i32 862
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
float vec3i_length(int /*<<< orphan*/ *);
__attribute__((always_)) float psvec3i_length(struct vec3i *a) {
  return vec3i_length((int32_t *)a);
}


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

x86 assembly (clang, -O2):
<psvec3i_length>:
jmp    1030 <vec3i_length@plt>

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define float @psvec3i_length(%struct.vec3i* %0) {
%2 = alloca %struct.vec3i*
store %struct.vec3i* %0, %struct.vec3i** %2
%3 = load %struct.vec3i*, %struct.vec3i** %2
%4 = bitcast %struct.vec3i* %3 to i32*
%5 = call float @vec3i_length(i32* %4)
ret float %5
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define float @psvec3i_length(%struct.vec3i* %0) {
%2 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%3 = tail call float @vec3i_length(i32* %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc23(void) {
  printf("Executing exitfunc"
         "23"
         ".\n");
  exit(0);
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc23.\00"
define void @exitfunc23() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void dbg_dump_znode(const struct ubifs_info *c,
                    const struct ubifs_znode *znode) {
  return;
}


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

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
%struct.ubifs_znode = type opaque
define void @dbg_dump_znode(%struct.ubifs_info* %0, %struct.ubifs_znode* %1) {
%3 = alloca %struct.ubifs_info*
%4 = alloca %struct.ubifs_znode*
store %struct.ubifs_info* %0, %struct.ubifs_info** %3
store %struct.ubifs_znode* %1, %struct.ubifs_znode** %4
ret void
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.ubifs_znode = type opaque
define void @dbg_dump_znode(%struct.ubifs_info* nocapture %0, %struct.ubifs_znode* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
int /*<<< orphan*/ usleep(int);
void pa_threaded_mainloop_wait(int *m) {
  empty_log("pa_threaded_mainloop_wait: waiting\n");
  usleep(10000);
}


x86 assembly (clang, -O0):
<pa_threaded_mainloop_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <empty_log@plt>
mov    $0x2710,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_threaded_mainloop_wait>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <empty_log@plt>
mov    $0x2710,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"pa_threaded_mainloop_wait: waiting\0A\00"
define void @pa_threaded_mainloop_wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @empty_log(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @usleep(i32 10000)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"pa_threaded_mainloop_wait: waiting\0A\00"
define void @pa_threaded_mainloop_wait(i32* nocapture readnone %0) {
%2 = tail call i32 @empty_log(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @usleep(i32 10000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ start_server();
int main(int argc, char *argv[]) {
  printf("Starting Webbly web server...\n");
  start_server();
  printf("Exiting Webbly web server...\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Starting Webbly web server...\0A\00"
@.str.1 = [30 x i8] c"Exiting Webbly web server...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @start_server()
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"Starting Webbly web server...\00"
@str.2 = [29 x i8] c"Exiting Webbly web server...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @start_server()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int d2x24_beep(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @d2x24_beep() {
ret i32 0
}
/* Variables and functions */
int __infer_nondet_int();
int fsync(int fildes) {
  int ret;
  ret = __infer_nondet_int();
  if (ret < -1 || ret > 0)
    while (1)
      ;
  return ret;
}


x86 assembly (clang, -O0):
<fsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jl     1139 <fsync+0x29>
cmpl   $0x0,-0x8(%rbp)
jle    1143 <fsync+0x33>
jmp    113e <fsync+0x2e>
jmp    113e <fsync+0x2e>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsync>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
lea    -0x1(%rax),%ecx
cmp    $0xfffffffd,%ecx
ja     1122 <fsync+0x12>
jmp    1120 <fsync+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fsync(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, -2
br i1 %4, label %5, label %6
5: ; preds = %1, %5
br label %5
6: ; preds = %1
ret i32 %2
}
unsigned xrop3_149_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_149_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_149_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
and    %ecx,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_149_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_149_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = and i32 %6, %4
%8 = xor i32 %7, -256
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ logmsg(int, int, char *);
int /*<<< orphan*/ plughook_init_plugins();
void init_plugins(void) {
  logmsg(3, 1, "Initializing plugins.\n");
  plughook_init_plugins();
  return;
}


x86 assembly (clang, -O0):
<init_plugins>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x1,%esi
lea    0xecb(%rip),%rdx
call   1040 <logmsg@plt>
mov    $0x0,%al
call   1030 <plughook_init_plugins@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_plugins>:
push   %rax
lea    0xed8(%rip),%rdx
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <logmsg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <plughook_init_plugins@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Initializing plugins.\0A\00"
define void @init_plugins() {
%1 = call i32 @logmsg(i32 3, i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @plughook_init_plugins()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Initializing plugins.\0A\00"
define void @init_plugins() {
%1 = tail call i32 @logmsg(i32 3, i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @plughook_init_plugins()
ret void
}
/* Variables and functions */
int _io_in8(int);
void wait_KBC_sendready(void) {
  for (;;) {
    if ((_io_in8(0x0064) & 0x02) == 0) {
      break;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<wait_KBC_sendready>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_KBC_sendready+0x9>
mov    $0x64,%edi
call   1030 <_io_in8@plt>
and    $0x2,%eax
cmp    $0x0,%eax
jne    1134 <wait_KBC_sendready+0x24>
jmp    1139 <wait_KBC_sendready+0x29>
jmp    1119 <wait_KBC_sendready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_KBC_sendready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <_io_in8@plt>
test   $0x2,%al
jne    1120 <wait_KBC_sendready+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_KBC_sendready() {
br label %1
1: ; preds = %6, %0
%2 = call i32 @_io_in8(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @wait_KBC_sendready() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @_io_in8(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
int __attribute__((target("arch=icelake-client"))) foo(void) { return 6; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 6
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 6
}
int sum_even_fibo(int lim) {
  int i = 1, j = 1, k = 2, res = 0;
  while (i < lim) {
    k = i + j;
    i = k;
    j = i;
    if ((i % 2) == 0) {
      res += i;
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<sum_even_fibo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1166 <sum_even_fibo+0x66>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1161 <sum_even_fibo+0x61>
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <sum_even_fibo+0x23>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_even_fibo>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111d <sum_even_fibo+0x1d>
mov    $0x1,%ecx
xor    %eax,%eax
xchg   %ax,%ax
lea    (%rax,%rcx,2),%eax
mov    %ecx,%edx
add    %ecx,%edx
mov    %edx,%ecx
cmp    %edi,%edx
jl     1110 <sum_even_fibo+0x10>
ret

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

LLVM IR (-O2):
define i32 @sum_even_fibo(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 1, %1 ]
%6 = shl nsw i32 %5, 1
%7 = add nsw i32 %4, %6
%8 = icmp slt i32 %6, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void fd255(int n) {
a : {
  typedef int(*b)[n];
P01A:
  goto P01A;
  {
    typedef int(*c)[n];
  P012A:
    goto P012A;
    0;
  }
P01B:
  goto P01B;
  {
    typedef int(*d)[n];
  P013A:
    goto P013A;
    0;
  }
P01C:
  goto P01C;
  ;
  typedef int(*e)[n];
P014A:
  goto P014A;
  0;
};
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
p03A:
  goto p03A;
  goto a;
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd255+0x7>

x86 assembly (clang, -O2):
<fd255>:
jmp    1100 <fd255>

LLVM IR (-O0):
define void @fd255(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %6, %3
br label %6
7: ; No predecessors!
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %10, %7
br label %10
11: ; preds = %11
br label %11
12: ; No predecessors!
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
br label %15
15: ; preds = %15, %12
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %20, %17
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
br label %25
25: ; preds = %25, %22
br label %25
26: ; No predecessors!
%27 = load i32, i32* %2
%28 = zext i32 %27 to i64
br label %29
29: ; preds = %29, %26
br label %29
30: ; preds = %30
br label %30
31: ; No predecessors!
%32 = load i32, i32* %2
%33 = zext i32 %32 to i64
br label %34
34: ; preds = %34, %31
br label %34
35: ; preds = %35
br label %35
36: ; No predecessors!
%37 = load i32, i32* %2
%38 = zext i32 %37 to i64
br label %39
39: ; preds = %39, %36
br label %39
40: ; preds = %40
br label %40
41: ; No predecessors!
%42 = load i32, i32* %2
%43 = zext i32 %42 to i64
br label %44
44: ; preds = %44, %41
br label %44
45: ; preds = %45
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd255(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void closeSafe(int fd) {
  int return_value = close(fd);
  if (return_value == -1) {
    fprintf(stderr, "Unable to execute close(%d)", fd);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<closeSafe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1172 <closeSafe+0x42>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeSafe>:
push   %rbx
mov    %edi,%ebx
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     113f <closeSafe+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Unable to execute close(%d)\00"
define void @closeSafe(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Unable to execute close(%d)\00"
define void @closeSafe(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int strlen(const char *str) {
  int res = 0;
  while (*str++)
    res++;
  return res;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void genjal_idle() {}


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

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

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

LLVM IR (-O2):
define void @genjal_idle() {
ret void
}
/* Type definitions */
typedef double GLfloat;

/* Variables and functions */
GLfloat int_to_glfloat(int i) {
  GLfloat f = 0.0;
  GLfloat *fp;
  int *ip;
  fp = &f;
  ip = &i;
  *fp = *((float *)ip);
  return f;
}


x86 assembly (clang, -O0):
<int_to_glfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_glfloat>:
movd   %edi,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @int_to_glfloat(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double*
%5 = alloca i32*
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
store double* %3, double** %4
store i32* %2, i32** %5
%6 = load i32*, i32** %5
%7 = bitcast i32* %6 to float*
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = load double*, double** %4
store double %9, double* %10
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @int_to_glfloat(i32 %0) {
%2 = bitcast i32 %0 to float
%3 = fpext float %2 to double
ret double %3
}
void AboutDlgProc(void) {}


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

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

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

LLVM IR (-O2):
define void @AboutDlgProc() {
ret void
}
/* Variables and functions */
int es_sizecmp(size_t str1, size_t str2) {
  return str1 < str2 ? -1 : str1 > str2 ? 1 : 0;
}


x86 assembly (clang, -O0):
<es_sizecmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <es_sizecmp+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <es_sizecmp+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_sizecmp>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @es_sizecmp(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = icmp ugt i64 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @es_sizecmp(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = icmp ugt i64 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void *foo(void *a) {
  long no = (long)a;
  printf("param is %ld\n", no);
  return (void *)(++no);
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"param is %ld\0A\00"
define i8* @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %6)
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
store i64 %9, i64* %3
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"param is %ld\0A\00"
define i8* @foo(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = add nsw i64 %2, 1
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
void aubio_cleanup(void) {}


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

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

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

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

/* Variables and functions */
char **dstrsplit(char const *, char *);
int /*<<< orphan*/ utf8_encode(char *, int, unsigned long);
char **dstrsplitc(const char *str, unsigned long sep) {
  char utfbuf[8] = {0};
  utf8_encode(utfbuf, sizeof(utfbuf), sep);
  return dstrsplit(str, utfbuf);
}


x86 assembly (clang, -O0):
<dstrsplitc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x8,%esi
call   1030 <utf8_encode@plt>
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <dstrsplit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dstrsplitc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x8,%esi
call   1030 <utf8_encode@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <dstrsplit@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8** @dstrsplitc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [8 x i8]
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = bitcast [8 x i8]* %5 to i8*
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%8 = load i64, i64* %4
%9 = call i32 @utf8_encode(i8* %7, i32 8, i64 %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%12 = call i8** @dstrsplit(i8* %10, i8* %11)
ret i8** %12
}

LLVM IR (-O2):
define i8** @dstrsplitc(i8* %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i32 @utf8_encode(i8* %4, i32 8, i64 %1)
%6 = call i8** @dstrsplit(i8* %0, i8* %4)
ret i8** %6
}
int atomic_exchange(int *ptr, int old, int new) {
  int ret;
  asm volatile("lock cmpxchgl %2,%1"
               : "=a"(ret), "+m"(*ptr)
               : "r"(new), "0"(old)
               : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<atomic_exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%eax
lock cmpxchg %edx,(%rcx)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_exchange>:
mov    %esi,%eax
lock cmpxchg %edx,(%rdi)
ret

LLVM IR (-O0):
define i32 @atomic_exchange(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = call i32 asm sideeffect "lock cmpxchgl $2,$1", "={ax},=*m,r,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %8, i32 %9, i32 %10, i32* elementtype(i32) %8)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @atomic_exchange(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 asm sideeffect "lock cmpxchgl $2,$1", "={ax},=*m,r,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %2, i32 %1, i32* elementtype(i32) %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void STEST903(int v) {
  printf("sub  (test15f) C903:(%d):(5):Call by value from literal\n", v);
}


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

x86 assembly (clang, -O2):
<STEST903>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"sub (test15f) C903:(%d):(5):Call by value from literal\0A\00"
define void @STEST903(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"sub (test15f) C903:(%d):(5):Call by value from literal\0A\00"
define void @STEST903(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ remove(char *);
void close_csi_device(int fd) {
  close(fd);
  remove("/dev/CSI_dev");
}


x86 assembly (clang, -O0):
<close_csi_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
lea    0xec6(%rip),%rdi
call   1030 <remove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_csi_device>:
push   %rax
call   1040 <close@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <remove@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/CSI_dev\00"
define void @close_csi_device(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = call i32 @remove(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/CSI_dev\00"
define void @close_csi_device(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = tail call i32 @remove(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x68() {
  Assert_real((isprint(104)),
              "/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_isprint.c",
              525, ("isprint should be 1 for h"));
}


x86 assembly (clang, -O0):
<t_isprint_0x68>:
push   %rbp
mov    %rsp,%rbp
mov    $0x68,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x20d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x68>:
push   %rax
mov    $0x68,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x20d,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for h\00"
define void @t_isprint_0x68() {
%1 = call i32 @isprint(i32 104)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 525, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for h\00"
define void @t_isprint_0x68() {
%1 = tail call i32 @isprint(i32 104)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 525, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((always_)) int modifier_times_multiplier(int modifier,
                                                       int multiplier) {
  return modifier * multiplier;
}


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

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

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

LLVM IR (-O2):
define i32 @modifier_times_multiplier(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int ehexh(char const);
__attribute__((unused)) int ehex(const char *s) {
  return 16 * ehexh(*s) + ehexh(*(s + 1));
}


x86 assembly (clang, -O0):
<ehex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ehexh@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <ehexh@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehex>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <ehexh@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <ehexh@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ehex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i32 @ehexh(i8 signext %4)
%6 = mul nsw i32 16, %5
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = call i32 @ehexh(i8 signext %9)
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ehex(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @ehexh(i8 signext %2)
%4 = shl nsw i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @ehexh(i8 signext %6)
%8 = add nsw i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int strlen(char *);
int end_of_sent(char *s) {
  int len = strlen(s);
  char lastchar = s[len - 1];
  if (lastchar == '.' || lastchar == '?' || lastchar == '!')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<end_of_sent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x2e,%eax
je     1162 <end_of_sent+0x52>
movsbl -0x15(%rbp),%eax
cmp    $0x3f,%eax
je     1162 <end_of_sent+0x52>
movsbl -0x15(%rbp),%eax
cmp    $0x21,%eax
jne    116e <end_of_sent+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <end_of_sent+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_of_sent>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movzbl -0x1(%rax,%rbx,1),%ecx
cmp    $0x3f,%rcx
ja     113d <end_of_sent+0x2d>
mov    $0x1,%eax
movabs $0x8000400200000000,%rdx
bt     %rcx,%rdx
jae    113d <end_of_sent+0x2d>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @end_of_sent(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 63, label %8
i8 46, label %8
i8 33, label %8
]
7: ; preds = %1
br label %8
8: ; preds = %1, %1, %1, %7
%9 = phi i32 [ 0, %7 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memory_tracker_add(size_t, unsigned int, char *,
                                      unsigned int, int);
void vpx_memory_tracker_add(size_t addr, unsigned int size, char *file,
                            unsigned int line, int padded) {
  memory_tracker_add(addr, size, file, line, padded);
}


x86 assembly (clang, -O0):
<vpx_memory_tracker_add>:
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    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1030 <memory_tracker_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpx_memory_tracker_add>:
jmp    1030 <memory_tracker_add@plt>

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

LLVM IR (-O2):
define void @vpx_memory_tracker_add(i64 %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @memory_tracker_add(i64 %0, i32 %1, i8* %2, i32 %3, i32 %4)
ret void
}
void tutorial_if_loop(char *p, char *q, int i) {
  char *s;
  int j;
  for (j = 0; j < 10; j++) {
    if (i >= 0) {
      s = p;
    } else {
      s = q;
    }
    *s = 0;
  }
}


x86 assembly (clang, -O0):
<tutorial_if_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    1154 <tutorial_if_loop+0x54>
cmpl   $0x0,-0x14(%rbp)
jl     1137 <tutorial_if_loop+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    113f <tutorial_if_loop+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1116 <tutorial_if_loop+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tutorial_if_loop>:
test   %edx,%edx
cmovs  %rsi,%rdi
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @tutorial_if_loop(i8* nocapture writeonly %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, -1
%5 = select i1 %4, i8* %0, i8* %1
store i8 0, i8* %5
ret void
}
/* Variables and functions */
scalar_t__ IFF_NO_PI;
unsigned long iff_no_pi() { return (unsigned long)IFF_NO_PI; }


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

x86 assembly (clang, -O2):
<iff_no_pi>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@IFF_NO_PI = global i64 0
define i64 @iff_no_pi() {
%1 = load i64, i64* @IFF_NO_PI
ret i64 %1
}

LLVM IR (-O2):
@IFF_NO_PI = global i64 0
define i64 @iff_no_pi() {
%1 = load i64, i64* @IFF_NO_PI
ret i64 %1
}