xunge/DecIR huggingface dataset:
char *ml_getvowel(char *t) {
  if (t[0] == 'c') {
    return (++t);
  } else {
    return (t);
  }
}


x86 assembly (clang, -O0):
<ml_getvowel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    112d <ml_getvowel+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1135 <ml_getvowel+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_getvowel>:
xor    %eax,%eax
cmpb   $0x63,(%rdi)
sete   %al
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @ml_getvowel(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 99
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @ml_getvowel(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 99
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
void ttstartup() {}


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

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

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

LLVM IR (-O2):
define void @ttstartup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_mday;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int date_get_day(void) {
  time_t t = time(NULL);
  struct tm *lt = localtime(&t);
  return lt->tm_mday;
}


x86 assembly (clang, -O0):
<date_get_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_day>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @date_get_day() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @date_get_day() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
void XtAppInitialize() {}


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

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

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

LLVM IR (-O2):
define void @XtAppInitialize() {
ret void
}
/* Variables and functions */
char const *format_check_error_ex(char const *, int, char const *, char const *,
                                  int /*<<< orphan*/ *);
const char *format_check_error(const char *filename, int linenum,
                               const char *expr, const char *unused) {
  return format_check_error_ex(filename, linenum, expr, unused, NULL);
}


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

x86 assembly (clang, -O2):
<format_check_error>:
xor    %r8d,%r8d
jmp    1030 <format_check_error_ex@plt>

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

LLVM IR (-O2):
define i8* @format_check_error(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i8* @format_check_error_ex(i8* %0, i32 %1, i8* %2, i8* %3, i32* null)
ret i8* %5
}
/* Variables and functions */
void bzero(char *buffer, unsigned int size) {
  unsigned int i;
  for (i = 0; i < size; i++) {
    buffer[i] = 0;
  }
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1137 <bzero+0x37>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <bzero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %esi,%esi
je     1122 <bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
done(status) { exit(status); }


x86 assembly (clang, -O0):
<done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<done>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @done(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define i32 @done(i32 %0) {
tail call void @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void i2cClose(int i2cAdapter) {
  close(i2cAdapter);
  i2cAdapter = -1;
}


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

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

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

LLVM IR (-O2):
define void @i2cClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void RatonMovido(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @RatonMovido(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int child_stat(char const *, char const *, struct stat *);
int has_child_dir(const char *base, const char *child) {
  int result = 0;
  int status;
  struct stat sb;
  status = child_stat(base, child, &sb);
  if ((status >= 0) && S_ISDIR(sb.st_mode)) {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<has_child_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <child_stat@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     116e <has_child_dir+0x4e>
mov    -0x20(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     116e <has_child_dir+0x4e>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_child_dir>:
push   %rax
mov    %rsp,%rdx
call   1040 <child_stat@plt>
test   %eax,%eax
js     1142 <has_child_dir+0x22>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @has_child_dir(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.stat
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @child_stat(i8* %8, i8* %9, %struct.stat* %7)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%15 = load i32, i32* %14
%16 = call i64 @S_ISDIR(i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %5
br label %19
19: ; preds = %18, %13, %2
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @has_child_dir(i8* %0, i8* %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @child_stat(i8* %0, i8* %1, %struct.stat* %3)
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %2
%14 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %14
}
void TimerM$AlarmControl$clearPendingInterrupt(void) {
  MSP430TimerM$ControlB3$clearPendingInterrupt();
}


x86 assembly (clang, -O0):
<TimerM$AlarmControl$clearPendingInterrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MSP430TimerM$ControlB3$clearPendingInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerM$AlarmControl$clearPendingInterrupt>:
xor    %eax,%eax
jmp    1030 <MSP430TimerM$ControlB3$clearPendingInterrupt@plt>

LLVM IR (-O0):
define void @"TimerM$AlarmControl$clearPendingInterrupt"() {
%1 = call i32 (...) @"MSP430TimerM$ControlB3$clearPendingInterrupt"()
ret void
}

LLVM IR (-O2):
define void @"TimerM$AlarmControl$clearPendingInterrupt"() {
%1 = tail call i32 (...) @"MSP430TimerM$ControlB3$clearPendingInterrupt"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int atexit(void (*)());
void Atexit(void (*function)(void)) {
  int retval;
  retval = atexit(function);
  if (retval != 0)
    Sys_failure("atexit\n");
}


x86 assembly (clang, -O0):
<Atexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1160 <atexit>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <Atexit+0x2e>
lea    0xeb7(%rip),%rdi
call   1030 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax

x86 assembly (clang, -O2):
<Atexit>:
push   %rax
call   1140 <atexit>
test   %eax,%eax
je     1137 <Atexit+0x17>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1030 <Sys_failure@plt>
pop    %rax
ret
nopl   0x0(%rax)

LLVM IR (-O0):
@.str = [8 x i8] c"atexit\0A\00"
define void @Atexit(void ()* %0) {
%2 = alloca void ()*
%3 = alloca i32
store void ()* %0, void ()** %2
%4 = load void ()*, void ()** %2
%5 = bitcast void ()* %4 to void (...)*
%6 = call i32 @atexit(void (...)* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @Sys_failure(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"atexit\0A\00"
define void @Atexit(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @atexit(void (...)* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
void DummyWindowsCEFunction(void) {}


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

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

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

LLVM IR (-O2):
define void @DummyWindowsCEFunction() {
ret void
}
/* Variables and functions */
int shmdt(void *);
int cwirc_shm_detach(void *shm) { return (shmdt(shm)); }


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

x86 assembly (clang, -O2):
<cwirc_shm_detach>:
jmp    1030 <shmdt@plt>

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

LLVM IR (-O2):
define i32 @cwirc_shm_detach(i8* %0) {
%2 = tail call i32 @shmdt(i8* %0)
ret i32 %2
}
/* Variables and functions */
float fabsf(float);
float _longitude_distance(float lon_a, float lon_b) {
  float d1 = fabsf(lon_a - lon_b);
  float d2 = 360.f - d1;
  return (d1 < d2) ? d1 : d2;
}


x86 assembly (clang, -O0):
<_longitude_distance>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movaps 0xef1(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xed0(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    115c <_longitude_distance+0x5c>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1166 <_longitude_distance+0x66>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_longitude_distance>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
movss  0xefd(%rip),%xmm1
subss  %xmm0,%xmm1
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_longitude_distance(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = call float @llvm.fabs.f32(float %9)
store float %10, float* %5
%11 = load float, float* %5
%12 = fsub float 3.600000e+02, %11
store float %12, float* %6
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load float, float* %5
br label %20
18: ; preds = %2
%19 = load float, float* %6
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
ret float %21
}

LLVM IR (-O2):
define float @_longitude_distance(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @llvm.fabs.f32(float %3)
%5 = fsub float 3.600000e+02, %4
%6 = fcmp olt float %4, %5
%7 = select i1 %6, float %4, float %5
ret float %7
}
char *getHostsFile() { return "/etc/hosts"; }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"/etc/hosts\00"
define i8* @getHostsFile() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"/etc/hosts\00"
define i8* @getHostsFile() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void main(void) { f((int)1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <f@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 @f(i32 1)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @f(i32 1)
ret void
}
/* Variables and functions */
int const rand();
int rand_range(const int range) { return rand() % range; }


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

x86 assembly (clang, -O2):
<rand_range>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rand_range(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
void main(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
unsigned short b2_to_u16(unsigned char *b) {
  unsigned short l;
  l = b[0];
  l += (unsigned)b[1] << 8;
  return l;
}


x86 assembly (clang, -O0):
<b2_to_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
shl    $0x8,%ecx
movzwl -0xa(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b2_to_u16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @b2_to_u16(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
store i16 %7, i16* %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = add i32 %14, %12
%16 = trunc i32 %15 to i16
store i16 %16, i16* %3
%17 = load i16, i16* %3
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @b2_to_u16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %2 to i16
%8 = or i16 %6, %7
ret i16 %8
}
int linit_tasks_test_0(int n) { return (n == 0); }


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

x86 assembly (clang, -O2):
<linit_tasks_test_0>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @linit_tasks_test_0(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long mstime(void) {
  struct timeval tmptv;
  gettimeofday(&tmptv, NULL);
  return ((long long)tmptv.tv_sec * 1000) + (tmptv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<mstime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
double get_double(const void *iptr) {
  const char *idata = (const char *)iptr;
  int i;
  double rval;
  char *buff = (char *)&rval;
  for (i = 0; i < 8; i++)
    buff[i] = *idata++;
  return (rval);
}


x86 assembly (clang, -O0):
<get_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1153 <get_double+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%dl
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111f <get_double+0x1f>
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_double>:
movsd  (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @get_double(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main(int argc, char **argv) {
  assert(0 && "aflw requires GSL library support");
  return 0;
}


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

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

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 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
int __esp_notify_ns(const char *a, void *b) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @__esp_notify_ns(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ isinf(double);
scalar_t__ isnan(double);
double getValidValue(double v) {
  if (isnan(v)) {
    return -1;
  } else if (isinf(v)) {
    return -2;
  } else {
    return v;
  }
}


x86 assembly (clang, -O0):
<getValidValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1153 <getValidValue+0x33>
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <getValidValue+0x63>
movsd  -0x10(%rbp),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%rax
je     1179 <getValidValue+0x59>
movsd  0xe91(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <getValidValue+0x63>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getValidValue>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <isnan@plt>
test   %rax,%rax
je     113a <getValidValue+0x1a>
movsd  0xec8(%rip),%xmm0
pop    %rax
ret
movsd  (%rsp),%xmm0
call   1040 <isinf@plt>
test   %rax,%rax
movsd  (%rsp),%xmm0
je     1156 <getValidValue+0x36>
movsd  0xeb2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getValidValue(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i64 @isnan(double %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store double -1.000000e+00, double* %2
br label %15
8: ; preds = %1
%9 = load double, double* %3
%10 = call i64 @isinf(double %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store double -2.000000e+00, double* %2
br label %15
13: ; preds = %8
%14 = load double, double* %3
store double %14, double* %2
br label %15
15: ; preds = %13, %12, %7
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @getValidValue(double %0) {
%2 = tail call i64 @isnan(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isinf(double %0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, double %0, double -2.000000e+00
br label %8
8: ; preds = %4, %1
%9 = phi double [ -1.000000e+00, %1 ], [ %7, %4 ]
ret double %9
}
void test_two(int x, int y) {
#pragma omp distribute simd
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ u_int;

/* Variables and functions */
int before(u_int seq1, u_int seq2) { return ((int)(seq1 - seq2) < 0); }


x86 assembly (clang, -O0):
<before>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<before>:
mov    %rdi,%rax
sub    %esi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @before(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = icmp slt i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @before(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = trunc i64 %3 to i32
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gtk_init(int *, char ***);
int mini_gtk_init(int argc, char *argv[]) {
  gtk_init(&argc, &argv);
  return argc;
}


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

x86 assembly (clang, -O2):
<mini_gtk_init>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %rsi,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gtk_init@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @mini_gtk_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @gtk_init(i32* %3, i8*** %4)
%6 = load i32, i32* %3
ret i32 %6
}
extern int _Z13__get_rf_modev(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @_Z13__get_rf_modev() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @_Z13__get_rf_modev() {
ret i32 -1
}
/* Variables and functions */
int memcmp(char *, char *, int);
int strcmp(char *, char *);
int snofCmp(char *prefix, char *name, int maxSize, int isPrefix) {
  if (isPrefix)
    return memcmp(prefix, name, maxSize);
  else
    return strcmp(prefix, name);
}


x86 assembly (clang, -O0):
<snofCmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1158 <snofCmp+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <snofCmp+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snofCmp>:
test   %ecx,%ecx
je     1129 <snofCmp+0x9>
jmp    1030 <memcmp@plt>
jmp    1040 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @snofCmp(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %2)
br label %10
8: ; preds = %4
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
void verify_stack_enumeration() {}


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

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

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

LLVM IR (-O2):
define void @verify_stack_enumeration() {
ret void
}
void topla(int s1, int s2, int *y) { *y = s1 + s2; }


x86 assembly (clang, -O0):
<topla>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<topla>:
add    %esi,%edi
mov    %edi,(%rdx)
ret

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

LLVM IR (-O2):
define void @topla(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add nsw i32 %1, %0
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  {
    printf("\n*** fatal: "
           "test.\n");
    exit(1);
  };
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"\0A*** fatal: test.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void copy_data(int dest, int src, void *darray, void *sarray, int esize) {
  char *destArray = darray;
  char *srcArray = sarray;
  memcpy(&destArray[dest * esize], &srcArray[src * esize], esize);
}


x86 assembly (clang, -O0):
<copy_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x4(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x30(%rbp),%rsi
mov    -0x8(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_data>:
imul   %r8d,%edi
movslq %edi,%rdi
add    %rdx,%rdi
imul   %r8d,%esi
movslq %esi,%rsi
add    %rcx,%rsi
mov    %r8d,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy_data(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%13 = load i8*, i8** %8
store i8* %13, i8** %11
%14 = load i8*, i8** %9
store i8* %14, i8** %12
%15 = load i8*, i8** %11
%16 = load i32, i32* %6
%17 = load i32, i32* %10
%18 = mul nsw i32 %16, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %15, i64 %19
%21 = load i8*, i8** %12
%22 = load i32, i32* %7
%23 = load i32, i32* %10
%24 = mul nsw i32 %22, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %21, i64 %25
%27 = load i32, i32* %10
%28 = call i32 @memcpy(i8* %20, i8* %26, i32 %27)
ret void
}

LLVM IR (-O2):
define void @copy_data(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = mul nsw i32 %4, %0
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
%9 = mul nsw i32 %4, %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %3, i64 %10
%12 = tail call i32 @memcpy(i8* %8, i8* %11, i32 %4)
ret void
}
int rightchild(int iPos) { return 2 * iPos + 2; }


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

x86 assembly (clang, -O2):
<rightchild>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @rightchild(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @rightchild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
checkint() {}


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

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

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

LLVM IR (-O2):
define i32 @checkint() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Thread();
void b() { Thread(); }


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

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

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

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 (...) @Thread()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EV_KEY;
int KEY_F7;
int KEY_F8;
int KEY_F9;
int /*<<< orphan*/ send_button(int /*<<< orphan*/, int, int);
void key_action(int which, int is_down) {
  int code;
  switch (which) {
  case 0:
    code = KEY_F7;
    break;
  case 1:
    code = KEY_F8;
    break;
  case 2:
    code = KEY_F9;
    break;
  }
  send_button(EV_KEY, code, is_down);
}


x86 assembly (clang, -O0):
<key_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1153 <key_action+0x43>
jmp    1131 <key_action+0x21>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1164 <key_action+0x54>
jmp    1142 <key_action+0x32>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1175 <key_action+0x65>
jmp    1181 <key_action+0x71>
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1181 <key_action+0x71>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1181 <key_action+0x71>
mov    0x2e4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <send_button@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_action>:
mov    %esi,%edx
movslq %edi,%rax
lea    0x2ce4(%rip),%rcx
mov    (%rcx,%rax,8),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <send_button@plt>

LLVM IR (-O0):
@KEY_F7 = global i32 0
@KEY_F8 = global i32 0
@KEY_F9 = global i32 0
@EV_KEY = global i32 0
define void @key_action(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
switch i32 %6, label %13 [
i32 0, label %7
i32 1, label %9
i32 2, label %11
]
7: ; preds = %2
%8 = load i32, i32* @KEY_F7
store i32 %8, i32* %5
br label %13
9: ; preds = %2
%10 = load i32, i32* @KEY_F8
store i32 %10, i32* %5
br label %13
11: ; preds = %2
%12 = load i32, i32* @KEY_F9
store i32 %12, i32* %5
br label %13
13: ; preds = %2, %11, %9, %7
%14 = load i32, i32* @EV_KEY
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = call i32 @send_button(i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
@KEY_F7 = global i32 0
@KEY_F8 = global i32 0
@KEY_F9 = global i32 0
@EV_KEY = global i32 0
@switch.table.key_action = [3 x i32*] [i32* @KEY_F7, i32* @KEY_F8, i32* @KEY_F9]
define void @key_action(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds [3 x i32*], [3 x i32*]* @switch.table.key_action, i64 0, i64 %3
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32, i32* @EV_KEY
%8 = tail call i32 @send_button(i32 %7, i32 %6, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x0f() {
  Assert_real((isdigit(15) == 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",
              80, ("isdigit should be 0 for 0x0f"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x0f>:
push   %rax
mov    $0xf,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x50,%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 0x0f\00"
define void @t_isdigit_0x0f() {
%1 = call i64 @isdigit(i32 15)
%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 80, 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 0x0f\00"
define void @t_isdigit_0x0f() {
%1 = tail call i64 @isdigit(i32 15)
%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 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *pa_getvowel(char *t) {
  if (t[0] == 'c') {
    return (++t);
  } else {
    return (t);
  }
}


x86 assembly (clang, -O0):
<pa_getvowel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    112d <pa_getvowel+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1135 <pa_getvowel+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_getvowel>:
xor    %eax,%eax
cmpb   $0x63,(%rdi)
sete   %al
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @pa_getvowel(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 99
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @pa_getvowel(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 99
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
/* Type definitions */
typedef int uint32_t;
typedef unsigned long uint16_t;

/* Variables and functions */
void LCDIDDIndexedWrite(uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Addr,
                        uint16_t ui16Data) {
  uint32_t ui32Addr;
  ;
  ;
  ui32Addr = ui32CS ? 0x00000020 : 0x00000014;
  (*((volatile unsigned long *)(ui32Base + ui32Addr))) = ui16Addr;
  ui32Addr = ui32CS ? 0x00000024 : 0x00000018;
  (*((volatile unsigned long *)(ui32Base + ui32Addr))) = ui16Data;
}


x86 assembly (clang, -O0):
<LCDIDDIndexedWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x14,%eax
mov    $0x20,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    -0x1c(%rbp),%eax
cltq
mov    %rcx,(%rax)
mov    -0x8(%rbp),%edx
mov    $0x18,%eax
mov    $0x24,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    -0x1c(%rbp),%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIDDIndexedWrite>:
test   %esi,%esi
mov    $0x14,%eax
mov    $0x20,%esi
cmove  %eax,%esi
movslq %edi,%rax
mov    %rdx,(%rsi,%rax,1)
mov    $0x18,%edx
mov    $0x24,%esi
cmove  %edx,%esi
mov    %rcx,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @LCDIDDIndexedWrite(i32 %0, i32 %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 32, i32 20
store i32 %13, i32* %9
%14 = load i64, i64* %7
%15 = load i32, i32* %5
%16 = load i32, i32* %9
%17 = add nsw i32 %15, %16
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i64*
store volatile i64 %14, i64* %19
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 36, i32 24
store i32 %23, i32* %9
%24 = load i64, i64* %8
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = add nsw i32 %25, %26
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i64*
store volatile i64 %24, i64* %29
ret void
}

LLVM IR (-O2):
define void @LCDIDDIndexedWrite(i32 %0, i32 %1, i64 %2, i64 %3) {
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i32 20, i32 32
%7 = add nsw i32 %6, %0
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
store volatile i64 %2, i64* %9
%10 = select i1 %5, i32 24, i32 36
%11 = add nsw i32 %10, %0
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i64*
store volatile i64 %3, i64* %13
ret void
}