xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xc3() {
  Assert_real((isdigit(195) == 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_isdigit.c",
              980, ("isdigit should be 0 for 0xc3"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xc3>:
push   %rax
mov    $0xc3,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d4,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xc3\00"
define void @t_isdigit_0xc3() {
%1 = call i64 @isdigit(i32 195)
%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 980, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xc3\00"
define void @t_isdigit_0xc3() {
%1 = tail call i64 @isdigit(i32 195)
%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 980, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
int _p11_hash_ulongptr_equal(const void *ulong_one, const void *ulong_two) {
  assert(ulong_one);
  assert(ulong_two);
  return *((unsigned long *)ulong_one) == *((unsigned long *)ulong_two);
}


x86 assembly (clang, -O0):
<_p11_hash_ulongptr_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_p11_hash_ulongptr_equal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    (%rbx),%rcx
xor    %eax,%eax
cmp    (%r14),%rcx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_p11_hash_ulongptr_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i64*
%14 = load i64, i64* %13
%15 = icmp eq i64 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @_p11_hash_ulongptr_equal(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = bitcast i8* %0 to i64*
%6 = load i64, i64* %5
%7 = bitcast i8* %1 to i64*
%8 = load i64, i64* %7
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closesocket(int x) { close(x); }


x86 assembly (clang, -O0):
<closesocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closesocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closesocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void dsk_report_end() {}


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

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

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

LLVM IR (-O2):
define void @dsk_report_end() {
ret void
}
void csoundLock() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, int, int);
void dumpreg(__m128i x, char *msg) {
  union {
    uint32_t ret[4];
    __m128i x;
  } box = {.x = x};
  printf("%s %08x %08x %08x %08x\n", msg, box.ret[0], box.ret[1], box.ret[2],
         box.ret[3]);
}


x86 assembly (clang, -O0):
<dumpreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [4 x i32] }
@.str = [24 x i8] c"%s %08x %08x %08x %08x\0A\00"
define void @dumpreg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.anon
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast %union.anon* %5 to i32*
%7 = load i32, i32* %3
store i32 %7, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast %union.anon* %5 to [4 x i32]*
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%11 = load i32, i32* %10
%12 = bitcast %union.anon* %5 to [4 x i32]*
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 1
%14 = load i32, i32* %13
%15 = bitcast %union.anon* %5 to [4 x i32]*
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 2
%17 = load i32, i32* %16
%18 = bitcast %union.anon* %5 to [4 x i32]*
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %18, i64 0, i64 3
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %11, i32 %14, i32 %17, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s %08x %08x %08x %08x\0A\00"
define void @dumpreg(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0, i32 undef, i32 undef, i32 undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ DWIN_JPG_CacheToN(int, int /*<<< orphan*/);
void DWIN_JPG_CacheTo1(uint8_t id) { DWIN_JPG_CacheToN(1, id); }


x86 assembly (clang, -O0):
<DWIN_JPG_CacheTo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <DWIN_JPG_CacheToN@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DWIN_JPG_CacheTo1>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <DWIN_JPG_CacheToN@plt>

LLVM IR (-O0):
define void @DWIN_JPG_CacheTo1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @DWIN_JPG_CacheToN(i32 1, i32 %3)
ret void
}

LLVM IR (-O2):
define void @DWIN_JPG_CacheTo1(i32 %0) {
%2 = tail call i32 @DWIN_JPG_CacheToN(i32 1, i32 %0)
ret void
}
/* Type definitions */
struct cpumask {
  int dummy;
};

/* Variables and functions */
int bitmap_parselist_crop(char const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ cpumask_bits(struct cpumask *);
int __cpulist_parse_crop(const char *buf, struct cpumask *dstp, int nbits) {
  return bitmap_parselist_crop(buf, cpumask_bits(dstp), nbits);
}


x86 assembly (clang, -O0):
<__cpulist_parse_crop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cpumask_bits@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x14(%rbp),%edx
call   1040 <bitmap_parselist_crop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cpulist_parse_crop>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <cpumask_bits@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <bitmap_parselist_crop@plt>

LLVM IR (-O0):
%struct.cpumask = type { i32 }
define i32 @__cpulist_parse_crop(i8* %0, %struct.cpumask* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.cpumask*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.cpumask* %1, %struct.cpumask** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load %struct.cpumask*, %struct.cpumask** %5
%9 = call i32 @cpumask_bits(%struct.cpumask* %8)
%10 = load i32, i32* %6
%11 = call i32 @bitmap_parselist_crop(i8* %7, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.cpumask = type { i32 }
define i32 @__cpulist_parse_crop(i8* %0, %struct.cpumask* %1, i32 %2) {
%4 = tail call i32 @cpumask_bits(%struct.cpumask* %1)
%5 = tail call i32 @bitmap_parselist_crop(i8* %0, i32 %4, i32 %2)
ret i32 %5
}
int isdigit(c)
char c;
{ return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
shl    $0x18,%edi
add    $0xd0ffffff,%edi
xor    %eax,%eax
cmp    $0xaffffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -788529153
%4 = icmp ult i32 %3, 184549375
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ BUG();
void __flush_tlb(void) { BUG(); }


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

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

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

LLVM IR (-O2):
define void @__flush_tlb() {
%1 = tail call i32 (...) @BUG()
ret void
}
void event_manage_unregister_handle(struct event_manage *event_manage, int fd,
                                    int events, void *handle) {}


x86 assembly (clang, -O0):
<event_manage_unregister_handle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.event_manage = type opaque
define void @event_manage_unregister_handle(%struct.event_manage* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.event_manage*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.event_manage* %0, %struct.event_manage** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
%struct.event_manage = type opaque
define void @event_manage_unregister_handle(%struct.event_manage* nocapture %0, i32 %1, i32 %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ request_geo_config();
int /*<<< orphan*/ ssd_progress_msg_dialog_hide();
void retry(void) {
  if (!request_geo_config())
    ssd_progress_msg_dialog_hide();
}


x86 assembly (clang, -O0):
<retry>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <request_geo_config@plt>
cmp    $0x0,%eax
jne    113b <retry+0x1b>
mov    $0x0,%al
call   1030 <ssd_progress_msg_dialog_hide@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<retry>:
push   %rax
xor    %eax,%eax
call   1040 <request_geo_config@plt>
test   %eax,%eax
je     112e <retry+0xe>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <ssd_progress_msg_dialog_hide@plt>

LLVM IR (-O0):
define void @retry() {
%1 = call i32 (...) @request_geo_config()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @ssd_progress_msg_dialog_hide()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @retry() {
%1 = tail call i32 (...) @request_geo_config()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @ssd_progress_msg_dialog_hide()
br label %5
5: ; preds = %3, %0
ret void
}
int sys$extend(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(9), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$extend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x9,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$extend>:
mov    $0x9,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$extend"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 9, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$extend"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 9, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
int test_imm_C8int64_lowword_mem(long long *val) {
  return ((*val) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8int64_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, 200
%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_C8int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 200
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void UART7_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<UART7_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UART7_Handler+0x9>
jmp    1109 <UART7_Handler+0x9>

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

LLVM IR (-O0):
define void @UART7_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UART7_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void wfaSleepMilsec(int milSec) {
  if (milSec > 0)
    usleep(milSec * 1000);
}


x86 assembly (clang, -O0):
<wfaSleepMilsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1131 <wfaSleepMilsec+0x21>
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfaSleepMilsec>:
test   %edi,%edi
jle    111f <wfaSleepMilsec+0xf>
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>
ret

LLVM IR (-O0):
define void @wfaSleepMilsec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 1000
%8 = call i32 @usleep(i32 %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @wfaSleepMilsec(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = mul nsw i32 %0, 1000
%5 = tail call i32 @usleep(i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
int enclave_exit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @enclave_exit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int __attribute__((visibility("default"))) printLibraryString(const char *str) {
  printf("C library says: %s", str);
  return 3;
}


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

x86 assembly (clang, -O2):
<printLibraryString>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"C library says: %s\00"
define i32 @printLibraryString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 3
}

LLVM IR (-O2):
@.str = [19 x i8] c"C library says: %s\00"
define i32 @printLibraryString(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigint(int _) {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigint>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigint(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void __aeabi_memmove8(void *dest, const void *src, size_t n) {
  memmove(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memmove8>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @__aeabi_memmove8(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
scalar_t__ sound_frames(char *);
scalar_t__ sound_srate(char *);
float sound_duration(char *arg) {
  return ((float)sound_frames(arg) / (float)sound_srate(arg));
}


x86 assembly (clang, -O0):
<sound_duration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sound_frames@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sound_srate@plt>
movss  -0xc(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sound_duration>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <sound_frames@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1040 <sound_srate@plt>
cvtsi2ss %rax,%xmm1
movss  0xc(%rsp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @sound_duration(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @sound_frames(i8* %3)
%5 = sitofp i64 %4 to float
%6 = load i8*, i8** %2
%7 = call i64 @sound_srate(i8* %6)
%8 = sitofp i64 %7 to float
%9 = fdiv float %5, %8
ret float %9
}

LLVM IR (-O2):
define float @sound_duration(i8* %0) {
%2 = tail call i64 @sound_frames(i8* %0)
%3 = sitofp i64 %2 to float
%4 = tail call i64 @sound_srate(i8* %0)
%5 = sitofp i64 %4 to float
%6 = fdiv float %3, %5
ret float %6
}
int test_imm_CCuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xCC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CCuint64_lowword_reg>:
test   $0xcc,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CCuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 204
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x3f() {
  Assert_real((ispunct(63)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              320, ("ispunct should be 1 for ?"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x3f>:
push   %rax
mov    $0x3f,%edi
call   1030 <ispunct@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x140,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ?\00"
define void @t_ispunct_0x3f() {
%1 = call i32 @ispunct(i32 63)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 320, 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ?\00"
define void @t_ispunct_0x3f() {
%1 = tail call i32 @ispunct(i32 63)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage(void) {
  fprintf(stderr, "usage: mkbootimg\n"
                  "       --kernel <filename>\n"
                  "       --ramdisk <filename>\n"
                  "       [ --second <2ndbootloader-filename> ]\n"
                  "       [ --cmdline <kernel-commandline> ]\n"
                  "       [ --board <boardname> ]\n"
                  "       [ --base <address> ]\n"
                  "       [ --pagesize <pagesize> ]\n"
                  "       [ --ramdiskaddr <address> ]\n"
                  "       -o|--output <filename>\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [317 x i8] c"usage: mkbootimg\0A --kernel <filename>\0A --ramdisk <filename>\0A [ --second <2ndbootloader-filename> ]\0A [ --cmdline <kernel-commandline> ]\0A [ --board <boardname> ]\0A [ --base <address> ]\0A [ --pagesize <pagesize> ]\0A [ --ramdiskaddr <address> ]\0A -o|--output <filename>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([317 x i8], [317 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [317 x i8] c"usage: mkbootimg\0A --kernel <filename>\0A --ramdisk <filename>\0A [ --second <2ndbootloader-filename> ]\0A [ --cmdline <kernel-commandline> ]\0A [ --board <boardname> ]\0A [ --base <address> ]\0A [ --pagesize <pagesize> ]\0A [ --ramdiskaddr <address> ]\0A -o|--output <filename>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([317 x i8], [317 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
unsigned int sub(unsigned int a, unsigned int b) {
  if (a > b)
    return a - b;
  return 0;
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1124 <sub+0x24>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112b <sub+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
xor    %eax,%eax
sub    %esi,%edi
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @sub(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 = icmp ugt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub i32 %10, %11
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.usub.sat.i32(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct xrdp_mm {
  int dummy;
};
struct trans {
  int dummy;
};

/* Variables and functions */
int xrdp_mm_trans_send_channel_setup(struct xrdp_mm *, struct trans *);
int xrdp_mm_trans_process_init_response(struct xrdp_mm *self,
                                        struct trans *trans) {
  return xrdp_mm_trans_send_channel_setup(self, trans);
}


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

x86 assembly (clang, -O2):
<xrdp_mm_trans_process_init_response>:
jmp    1030 <xrdp_mm_trans_send_channel_setup@plt>

LLVM IR (-O0):
%struct.xrdp_mm = type { i32 }
%struct.trans = type { i32 }
define i32 @xrdp_mm_trans_process_init_response(%struct.xrdp_mm* %0, %struct.trans* %1) {
%3 = alloca %struct.xrdp_mm*
%4 = alloca %struct.trans*
store %struct.xrdp_mm* %0, %struct.xrdp_mm** %3
store %struct.trans* %1, %struct.trans** %4
%5 = load %struct.xrdp_mm*, %struct.xrdp_mm** %3
%6 = load %struct.trans*, %struct.trans** %4
%7 = call i32 @xrdp_mm_trans_send_channel_setup(%struct.xrdp_mm* %5, %struct.trans* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.xrdp_mm = type { i32 }
%struct.trans = type { i32 }
define i32 @xrdp_mm_trans_process_init_response(%struct.xrdp_mm* %0, %struct.trans* %1) {
%3 = tail call i32 @xrdp_mm_trans_send_channel_setup(%struct.xrdp_mm* %0, %struct.trans* %1)
ret i32 %3
}
void f111(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    a:
      goto a;
      ({ 0; });
      ({ 0; });
      0;
  });
  0;
}


x86 assembly (clang, -O0):
<f111>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1119 <f111+0x19>

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

LLVM IR (-O0):
define void @f111() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %1
store i32 0, i32* %2
%6 = load i32, i32* %2
store i32 0, i32* %3
%7 = load i32, i32* %3
br label %8
8: ; preds = %8, %0
br label %8
}

LLVM IR (-O2):
define void @f111() {
br label %1
1: ; preds = %1, %0
br label %1
}
int positiverem(int a, int b) {
  int c;
  c = a % b;
  return (c < 0 ? c + b : c);
}


x86 assembly (clang, -O0):
<positiverem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    112c <positiverem+0x2c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <positiverem+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<positiverem>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @positiverem(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
unsigned long BIT_MASK(int);
int BIT_WORD(int);
int /*<<< orphan*/ local_irq_restore(unsigned long);
int /*<<< orphan*/ local_irq_save(unsigned long);
void change_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = BIT_MASK(nr);
  unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
  unsigned long flags;
  do {
    local_irq_save(flags);
  } while (0);
  *p ^= mask;
  do {
    local_irq_restore(flags);
  } while (0);
}


x86 assembly (clang, -O0):
<change_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <BIT_MASK@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <BIT_WORD@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <local_irq_save@plt>
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rdi
call   1050 <local_irq_restore@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <BIT_MASK@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1060 <BIT_WORD@plt>
movslq %eax,%rbp
call   1040 <local_irq_save@plt>
xor    %rbx,(%r14,%rbp,8)
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <local_irq_restore@plt>

LLVM IR (-O0):
define void @change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = call i64 @BIT_MASK(i32 %8)
store i64 %9, i64* %5
%10 = load i64*, i64** %4
%11 = load i32, i32* %3
%12 = call i32 @BIT_WORD(i32 %11)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %10, i64 %13
store i64* %14, i64** %6
br label %15
15: ; preds = %2
%16 = load i64, i64* %7
%17 = call i32 @local_irq_save(i64 %16)
br label %18
18: ; preds = %15
%19 = load i64, i64* %5
%20 = load i64*, i64** %6
%21 = load i64, i64* %20
%22 = xor i64 %21, %19
store i64 %22, i64* %20
br label %23
23: ; preds = %18
%24 = load i64, i64* %7
%25 = call i32 @local_irq_restore(i64 %24)
br label %26
26: ; preds = %23
ret void
}

LLVM IR (-O2):
define void @change_bit(i32 %0, i64* nocapture %1) {
%3 = tail call i64 @BIT_MASK(i32 %0)
%4 = tail call i32 @BIT_WORD(i32 %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %1, i64 %5
%7 = tail call i32 @local_irq_save(i64 undef)
%8 = load i64, i64* %6
%9 = xor i64 %8, %3
store i64 %9, i64* %6
%10 = tail call i32 @local_irq_restore(i64 undef)
ret void
}
void g_try_malloc() {}


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

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

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

LLVM IR (-O2):
define void @g_try_malloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dumsg(char const *, char const *);
int /*<<< orphan*/ exit(int);
void duerr(const char *x, const char *p) {
  dumsg(x, p);
  exit(1);
}


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

x86 assembly (clang, -O2):
<duerr>:
push   %rax
call   1030 <dumsg@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @duerr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @dumsg(i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @duerr(i8* %0, i8* %1) {
%3 = tail call i32 @dumsg(i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double kurtosis_double(int, double *);
double kurtosis(int n, double *data) { return kurtosis_double(n, data); }


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

x86 assembly (clang, -O2):
<kurtosis>:
jmp    1030 <kurtosis_double@plt>

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

LLVM IR (-O2):
define double @kurtosis(i32 %0, double* %1) {
%3 = tail call double @kurtosis_double(i32 %0, double* %1)
ret double %3
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double TimeInSec(clock_t head, clock_t rear) {
  double tscal;
  tscal = 0.01;
  return ((double)(rear - head) * tscal);
}


x86 assembly (clang, -O0):
<TimeInSec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimeInSec>:
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
mulsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @TimeInSec(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
store double 1.000000e-02, double* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = sitofp i64 %8 to double
%10 = load double, double* %5
%11 = fmul double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @TimeInSec(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = fmul double %4, 1.000000e-02
ret double %5
}
/* Variables and functions */
int INT_MAX;
void _exit(int status) {
  int x = status / INT_MAX;
  if (x > 0)
    _exit(status);
  _exit(42 / status);
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    113d <_exit+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>
mov    $0x2a,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
mov    0x2ed0(%rip),%rcx
mov    %edi,%eax
cltd
idivl  (%rcx)
test   %eax,%eax
jle    1126 <_exit+0x16>
call   1030 <_exit@plt>
mov    $0x2a,%eax
xor    %edx,%edx
idiv   %edi
mov    %eax,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @INT_MAX
%6 = sdiv i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %2
unreachable
11: ; preds = %1
%12 = load i32, i32* %2
%13 = sdiv i32 42, %12
unreachable
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @_exit(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = sdiv i32 %0, %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
tail call void @_exit(i32 %0)
unreachable
6: ; preds = %1
%7 = sdiv i32 42, %0
tail call void @_exit(i32 %7)
unreachable
}
/* Variables and functions */
char *strtok(char *, char *);
char *get_host_from_request(char *request) {
  char *host;
  host = strtok(request, "//");
  host = strtok(NULL, "/");
  return host;
}


x86 assembly (clang, -O0):
<get_host_from_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xec6(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_host_from_request>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strtok@plt>
lea    0xedd(%rip),%rsi
xor    %edi,%edi
pop    %rax
jmp    1030 <strtok@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"//\00"
@.str.1 = [2 x i8] c"/\00"
define i8* @get_host_from_request(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
size_t strlen(const char *s) { return 0; }


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

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

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 0
}

LLVM IR (-O2):
define i64 @strlen(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ Test__XmOSQualifyFileSpec();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  Test__XmOSQualifyFileSpec();
  exit(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)
mov    $0x0,%al
call   1030 <Test__XmOSQualifyFileSpec@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Test__XmOSQualifyFileSpec@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
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 (...) @Test__XmOSQualifyFileSpec()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Test__XmOSQualifyFileSpec()
%4 = tail call i32 @exit(i32 0)
unreachable
}
void eofin(message) char *message;
{ error2error("end of file in ", message); }


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

x86 assembly (clang, -O2):
<eofin>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <error2error@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"end of file in \00"
define void @eofin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"end of file in \00"
define void @eofin(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int main() {
  void input(int *);
  void max_min_value(int *);
  void output(int *);
  int number[10];
  input(number);
  max_min_value(number);
  output(number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <input@plt>
lea    -0x30(%rbp),%rdi
call   1040 <max_min_value@plt>
lea    -0x30(%rbp),%rdi
call   1050 <output@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <input@plt>
mov    %rbx,%rdi
call   1040 <max_min_value@plt>
mov    %rbx,%rdi
call   1050 <output@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
ret i32 0
}
/* Variables and functions */
int random();
int zslRandomLevel(void) {
  int level = 1;
  while ((random() & 0xFFFF) < (0.25 * 0xFFFF))
    level += 1;
  return (level < 32) ? level : 32;
}


x86 assembly (clang, -O0):
<zslRandomLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114f <zslRandomLevel+0x3f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <zslRandomLevel+0xf>
cmpl   $0x20,-0x4(%rbp)
jge    1164 <zslRandomLevel+0x54>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <zslRandomLevel+0x61>
mov    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <zslRandomLevel+0x61>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zslRandomLevel>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <random@plt>
add    $0x1,%ebx
test   $0xc000,%eax
je     1120 <zslRandomLevel+0x10>
cmp    $0x20,%ebx
mov    $0x20,%eax
cmovb  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @zslRandomLevel() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %7, %0
%3 = call i32 (...) @random()
%4 = and i32 %3, 65535
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, 0x40CFFFE000000000
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %1
br label %16
15: ; preds = %10
br label %16
16: ; preds = %15, %13
%17 = phi i32 [ %14, %13 ], [ 32, %15 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @zslRandomLevel() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @random()
%4 = and i32 %3, 49152
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = icmp ult i32 %2, 32
%9 = select i1 %8, i32 %2, i32 32
ret i32 %9
}