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


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

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

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

LLVM IR (-O2):
define void @test1_ModFix_targetInit__I() {
ret void
}
void kobject_put(struct kobject *x) { return; }


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
define void @kobject_put(%struct.kobject* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void boom(char *s) {
  char buf[64] = {0};
  strcpy(buf, s);
}


x86 assembly (clang, -O0):
<boom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boom>:
sub    $0x48,%rsp
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @boom(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = bitcast [64 x i8]* %3 to i8*
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @boom(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
unsigned char SwapDecimalNibble(const unsigned char x) {
  return (x / 16) + ((x % 16) * 10);
}


x86 assembly (clang, -O0):
<SwapDecimalNibble>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
imul   $0xa,%edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapDecimalNibble>:
mov    %edi,%ecx
shr    $0x4,%cl
and    $0xf,%dil
movzbl %dil,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @SwapDecimalNibble(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 16
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = srem i32 %7, 16
%9 = mul nsw i32 %8, 10
%10 = add nsw i32 %5, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @SwapDecimalNibble(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = and i8 %0, 15
%4 = mul nuw i8 %3, 10
%5 = add nuw i8 %4, %2
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x9f() {
  Assert_real((isprint(159) == 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_isprint.c",
              800, ("isprint should be 0 for 0x9f"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x9f>:
push   %rax
mov    $0x9f,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x320,%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 = [29 x i8] c"isprint should be 0 for 0x9f\00"
define void @t_isprint_0x9f() {
%1 = call i64 @isprint(i32 159)
%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 800, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x9f\00"
define void @t_isprint_0x9f() {
%1 = tail call i64 @isprint(i32 159)
%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 800, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ceph_fscache_revalidate_cookie(struct ceph_inode_info *ci) {}


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

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

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

LLVM IR (-O2):
%struct.ceph_inode_info = type opaque
define void @ceph_fscache_revalidate_cookie(%struct.ceph_inode_info* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *getQcb(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int mymsgget(int key, int msgflg) {
  int debug = 0;
  if (getQcb(key) != NULL) {
    if (0 && debug)
      printf("mymsgget() : %d\n", key);
    return key;
  }
  perror("Queue Table Entry is full");
  return 0;
}


x86 assembly (clang, -O0):
<mymsgget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getQcb@plt>
cmp    $0x0,%rax
je     1152 <mymsgget+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <mymsgget+0x45>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymsgget>:
push   %rbx
mov    %edi,%ebx
call   1030 <getQcb@plt>
test   %rax,%rax
je     1131 <mymsgget+0x11>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
xor    %ebx,%ebx
jmp    112d <mymsgget+0xd>

LLVM IR (-O0):
@.str = [26 x i8] c"Queue Table Entry is full\00"
define i32 @mymsgget(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = call i32* @getQcb(i32 %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %4
store i32 %11, i32* %3
br label %14
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [26 x i8] c"Queue Table Entry is full\00"
define i32 @mymsgget(i32 %0, i32 %1) {
%3 = tail call i32* @getQcb(i32 %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ %0, %2 ]
ret i32 %8
}
void lookupKeyWrite(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               88, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<lookupKeyWrite>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x58,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookupKeyWrite>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x58,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.lookupKeyWrite = [15 x i8] c"lookupKeyWrite\00"
define void @lookupKeyWrite() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 88, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.lookupKeyWrite, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.lookupKeyWrite = [15 x i8] c"lookupKeyWrite\00"
define void @lookupKeyWrite() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 88, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.lookupKeyWrite, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RanSetSeed(int *, int);
int /*<<< orphan*/ zig32NorInit(int, double, double);
void RanNormalSetSeedZig32(int *piSeed, int cSeed) {
  zig32NorInit(128, 3.442619855899, 9.91256303526217e-3);
  RanSetSeed(piSeed, cSeed);
}


x86 assembly (clang, -O0):
<RanNormalSetSeedZig32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x80,%edi
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
call   1030 <zig32NorInit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <RanSetSeed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RanNormalSetSeedZig32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movsd  0xed0(%rip),%xmm0
movsd  0xed0(%rip),%xmm1
mov    $0x80,%edi
call   1030 <zig32NorInit@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <RanSetSeed@plt>

LLVM IR (-O0):
define void @RanNormalSetSeedZig32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @zig32NorInit(i32 128, double 0x400B8A7C476D2BE8, double 0x3F844D09B072AAA1)
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @RanSetSeed(i32* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @RanNormalSetSeedZig32(i32* %0, i32 %1) {
%3 = tail call i32 @zig32NorInit(i32 128, double 0x400B8A7C476D2BE8, double 0x3F844D09B072AAA1)
%4 = tail call i32 @RanSetSeed(i32* %0, i32 %1)
ret void
}
__typeof__(snprintf(1, 1, "")) test_snprintf_255(void) {
  return snprintf(1, 1, "");
}


x86 assembly (clang, -O0):
<test_snprintf_255>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
lea    0xee0(%rip),%rdx
mov    %rsi,%rdi
mov    $0x0,%al
call   1030 <snprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_snprintf_255>:
movb   $0x0,0x1
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_snprintf_255() {
%1 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* inttoptr (i64 1 to i8*), i64 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_snprintf_255() {
store i8 0, i8* inttoptr (i64 1 to i8*)
ret i32 0
}
unsigned int CommTransp_GetType(const char *str) {
  unsigned int hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<CommTransp_GetType>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <CommTransp_GetType+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <CommTransp_GetType+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommTransp_GetType>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <CommTransp_GetType+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <CommTransp_GetType+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @CommTransp_GetType(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
void bar(int *pv) { *pv = 10; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movl   $0xa,(%rdi)
ret

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

LLVM IR (-O2):
define void @bar(i32* nocapture writeonly %0) {
store i32 10, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_main_int(int signo) { printf("main caught %d\n", signo); }


x86 assembly (clang, -O0):
<sig_main_int>:
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):
<sig_main_int>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"main caught %d\0A\00"
define void @sig_main_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun1();
int /*<<< orphan*/ fun2();
int /*<<< orphan*/ printf(char *);
main() {
  printf("flag 1");
  fun1();
  printf("flag 2");
  fun2();
  printf("flag 3");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <fun1@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <fun2@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <fun1@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <fun2@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"flag 1\00"
@.str.1 = [7 x i8] c"flag 2\00"
@.str.2 = [7 x i8] c"flag 3\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @fun1()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @fun2()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void print_error(char *error_info) {
  printf("%s call failed/n", error_info);
  exit(1);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s call failed/n\00"
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s call failed/n\00"
define void @print_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int compareFunction(const void *first, const void *second) {
  int tempVal = 0;
  if (*(int *)first > *(int *)second || *(int *)first == *(int *)second) {
    return *(int *)first;
  } else {
    tempVal = *(int *)first;
    *(int *)first = *(int *)second;
    *(int *)second = tempVal;
    return *(int *)first;
  }
}


x86 assembly (clang, -O0):
<compareFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jg     1137 <compareFunction+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1145 <compareFunction+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <compareFunction+0x6c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareFunction>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
jge    110e <compareFunction+0xe>
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @compareFunction(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = icmp sgt i32 %9, %12
br i1 %13, label %22, label %14
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %26
22: ; preds = %14, %2
%23 = load i8*, i8** %4
%24 = bitcast i8* %23 to i32*
%25 = load i32, i32* %24
store i32 %25, i32* %3
br label %41
26: ; preds = %14
%27 = load i8*, i8** %4
%28 = bitcast i8* %27 to i32*
%29 = load i32, i32* %28
store i32 %29, i32* %6
%30 = load i8*, i8** %5
%31 = bitcast i8* %30 to i32*
%32 = load i32, i32* %31
%33 = load i8*, i8** %4
%34 = bitcast i8* %33 to i32*
store i32 %32, i32* %34
%35 = load i32, i32* %6
%36 = load i8*, i8** %5
%37 = bitcast i8* %36 to i32*
store i32 %35, i32* %37
%38 = load i8*, i8** %4
%39 = bitcast i8* %38 to i32*
%40 = load i32, i32* %39
store i32 %40, i32* %3
br label %41
41: ; preds = %26, %22
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
define i32 @compareFunction(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %2
store i32 %6, i32* %3
store i32 %4, i32* %5
%9 = load i32, i32* %3
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %4, %2 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(short, short, short, short);
void glWindowPos4s(short x, short y, short z, short w) {
  glWindowPos4f(x, y, z, w);
}


x86 assembly (clang, -O0):
<glWindowPos4s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movswl %dx,%edi
movswl %cx,%esi
movswl %ax,%edx
movswl -0x8(%rbp),%ecx
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos4s>:
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos4s(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = load i16, i16* %7
%12 = load i16, i16* %8
%13 = call i32 @glWindowPos4f(i16 signext %9, i16 signext %10, i16 signext %11, i16 signext %12)
ret void
}

LLVM IR (-O2):
define void @glWindowPos4s(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = tail call i32 @glWindowPos4f(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3)
ret void
}
int ftest2(struct Data1 *ptr0) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.Data1 = type opaque
define i32 @ftest2(%struct.Data1* nocapture readnone %0) {
ret i32 1
}
void log_pthread_stack_size() {}


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

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

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

LLVM IR (-O2):
define void @log_pthread_stack_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int is_numeric(const char *p) {
  if (*p) {
    char c;
    while ((c = *p++)) {
      if (!isdigit(c))
        return 0;
    }
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1179 <is_numeric+0x69>
jmp    112e <is_numeric+0x1e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     116d <is_numeric+0x5d>
movsbl -0x11(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1168 <is_numeric+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1180 <is_numeric+0x70>
jmp    112e <is_numeric+0x1e>
movl   $0x1,-0x4(%rbp)
jmp    1180 <is_numeric+0x70>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     114c <is_numeric+0x3c>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     114c <is_numeric+0x3c>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_numeric+0x20>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_numeric(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %10
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8* [ %10, %4 ], [ %0, %1 ]
%9 = phi i8 [ %5, %4 ], [ %2, %1 ]
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = tail call i32 @isdigit(i8 signext %9)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %7, %1
%14 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ msg(char *, char *, int /*<<< orphan*/);
void arith_overflow_func() { msg("Arithmetic overflow !", "", 0); }


x86 assembly (clang, -O0):
<arith_overflow_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
call   1030 <msg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith_overflow_func>:
lea    0xee9(%rip),%rdi
lea    0xef7(%rip),%rsi
xor    %edx,%edx
jmp    1030 <msg@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Arithmetic overflow !\00"
@.str.1 = [1 x i8] zeroinitializer
define void @arith_overflow_func() {
%1 = call i32 @msg(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Arithmetic overflow !\00"
@.str.1 = [1 x i8] zeroinitializer
define void @arith_overflow_func() {
%1 = tail call i32 @msg(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xf4() {
  Assert_real((isascii(244) == 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_isascii.c",
              1225, ("isascii should be 0 for 0xf4"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xf4>:
push   %rax
mov    $0xf4,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4c9,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xf4\00"
define void @t_isascii_0xf4() {
%1 = call i64 @isascii(i32 244)
%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 1225, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xf4\00"
define void @t_isascii_0xf4() {
%1 = tail call i64 @isascii(i32 244)
%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 1225, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int cap_custom_remove(unsigned char *);
int plugin_right_destroy(unsigned char *name) {
  return cap_custom_remove(name);
}


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

x86 assembly (clang, -O2):
<plugin_right_destroy>:
jmp    1030 <cap_custom_remove@plt>

LLVM IR (-O0):
define i32 @plugin_right_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cap_custom_remove(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @plugin_right_destroy(i8* %0) {
%2 = tail call i32 @cap_custom_remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Other(void) { WriteInstruction("ld ix,(skptr)"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"ld ix,(skptr)\00"
define void @CR_Other() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"ld ix,(skptr)\00"
define void @CR_Other() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
double mpeg3_divide_double_gcc(double x, double y) { return x / y; }


x86 assembly (clang, -O0):
<mpeg3_divide_double_gcc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpeg3_divide_double_gcc>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mpeg3_divide_double_gcc(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @mpeg3_divide_double_gcc(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Type definitions */
struct BasePRNGObject {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stdlib_base_prng_free(struct BasePRNGObject *);
void stdlib_base_random_randu_free(struct BasePRNGObject *obj) {
  stdlib_base_prng_free(obj);
}


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

x86 assembly (clang, -O2):
<stdlib_base_random_randu_free>:
jmp    1030 <stdlib_base_prng_free@plt>

LLVM IR (-O0):
%struct.BasePRNGObject = type { i32 }
define void @stdlib_base_random_randu_free(%struct.BasePRNGObject* %0) {
%2 = alloca %struct.BasePRNGObject*
store %struct.BasePRNGObject* %0, %struct.BasePRNGObject** %2
%3 = load %struct.BasePRNGObject*, %struct.BasePRNGObject** %2
%4 = call i32 @stdlib_base_prng_free(%struct.BasePRNGObject* %3)
ret void
}

LLVM IR (-O2):
%struct.BasePRNGObject = type { i32 }
define void @stdlib_base_random_randu_free(%struct.BasePRNGObject* %0) {
%2 = tail call i32 @stdlib_base_prng_free(%struct.BasePRNGObject* %0)
ret void
}
/* Variables and functions */
int strtol(char const *, int /*<<< orphan*/ *, int);
__attribute__((regparm(0))) int(_win_atoi)(const char *ptr) {
  int i = strtol(ptr, NULL, 10);
  return i;
}


x86 assembly (clang, -O0):
<_win_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_win_atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @_win_atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strtol(i8* %4, i32* null, i32 10)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @_win_atoi(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
ret i32 %2
}
void r_uart0_callback_sendend(void) {}


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

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

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

LLVM IR (-O2):
define void @r_uart0_callback_sendend() {
ret void
}
int test_imm_98uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x98 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_98uint64_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, 152
%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_98uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 152
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
span(str, k) {
  switch (ylet(str, k)) {
  case 's':
  case 'S':
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<span>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %eax,%eax
call   1030 <ylet@plt>
or     $0x20,%eax
sub    $0x73,%eax
je     113c <span+0x2c>
jmp    1148 <span+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <span+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<span>:
push   %rax
xor    %eax,%eax
call   1030 <ylet@plt>
and    $0xffffffdf,%eax
xor    %ecx,%ecx
cmp    $0x53,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @span(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @ylet to i32 (i32, i32, ...)*)(i32 %6, i32 %7)
switch i32 %8, label %10 [
i32 115, label %9
i32 83, label %9
]
9: ; preds = %2, %2
store i32 1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @span(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ylet to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%4 = and i32 %3, -33
%5 = icmp eq i32 %4, 83
%6 = zext i1 %5 to i32
ret i32 %6
}
int rcu_preempt_depth(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rcu_preempt_depth() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M225_f(char *s) {
  debug("M225_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M225_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M225_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M225_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M225_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M225_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M225_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int i2cslave_Listen(int /*<<< orphan*/);
unsigned i2c0slave_Listen(void) { return i2cslave_Listen(0); }


x86 assembly (clang, -O0):
<i2c0slave_Listen>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <i2cslave_Listen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c0slave_Listen>:
xor    %edi,%edi
jmp    1030 <i2cslave_Listen@plt>

LLVM IR (-O0):
define i32 @i2c0slave_Listen() {
%1 = call i32 @i2cslave_Listen(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i2c0slave_Listen() {
%1 = tail call i32 @i2cslave_Listen(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ test_random_protocol();
int main() { test_random_protocol(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_random_protocol()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_random_protocol()
ret i32 0
}
/* Type definitions */
struct ms20_filter {
  int dummy;
};

/* Variables and functions */
double ms20_filter_tick(struct ms20_filter *, double, double, double, double,
                        double, double);
double ms20_filter_tick_hp(struct ms20_filter *s, double dt, double freq,
                           double reso, double clip_level, double input) {
  return ms20_filter_tick(s, dt, freq, reso, clip_level, 0.0, input);
}


x86 assembly (clang, -O0):
<ms20_filter_tick_hp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm5
xorps  %xmm4,%xmm4
call   1030 <ms20_filter_tick@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms20_filter_tick_hp>:
movaps %xmm4,%xmm5
xorps  %xmm4,%xmm4
jmp    1030 <ms20_filter_tick@plt>

LLVM IR (-O0):
%struct.ms20_filter = type { i32 }
define double @ms20_filter_tick_hp(%struct.ms20_filter* %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca %struct.ms20_filter*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store %struct.ms20_filter* %0, %struct.ms20_filter** %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load %struct.ms20_filter*, %struct.ms20_filter** %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load double, double* %12
%19 = call double @ms20_filter_tick(%struct.ms20_filter* %13, double %14, double %15, double %16, double %17, double 0.000000e+00, double %18)
ret double %19
}

LLVM IR (-O2):
%struct.ms20_filter = type { i32 }
define double @ms20_filter_tick_hp(%struct.ms20_filter* %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @ms20_filter_tick(%struct.ms20_filter* %0, double %1, double %2, double %3, double %4, double 0.000000e+00, double %5)
ret double %7
}
/* Variables and functions */
int lw_sock_send_buffer_ex(int *, char *, int);
int lw_sock_send_buffer(int *sock, char *buffer, int len) {
  int result = 0;
  result = lw_sock_send_buffer_ex(sock, buffer, len);
  return result;
}


x86 assembly (clang, -O0):
<lw_sock_send_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <lw_sock_send_buffer_ex@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_sock_send_buffer>:
jmp    1030 <lw_sock_send_buffer_ex@plt>

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

LLVM IR (-O2):
define i32 @lw_sock_send_buffer(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @lw_sock_send_buffer_ex(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
unsigned short reverseBits_fun_ushort(unsigned short x) {
  unsigned short r = x;
  int i = 15;
  while (x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0x2(%rbp)
cmp    $0x0,%ax
je     1151 <reverseBits_fun_ushort+0x51>
movzwl -0x4(%rbp),%eax
shl    $0x1,%eax
movzwl -0x2(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111a <reverseBits_fun_ushort+0x1a>
movzwl -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_ushort>:
mov    $0xf,%ecx
cmp    $0x2,%di
jae    110f <reverseBits_fun_ushort+0xf>
mov    %edi,%eax
jmp    1138 <reverseBits_fun_ushort+0x38>
mov    $0xf,%ecx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
movzwl %di,%edx
mov    %edx,%edi
shr    %edi
mov    %edi,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%eax
add    $0xffffffff,%ecx
cmp    $0x3,%dx
ja     1120 <reverseBits_fun_ushort+0x20>
movzwl %ax,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define zeroext i16 @reverseBits_fun_ushort(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %2
%5 = load i16, i16* %2
store i16 %5, i16* %3
store i32 15, i32* %4
br label %6
6: ; preds = %12, %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 1
%10 = trunc i32 %9 to i16
store i16 %10, i16* %2
%11 = icmp ne i16 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %6
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = shl i32 %14, 1
%16 = load i16, i16* %2
%17 = zext i16 %16 to i32
%18 = and i32 %17, 1
%19 = or i32 %15, %18
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i32, i32* %4
%22 = add nsw i32 %21, -1
store i32 %22, i32* %4
br label %6
23: ; preds = %6
%24 = load i16, i16* %3
%25 = zext i16 %24 to i32
%26 = load i32, i32* %4
%27 = shl i32 %25, %26
%28 = trunc i32 %27 to i16
ret i16 %28
}

LLVM IR (-O2):
define zeroext i16 @reverseBits_fun_ushort(i16 zeroext %0) {
%2 = icmp ult i16 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i16 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 15, %1 ]
%6 = phi i16 [ %10, %3 ], [ %0, %1 ]
%7 = lshr i16 %4, 1
%8 = shl i16 %6, 1
%9 = and i16 %7, 1
%10 = or i16 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i16 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i16 [ %0, %1 ], [ %10, %3 ]
%15 = phi i32 [ 15, %1 ], [ %11, %3 ]
%16 = zext i16 %14 to i32
%17 = shl i32 %16, %15
%18 = trunc i32 %17 to i16
ret i16 %18
}
/* Variables and functions */
int __builtin_arm_rsr(char *);
unsigned rsr() { return __builtin_arm_rsr("1:2:3:4:5"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"1:2:3:4:5\00"
define i32 @rsr() {
%1 = tail call i32 @__builtin_arm_rsr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct audio_conversion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void audio_conv_destroy(struct audio_conversion *conv) { assert(conv != NULL); }


x86 assembly (clang, -O0):
<audio_conv_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_conv_destroy>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.audio_conversion = type { i32 }
define void @audio_conv_destroy(%struct.audio_conversion* %0) {
%2 = alloca %struct.audio_conversion*
store %struct.audio_conversion* %0, %struct.audio_conversion** %2
%3 = load %struct.audio_conversion*, %struct.audio_conversion** %2
%4 = icmp ne %struct.audio_conversion* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.audio_conversion = type { i32 }
define void @audio_conv_destroy(%struct.audio_conversion* readnone %0) {
%2 = icmp ne %struct.audio_conversion* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}