xunge/DecIR huggingface dataset:
/* Type definitions */
struct cstate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addrange(struct cstate *, int, int);
void addranges_s(struct cstate *g) {
  addrange(g, 0x9, 0xD);
  addrange(g, 0x20, 0x20);
  addrange(g, 0xA0, 0xA0);
  addrange(g, 0x2028, 0x2029);
  addrange(g, 0xFEFF, 0xFEFF);
}


x86 assembly (clang, -O0):
<addranges_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
mov    $0xd,%edx
call   1030 <addrange@plt>
mov    -0x8(%rbp),%rdi
mov    $0x20,%edx
mov    %edx,%esi
call   1030 <addrange@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa0,%edx
mov    %edx,%esi
call   1030 <addrange@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2028,%esi
mov    $0x2029,%edx
call   1030 <addrange@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfeff,%edx
mov    %edx,%esi
call   1030 <addrange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addranges_s>:
push   %rbx
mov    %rdi,%rbx
mov    $0x9,%esi
mov    $0xd,%edx
call   1030 <addrange@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
mov    $0x20,%edx
call   1030 <addrange@plt>
mov    %rbx,%rdi
mov    $0xa0,%esi
mov    $0xa0,%edx
call   1030 <addrange@plt>
mov    %rbx,%rdi
mov    $0x2028,%esi
mov    $0x2029,%edx
call   1030 <addrange@plt>
mov    %rbx,%rdi
mov    $0xfeff,%esi
mov    $0xfeff,%edx
pop    %rbx
jmp    1030 <addrange@plt>

LLVM IR (-O0):
%struct.cstate = type { i32 }
define void @addranges_s(%struct.cstate* %0) {
%2 = alloca %struct.cstate*
store %struct.cstate* %0, %struct.cstate** %2
%3 = load %struct.cstate*, %struct.cstate** %2
%4 = call i32 @addrange(%struct.cstate* %3, i32 9, i32 13)
%5 = load %struct.cstate*, %struct.cstate** %2
%6 = call i32 @addrange(%struct.cstate* %5, i32 32, i32 32)
%7 = load %struct.cstate*, %struct.cstate** %2
%8 = call i32 @addrange(%struct.cstate* %7, i32 160, i32 160)
%9 = load %struct.cstate*, %struct.cstate** %2
%10 = call i32 @addrange(%struct.cstate* %9, i32 8232, i32 8233)
%11 = load %struct.cstate*, %struct.cstate** %2
%12 = call i32 @addrange(%struct.cstate* %11, i32 65279, i32 65279)
ret void
}

LLVM IR (-O2):
%struct.cstate = type { i32 }
define void @addranges_s(%struct.cstate* %0) {
%2 = tail call i32 @addrange(%struct.cstate* %0, i32 9, i32 13)
%3 = tail call i32 @addrange(%struct.cstate* %0, i32 32, i32 32)
%4 = tail call i32 @addrange(%struct.cstate* %0, i32 160, i32 160)
%5 = tail call i32 @addrange(%struct.cstate* %0, i32 8232, i32 8233)
%6 = tail call i32 @addrange(%struct.cstate* %0, i32 65279, i32 65279)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x92() {
  Assert_real((isgraph(146) == 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_isgraph.c",
              735, ("isgraph should be 0 for 0x92"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x92>:
push   %rax
mov    $0x92,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2df,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x92\00"
define void @t_isgraph_0x92() {
%1 = call i64 @isgraph(i32 146)
%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 735, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x92\00"
define void @t_isgraph_0x92() {
%1 = tail call i64 @isgraph(i32 146)
%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 735, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *d_memcat(void *s1, size_t n1, void *s2, size_t n2) {
  void *target = (uint8_t *)s1 + n1;
  memcpy(target, s2, n2);
  return s1;
}


x86 assembly (clang, -O0):
<d_memcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_memcat>:
push   %rbx
mov    %rdi,%rbx
lea    (%rdi,%rsi,4),%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @d_memcat(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i64, i64* %6
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = bitcast i32* %13 to i8*
store i8* %14, i8** %9
%15 = load i8*, i8** %9
%16 = load i8*, i8** %7
%17 = load i64, i64* %8
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @d_memcat(i8* returned %0, i64 %1, i8* %2, i64 %3) {
%5 = bitcast i8* %0 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 %1
%7 = bitcast i32* %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %2, i64 %3)
ret i8* %0
}
/* Variables and functions */
double SuiteSparse_time();
double umfpack_timer(void) { return (SuiteSparse_time()); }


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

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

LLVM IR (-O0):
define double @umfpack_timer() {
%1 = call double (...) @SuiteSparse_time()
ret double %1
}

LLVM IR (-O2):
define double @umfpack_timer() {
%1 = tail call double (...) @SuiteSparse_time()
ret double %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned short my_getw(int /*<<< orphan*/ *);
unsigned long getdw(FILE *f) {
  unsigned short w;
  w = my_getw(f);
  return ((unsigned long)my_getw(f) << 16) | (unsigned long)w;
}


x86 assembly (clang, -O0):
<getdw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_getw@plt>
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_getw@plt>
movzwl %ax,%eax
shl    $0x10,%rax
movzwl -0xa(%rbp),%ecx
or     %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdw>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <my_getw@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <my_getw@plt>
movzwl %ax,%ecx
shl    $0x10,%rcx
movzwl %bp,%eax
or     %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @getdw(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call zeroext i16 @my_getw(i32* %4)
store i16 %5, i16* %3
%6 = load i32*, i32** %2
%7 = call zeroext i16 @my_getw(i32* %6)
%8 = zext i16 %7 to i64
%9 = shl i64 %8, 16
%10 = load i16, i16* %3
%11 = zext i16 %10 to i64
%12 = or i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @getdw(i32* %0) {
%2 = tail call zeroext i16 @my_getw(i32* %0)
%3 = tail call zeroext i16 @my_getw(i32* %0)
%4 = zext i16 %3 to i64
%5 = shl nuw nsw i64 %4, 16
%6 = zext i16 %2 to i64
%7 = or i64 %5, %6
ret i64 %7
}
/* Variables and functions */
int open(char const *, int);
int openfn(const char *path, int flags,
           void *user_data __attribute__((unused))) {
  return open(path, flags);
}


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

x86 assembly (clang, -O2):
<openfn>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @openfn(i8* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @open(i8* %0, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
void updateGoogleMaps(void) {
  char command[100] = "firefox main_html.html &";
  FILE *TestConsole = popen(command, "r");
  fclose(TestConsole);
}


x86 assembly (clang, -O0):
<updateGoogleMaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xf09(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateGoogleMaps>:
sub    $0x68,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xeea(%rip),%rsi
mov    %rsp,%rdi
call   1040 <popen@plt>
mov    %rax,%rdi
add    $0x68,%rsp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@__const.updateGoogleMaps.command = [100 x i8] c"firefox main_html.html &\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"r\00"
define void @updateGoogleMaps() {
%1 = alloca [100 x i8]
%2 = alloca i32*
%3 = bitcast [100 x i8]* %1 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32* @popen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
@__const.updateGoogleMaps.command = [100 x i8] c"firefox main_html.html &\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"r\00"
define void @updateGoogleMaps() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32* @popen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fclose(i32* %3)
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double benchTimer(void) {
  struct timespec time;
  clock_gettime(CLOCK_REALTIME, &time);
  return (double)time.tv_sec + 1.0E-09 * (double)time.tv_nsec;
}


x86 assembly (clang, -O0):
<benchTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchTimer>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xec3(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define double @benchTimer() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = call double @llvm.fmuladd.f64(double 1.000000e-09, double %9, double %6)
ret double %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define double @benchTimer() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 1.000000e-09, double %7)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Please type\n./vmart_genTime startYear endYear > Time.txt\nFor "
         "example\n./vmart_genTime 2003 2008 > Time.txt\n");
}


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

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

LLVM IR (-O0):
@.str = [107 x i8] c"Please type\0A./vmart_genTime startYear endYear > Time.txt\0AFor example\0A./vmart_genTime 2003 2008 > Time.txt\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [106 x i8] c"Please type\0A./vmart_genTime startYear endYear > Time.txt\0AFor example\0A./vmart_genTime 2003 2008 > Time.txt\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ scope_alloc();
int scope_return();
void scope_test(void) {
  scope_alloc();
  int ret = scope_return();
  assert(ret == 20);
}


x86 assembly (clang, -O0):
<scope_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <scope_alloc@plt>
mov    $0x0,%al
call   1030 <scope_return@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scope_test>:
push   %rax
xor    %eax,%eax
call   1050 <scope_alloc@plt>
xor    %eax,%eax
call   1030 <scope_return@plt>
xor    %edi,%edi
cmp    $0x14,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @scope_test() {
%1 = alloca i32
%2 = call i32 (...) @scope_alloc()
%3 = call i32 (...) @scope_return()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 20
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @scope_test() {
%1 = tail call i32 (...) @scope_alloc()
%2 = tail call i32 (...) @scope_return()
%3 = icmp eq i32 %2, 20
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
int uffs_GetVersion(void) { return 0x01030000; }


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

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

LLVM IR (-O0):
define i32 @uffs_GetVersion() {
ret i32 16973824
}

LLVM IR (-O2):
define i32 @uffs_GetVersion() {
ret i32 16973824
}
/* Variables and functions */
int alphaBlendConstwithpaintMode(int, int, int /*<<< orphan*/);
int alphaBlendConstwith(int sourceWord, int destinationWord) {
  return alphaBlendConstwithpaintMode(sourceWord, destinationWord, 0);
}


x86 assembly (clang, -O0):
<alphaBlendConstwith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <alphaBlendConstwithpaintMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphaBlendConstwith>:
xor    %edx,%edx
jmp    1030 <alphaBlendConstwithpaintMode@plt>

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

LLVM IR (-O2):
define i32 @alphaBlendConstwith(i32 %0, i32 %1) {
%3 = tail call i32 @alphaBlendConstwithpaintMode(i32 %0, i32 %1, i32 0)
ret i32 %3
}
int cmp_char_lt(const void *a, const void *b) {
  char a_ = *(char *)a;
  char b_ = *(char *)b;
  if (a_ < b_)
    return -1;
  if (a_ > b_)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_char_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jge    113a <cmp_char_lt+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <cmp_char_lt+0x5d>
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jle    1156 <cmp_char_lt+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <cmp_char_lt+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_char_lt>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_char_lt(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp sgt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ gen_is_snb(int);
int gen_get_snb_gt(int devid) {
  assert(gen_is_snb(devid));
  return (devid & 0x30) ? 2 : 1;
}


x86 assembly (clang, -O0):
<gen_get_snb_gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gen_is_snb@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edx
and    $0x30,%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_get_snb_gt>:
push   %rbx
mov    %edi,%ebx
call   1040 <gen_is_snb@plt>
mov    %eax,%edi
call   1030 <assert@plt>
and    $0x30,%ebx
cmp    $0x1,%ebx
mov    $0x2,%eax
sbb    $0x0,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_get_snb_gt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @gen_is_snb(i32 %3)
%5 = call i32 @assert(i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 48
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 2, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @gen_get_snb_gt(i32 %0) {
%2 = tail call i32 @gen_is_snb(i32 %0)
%3 = tail call i32 @assert(i32 %2)
%4 = and i32 %0, 48
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 1, i32 2
ret i32 %6
}
void perrx(label) char *label;
{
  perr(label);
  exit(1);
}


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

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

LLVM IR (-O0):
define void @perrx(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @perr to i32 (i8*, ...)*)(i8* %3)
unreachable
}

LLVM IR (-O2):
define void @perrx(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perr to i32 (i8*, ...)*)(i8* %0)
tail call void @exit(i32 1)
unreachable
}
long long int middle(long long int num) {
  long long int midpoint;
  midpoint = num / 2;
  return midpoint;
}


x86 assembly (clang, -O0):
<middle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<middle>:
mov    %rdi,%rax
shr    $0x3f,%rax
add    %rdi,%rax
sar    %rax
ret

LLVM IR (-O0):
define i64 @middle(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 2
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @middle(i64 %0) {
%2 = sdiv i64 %0, 2
ret i64 %2
}
/* Variables and functions */
scalar_t__ strstr(char const *, char *);
unsigned char has_insecure_name_p(const char *s) {
  if (*s == '/')
    return 1;
  if (strstr(s, "../") != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<has_insecure_name_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1135 <has_insecure_name_p+0x25>
movb   $0x1,-0x1(%rbp)
jmp    115c <has_insecure_name_p+0x4c>
mov    -0x10(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1158 <has_insecure_name_p+0x48>
movb   $0x1,-0x1(%rbp)
jmp    115c <has_insecure_name_p+0x4c>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_insecure_name_p>:
push   %rax
mov    $0x1,%al
cmpb   $0x2f,(%rdi)
je     112a <has_insecure_name_p+0x1a>
lea    0xee1(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"../\00"
define zeroext i8 @has_insecure_name_p(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 1, i8* %2
br label %15
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strstr(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 1, i8* %2
br label %15
14: ; preds = %9
store i8 0, i8* %2
br label %15
15: ; preds = %14, %13, %8
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
@.str = [4 x i8] c"../\00"
define zeroext i8 @has_insecure_name_p(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i8
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 1, %1 ], [ %7, %4 ]
ret i8 %9
}
void test17(int x) {
  x = x / 0;
  x = x % 0;
  x /= 0;
  x %= 0;
  x = sizeof(x / 0);
}


x86 assembly (clang, -O0):
<test17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
movl   $0x4,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test17(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 0
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = srem i32 %5, 0
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 0
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = srem i32 %9, 0
store i32 %10, i32* %2
store i32 4, i32* %2
ret void
}

LLVM IR (-O2):
define void @test17(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void throwError(char *error) { printf("\n%s\n", error); }


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

x86 assembly (clang, -O2):
<throwError>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
define void @throwError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void Port_Start(void) { return; }


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

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

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

LLVM IR (-O2):
define void @Port_Start() {
ret void
}
int iskeychar(int c) {
  switch (c) {
  case '\r':
  case '\n':
  case ':':
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<iskeychar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xa,%eax
je     113d <iskeychar+0x3d>
jmp    111b <iskeychar+0x1b>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     113d <iskeychar+0x3d>
jmp    112c <iskeychar+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x3a,%eax
jne    1149 <iskeychar+0x49>
jmp    113d <iskeychar+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1150 <iskeychar+0x50>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iskeychar>:
cmp    $0x3a,%edi
ja     111a <iskeychar+0x1a>
xor    %eax,%eax
mov    %edi,%ecx
movabs $0x400000000002400,%rdx
bt     %rcx,%rdx
jae    111a <iskeychar+0x1a>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @iskeychar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 13, label %5
i32 10, label %5
i32 58, label %5
]
5: ; preds = %1, %1, %1
store i32 0, i32* %2
br label %7
6: ; preds = %1
store i32 1, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @iskeychar(i32 %0) {
switch i32 %0, label %2 [
i32 13, label %3
i32 10, label %3
i32 58, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %4
}
int test_imm_0Cint16_mem(short *val) {
  return ((*val) & (-0x0C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Cint16_mem>:
movzwl (%rdi),%eax
test   $0xfff4,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -12
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ db_sqlite3_handle();
int /*<<< orphan*/ db_sqlite3_lock();
int /*<<< orphan*/ db_sqlite3_unlock();
scalar_t__ sqlite3_last_insert_rowid(int /*<<< orphan*/);
int db_sqlite3_insert_id(void) {
  int result;
  db_sqlite3_lock();
  result = (int)sqlite3_last_insert_rowid(db_sqlite3_handle());
  db_sqlite3_unlock();
  return result;
}


x86 assembly (clang, -O0):
<db_sqlite3_insert_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <db_sqlite3_lock@plt>
mov    $0x0,%al
call   1060 <db_sqlite3_handle@plt>
mov    %eax,%edi
call   1050 <sqlite3_last_insert_rowid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <db_sqlite3_unlock@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_sqlite3_insert_id>:
push   %rbx
xor    %eax,%eax
call   1030 <db_sqlite3_lock@plt>
xor    %eax,%eax
call   1060 <db_sqlite3_handle@plt>
mov    %eax,%edi
call   1050 <sqlite3_last_insert_rowid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <db_sqlite3_unlock@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @db_sqlite3_insert_id() {
%1 = alloca i32
%2 = call i32 (...) @db_sqlite3_lock()
%3 = call i32 (...) @db_sqlite3_handle()
%4 = call i64 @sqlite3_last_insert_rowid(i32 %3)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = call i32 (...) @db_sqlite3_unlock()
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @db_sqlite3_insert_id() {
%1 = tail call i32 (...) @db_sqlite3_lock()
%2 = tail call i32 (...) @db_sqlite3_handle()
%3 = tail call i64 @sqlite3_last_insert_rowid(i32 %2)
%4 = trunc i64 %3 to i32
%5 = tail call i32 (...) @db_sqlite3_unlock()
ret i32 %4
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
__attribute__((always_)) uint8_t rol8(uint8_t data, unsigned int rotation) {
  return ((data << rotation) | (data >> (8 - rotation)));
}


x86 assembly (clang, -O0):
<rol8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol8>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x8,%dl
sub    %cl,%dl
mov    %edx,%ecx
shr    %cl,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @rol8(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 8, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ die_if_readerr(int, size_t);
int pread(int, void *, size_t, int /*<<< orphan*/);
int spread(int fd, void *buf, size_t size, off_t offset) {
  int ret = pread(fd, buf, size, offset);
  die_if_readerr(ret, size);
  return ret;
}


x86 assembly (clang, -O0):
<spread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <pread@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <die_if_readerr@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spread>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1040 <pread@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <die_if_readerr@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @spread(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = call i32 @pread(i32 %10, i8* %11, i64 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = load i64, i64* %7
%17 = call i32 @die_if_readerr(i32 %15, i64 %16)
%18 = load i32, i32* %9
ret i32 %18
}

LLVM IR (-O2):
define i32 @spread(i32 %0, i8* nocapture %1, i64 %2, i32 %3) {
%5 = tail call i32 @pread(i32 %0, i8* %1, i64 %2, i32 %3)
%6 = tail call i32 @die_if_readerr(i32 %5, i64 %2)
ret i32 %5
}
int ThreadPriority(void *Thread, int Priority) { return 0; }


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

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

LLVM IR (-O0):
define i32 @ThreadPriority(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @ThreadPriority(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ motor(int, int);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ off(int);
void slowForward(int dist) {
  motor(3, 50);
  motor(1, 60);
  msleep(dist);
  off(3);
  off(1);
}


x86 assembly (clang, -O0):
<slowForward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x32,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0x3c,%esi
call   1030 <motor@plt>
mov    -0x4(%rbp),%edi
call   1050 <msleep@plt>
mov    $0x3,%edi
call   1040 <off@plt>
mov    $0x1,%edi
call   1040 <off@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slowForward>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%edi
mov    $0x32,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0x3c,%esi
call   1030 <motor@plt>
mov    %ebx,%edi
call   1050 <msleep@plt>
mov    $0x3,%edi
call   1040 <off@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1040 <off@plt>

LLVM IR (-O0):
define void @slowForward(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @motor(i32 3, i32 50)
%4 = call i32 @motor(i32 1, i32 60)
%5 = load i32, i32* %2
%6 = call i32 @msleep(i32 %5)
%7 = call i32 @off(i32 3)
%8 = call i32 @off(i32 1)
ret void
}

LLVM IR (-O2):
define void @slowForward(i32 %0) {
%2 = tail call i32 @motor(i32 3, i32 50)
%3 = tail call i32 @motor(i32 1, i32 60)
%4 = tail call i32 @msleep(i32 %0)
%5 = tail call i32 @off(i32 3)
%6 = tail call i32 @off(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ do_log(int /*<<< orphan*/, char *);
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
void *xmalloc(size_t n) {
  void *x = malloc(n);
  if (n > 0 && x == NULL) {
    do_log(LOG_ERR, "malloc: %m");
    exit(1);
  }
  return x;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    117e <xmalloc+0x4e>
cmpq   $0x0,-0x10(%rbp)
jne    117e <xmalloc+0x4e>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1030 <do_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rbx,%rbx
je     1143 <xmalloc+0x13>
test   %rax,%rax
je     1145 <xmalloc+0x15>
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <do_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [11 x i8] c"malloc: %m\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* @LOG_ERR
%13 = call i32 @do_log(i32 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %8, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [11 x i8] c"malloc: %m\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i64 %0, 0
%4 = icmp eq i8* %2, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @LOG_ERR
%8 = tail call i32 @do_log(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret i8* %2
}
float test_nearbyintf(float x) { return __builtin_nearbyintf(x); }


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

x86 assembly (clang, -O2):
<test_nearbyintf>:
jmp    1030 <nearbyintf@plt>

LLVM IR (-O0):
define float @test_nearbyintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.nearbyint.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test_nearbyintf(float %0) {
%2 = tail call float @llvm.nearbyint.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ __fill_table(int *, int, char *);
int __horspool(char *, char *, int *);
int horspool_match(char *haystack, char *needle) {
  int shift_table[256];
  __fill_table(shift_table, 256, needle);
  return __horspool(haystack, needle, shift_table);
}


x86 assembly (clang, -O0):
<horspool_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x100,%esi
call   1030 <__fill_table@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x410(%rbp),%rdx
call   1040 <__horspool@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<horspool_match>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1030 <__fill_table@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <__horspool@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @horspool_match(i8* %0, i8* %1) {
%3 = alloca [256 x i32]
%4 = bitcast [256 x i32]* %3 to i8*
%5 = getelementptr inbounds [256 x i32], [256 x i32]* %3, i64 0, i64 0
%6 = call i32 @__fill_table(i32* %5, i32 256, i8* %1)
%7 = call i32 @__horspool(i8* %0, i8* %1, i32* %5)
ret i32 %7
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double rand_range_double(double min_n, double max_n) {
  return (double)rand() / RAND_MAX * (max_n - min_n) + min_n;
}


x86 assembly (clang, -O0):
<rand_range_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
divsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range_double>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_range_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %8, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_range_double(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ LCDWrite(int, char);
void LCDBitmap(char my_array[]) {
  for (int index = 0; index < (84 * 48 / 8); index++)
    LCDWrite(1, my_array[index]);
}


x86 assembly (clang, -O0):
<LCDBitmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1f8,-0xc(%rbp)
jge    1154 <LCDBitmap+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    $0x1,%edi
movsbl (%rax,%rcx,1),%esi
call   1030 <LCDWrite@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <LCDBitmap+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDBitmap>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%esi
mov    $0x1,%edi
call   1030 <LCDWrite@plt>
add    $0x1,%rbx
cmp    $0x1f8,%rbx
jne    1120 <LCDBitmap+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LCDBitmap(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 504
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = call i32 @LCDWrite(i32 1, i8 signext %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @LCDBitmap(i8* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @LCDWrite(i32 1, i8 signext %6)
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 504
br i1 %9, label %2, label %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ ts_packet_get_cont(scalar_t__ *);
int /*<<< orphan*/ ts_packet_set_cont(scalar_t__ *, scalar_t__);
void ts_packet_inc_cont(uint8_t *ts_packet, uint8_t increment) {
  ts_packet_set_cont(ts_packet, ts_packet_get_cont(ts_packet) + increment);
}


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

x86 assembly (clang, -O2):
<ts_packet_inc_cont>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <ts_packet_get_cont@plt>
add    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ts_packet_set_cont@plt>

LLVM IR (-O0):
define void @ts_packet_inc_cont(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64*, i64** %3
%7 = call i64 @ts_packet_get_cont(i64* %6)
%8 = load i64, i64* %4
%9 = add nsw i64 %7, %8
%10 = call i32 @ts_packet_set_cont(i64* %5, i64 %9)
ret void
}

LLVM IR (-O2):
define void @ts_packet_inc_cont(i64* %0, i64 %1) {
%3 = tail call i64 @ts_packet_get_cont(i64* %0)
%4 = add nsw i64 %3, %1
%5 = tail call i32 @ts_packet_set_cont(i64* %0, i64 %4)
ret void
}
/* Variables and functions */
long *malloc(int);
int /*<<< orphan*/ printf(char *, long);
void main() {
  long *a;
  a = malloc(8 * 20);
  a[8] = 9;
  printf("a[8]=%d\n", a[8]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa0,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x9,0x40(%rax)
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa0,%edi
call   1040 <malloc@plt>
lea    0xece(%rip),%rdi
mov    $0x9,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"a[8]=%d\0A\00"
define void @main() {
%1 = tail call i64* @malloc(i32 160)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 9)
ret void
}
int g_DUMMY_menu_append_toggle(int menu_id, char *label, int return_id,
                               int toggle_on) {
  menu_id = menu_id;
  label = label;
  return_id = return_id;
  toggle_on = toggle_on;
  return -1;
}


x86 assembly (clang, -O0):
<g_DUMMY_menu_append_toggle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_menu_append_toggle(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}