xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint32_t;
struct etimer {
  int dummy;
};

/* Variables and functions */
scalar_t__ timer_elapsed_time(struct etimer *);
bool timer_elapsed_milliseconds(struct etimer *t, uint32_t milliseconds) {
  return (timer_elapsed_time(t) >= milliseconds);
}


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

x86 assembly (clang, -O2):
<timer_elapsed_milliseconds>:
push   %rbx
mov    %rsi,%rbx
call   1030 <timer_elapsed_time@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setge  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_milliseconds(%struct.etimer* %0, i64 %1) {
%3 = alloca %struct.etimer*
%4 = alloca i64
store %struct.etimer* %0, %struct.etimer** %3
store i64 %1, i64* %4
%5 = load %struct.etimer*, %struct.etimer** %3
%6 = call i64 @timer_elapsed_time(%struct.etimer* %5)
%7 = load i64, i64* %4
%8 = icmp sge i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_milliseconds(%struct.etimer* %0, i64 %1) {
%3 = tail call i64 @timer_elapsed_time(%struct.etimer* %0)
%4 = icmp sge i64 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
void netcdf_OpenTS(char *Filename) {}


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

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

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

LLVM IR (-O2):
define void @netcdf_OpenTS(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ convert_to_uppercase(char *, int /*<<< orphan*/,
                                        int /*<<< orphan*/);
char *strdup(char const *const);
int /*<<< orphan*/ strlen(char const *const);
char *get_uppercase(const char *const str) {
  char *upstr;
  upstr = strdup(str);
  convert_to_uppercase(upstr, 0, strlen(str));
  return upstr;
}


x86 assembly (clang, -O0):
<get_uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1040 <convert_to_uppercase@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uppercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1040 <convert_to_uppercase@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @get_uppercase(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @convert_to_uppercase(i8* %6, i32 0, i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @get_uppercase(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @convert_to_uppercase(i8* %2, i32 0, i32 %3)
ret i8* %2
}
int zsetfil(n, fc)
int n, fc;
{ return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @zsetfil(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ print_arguments(int, char **);
int main(int argc, char *argv[]) {
  print_arguments(argc, argv);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <print_arguments@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <print_arguments@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @print_arguments(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @print_arguments(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
char *basic_hostname() {
  static char hname[128];
  (void)gethostname(hname, 128);
  return (hname);
}


x86 assembly (clang, -O0):
<basic_hostname>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x80,%esi
call   1030 <gethostname@plt>
lea    0x2f14(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basic_hostname>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <gethostname@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@basic_hostname.hname = internal global [128 x i8] zeroinitializer
define i8* @basic_hostname() {
%1 = call i32 @gethostname(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @basic_hostname.hname, i64 0, i64 0), i32 128)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @basic_hostname.hname, i64 0, i64 0)
}

LLVM IR (-O2):
@basic_hostname.hname = internal global [128 x i8] zeroinitializer
define i8* @basic_hostname() {
%1 = tail call i32 @gethostname(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @basic_hostname.hname, i64 0, i64 0), i32 128)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @basic_hostname.hname, i64 0, i64 0)
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_RD_MAX_SPEED_HZ;
int ioctl(int, int /*<<< orphan*/, int *);
uint32_t get_spi_speed(int fd) {
  uint32_t speed;
  int ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
  if (ret >= 0) {
    return speed;
  }
  return ret;
}


x86 assembly (clang, -O0):
<get_spi_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1148 <get_spi_speed+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <get_spi_speed+0x3e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_spi_speed>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
test   %eax,%eax
js     112c <get_spi_speed+0x1c>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SPI_IOC_RD_MAX_SPEED_HZ = global i32 0
define i32 @get_spi_speed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @SPI_IOC_RD_MAX_SPEED_HZ
%8 = call i32 @ioctl(i32 %6, i32 %7, i32* %4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %15
13: ; preds = %1
%14 = load i32, i32* %5
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@SPI_IOC_RD_MAX_SPEED_HZ = global i32 0
define i32 @get_spi_speed(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @SPI_IOC_RD_MAX_SPEED_HZ
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp sgt i32 %5, -1
%7 = load i32, i32* %2
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
void glTexEnviv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glTexEnviv() {
ret void
}
char *langDbgDevIdeBeer() { return "Beer IDE"; }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Beer IDE\00"
define i8* @langDbgDevIdeBeer() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"Beer IDE\00"
define i8* @langDbgDevIdeBeer() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int VIM_HIF_GetReg8(int);
unsigned char VIM_JPEG_GetDecodeLines(void) {
  return ((VIM_HIF_GetReg8((0x0C00 + 0x000)) >> 2) & 0x1f);
}


x86 assembly (clang, -O0):
<VIM_JPEG_GetDecodeLines>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc00,%edi
call   1030 <VIM_HIF_GetReg8@plt>
sar    $0x2,%eax
and    $0x1f,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_GetDecodeLines>:
push   %rax
mov    $0xc00,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shr    $0x2,%al
and    $0x1f,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @VIM_JPEG_GetDecodeLines() {
%1 = call i32 @VIM_HIF_GetReg8(i32 3072)
%2 = ashr i32 %1, 2
%3 = and i32 %2, 31
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @VIM_JPEG_GetDecodeLines() {
%1 = tail call i32 @VIM_HIF_GetReg8(i32 3072)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 2
%4 = and i8 %3, 31
ret i8 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int q, z;
  q = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  while (q > 0) {
    q = q + z - 1;
    z = -z;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1156 <main+0x46>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %2
%14 = load i32, i32* %3
%15 = sub nsw i32 0, %14
store i32 %15, i32* %3
br label %6
16: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int munmap(void *, int);
int msvd_unmap_buffer(void *buf) { return munmap(buf, (4 * 1024 * 1024)); }


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

x86 assembly (clang, -O2):
<msvd_unmap_buffer>:
mov    $0x400000,%esi
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @msvd_unmap_buffer(i8* %0) {
%2 = tail call i32 @munmap(i8* %0, i32 4194304)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_serial_close();
int drv_Pertelian_close(void) {
  drv_generic_serial_close();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @drv_Pertelian_close() {
%1 = tail call i32 (...) @drv_generic_serial_close()
ret i32 0
}
void free_moves_single(int **moves) {
  int source;
  for (source = 0; source < 64; source++) {
    free(moves[source]);
  }
  free(moves);
}


x86 assembly (clang, -O0):
<free_moves_single>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    114c <free_moves_single+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <free_moves_single+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_moves_single>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1120 <free_moves_single+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_moves_single(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 64
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32**, i32*** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32*, i32** %8, i64 %10
%12 = load i32*, i32** %11
%13 = bitcast i32* %12 to i8*
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
%18 = load i32**, i32*** %2
%19 = bitcast i32** %18 to i8*
ret void
}

LLVM IR (-O2):
define void @free_moves_single(i32** nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i32*, i32** %0, i64 %3
%5 = bitcast i32** %4 to i8**
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 64
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = bitcast i32** %0 to i8*
tail call void @free(i8* %10)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
void i830_debug_yxminus1(char *result, int len, int reg, uint32_t val,
                         uint32_t devid) {
  snprintf(result, len, "%d, %d", ((val & 0xffff0000) >> 16) + 1,
           (val & 0xffff) + 1);
}


x86 assembly (clang, -O0):
<i830_debug_yxminus1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
and    $0xffff0000,%ecx
shr    $0x10,%ecx
add    $0x1,%ecx
mov    -0x14(%rbp),%r8d
and    $0xffff,%r8d
add    $0x1,%r8d
lea    0xeab(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i830_debug_yxminus1>:
movzwl %cx,%r8d
shr    $0x10,%ecx
add    $0x1,%ecx
add    $0x1,%r8d
lea    0xedb(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d, %d\00"
define void @i830_debug_yxminus1(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = and i32 %13, -65536
%15 = lshr i32 %14, 16
%16 = add i32 %15, 1
%17 = load i32, i32* %9
%18 = and i32 %17, 65535
%19 = add nsw i32 %18, 1
%20 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d, %d\00"
define void @i830_debug_yxminus1(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = lshr i32 %3, 16
%7 = add nuw nsw i32 %6, 1
%8 = and i32 %3, 65535
%9 = add nuw nsw i32 %8, 1
%10 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret void
}
int **foo() { return (int **)0; }


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

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

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

LLVM IR (-O2):
define noalias i32** @foo() {
ret i32** null
}
/* Variables and functions */
int /*<<< orphan*/ TIM17_ISR();
int /*<<< orphan*/ TIM1_TRG_COM_ISR();
void TIM1_TRG_COM_TIM17_ISR(void) {
  TIM1_TRG_COM_ISR();
  TIM17_ISR();
}


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

x86 assembly (clang, -O2):
<TIM1_TRG_COM_TIM17_ISR>:
push   %rax
xor    %eax,%eax
call   1030 <TIM1_TRG_COM_ISR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <TIM17_ISR@plt>

LLVM IR (-O0):
define void @TIM1_TRG_COM_TIM17_ISR() {
%1 = call i32 (...) @TIM1_TRG_COM_ISR()
%2 = call i32 (...) @TIM17_ISR()
ret void
}

LLVM IR (-O2):
define void @TIM1_TRG_COM_TIM17_ISR() {
%1 = tail call i32 (...) @TIM1_TRG_COM_ISR()
%2 = tail call i32 (...) @TIM17_ISR()
ret void
}
/* Type definitions */
struct vardef {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_variables(struct vardef *);
void free_var(struct vardef *v) { free_variables(v); }


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

x86 assembly (clang, -O2):
<free_var>:
jmp    1030 <free_variables@plt>

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

LLVM IR (-O2):
%struct.vardef = type { i32 }
define void @free_var(%struct.vardef* %0) {
%2 = tail call i32 @free_variables(%struct.vardef* %0)
ret void
}
/* Variables and functions */
int round(double const);
int gv_f2d(const double f) { return round(f / 2) * 2; }


x86 assembly (clang, -O0):
<gv_f2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <round@plt>
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gv_f2d>:
push   %rax
mulsd  0xee7(%rip),%xmm0
call   1030 <round@plt>
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gv_f2d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.000000e+00
%5 = call i32 @round(double %4)
%6 = mul nsw i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @gv_f2d(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = tail call i32 @round(double %2)
%4 = shl nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
int is_empty(const char *line) {
  while (*line) {
    if (!isspace((*line) & 0xFF))
      return 0;
    line++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <is_empty+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
movsbl %al,%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1152 <is_empty+0x42>
movl   $0x0,-0x4(%rbp)
jmp    116a <is_empty+0x5a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_empty+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_empty+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <is_empty+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_empty+0x20>
jmp    114b <is_empty+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_empty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ Read_Collision_DriverIRQHandler();
__attribute__((weak)) void Read_Collision_IRQHandler(void) {
  Read_Collision_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Read_Collision_IRQHandler() {
%1 = call i32 (...) @Read_Collision_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Read_Collision_IRQHandler() {
%1 = tail call i32 (...) @Read_Collision_DriverIRQHandler()
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int sweep_set_quaddobl_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 2;
  ptos[1] = 1;
  fail = _ada_use_c2phc4c(618, ptos, &n, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_set_quaddobl_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26a,%edi
lea    -0x4(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_set_quaddobl_target>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movabs $0x100000002,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_set_quaddobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 2, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 1, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc4c(i32 618, i32* %9, i32* %3, double* %10, i32 0)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_set_quaddobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 2, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 1, i32* %7
%8 = call i32 @_ada_use_c2phc4c(i32 618, i32* %6, i32* %3, double* %1, i32 0)
ret i32 %8
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int recvdata(int fd, char *buf, int maxlen) { return recv(fd, buf, maxlen, 0); }


x86 assembly (clang, -O0):
<recvdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recvdata>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @recvdata(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t SCB_GetFPUType(void) { return 0U; }


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

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

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

LLVM IR (-O2):
define i32 @SCB_GetFPUType() {
ret i32 0
}
void mspack_destroy_oab_compressor(struct msoab_compressor *self) {}


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

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

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

LLVM IR (-O2):
%struct.msoab_compressor = type opaque
define void @mspack_destroy_oab_compressor(%struct.msoab_compressor* nocapture %0) {
ret void
}
/* Type definitions */
struct inhalt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(struct inhalt *);
int /*<<< orphan*/ open(struct inhalt *, char *);
int /*<<< orphan*/ print_header(struct inhalt *, char *);
int /*<<< orphan*/ print_number(struct inhalt *);
int print_main(struct inhalt *data, char *name, char *string) {
  open(data, name);
  print_header(data, string);
  print_number(data);
  close(data);
  return 0;
}


x86 assembly (clang, -O0):
<print_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <open@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <print_header@plt>
mov    -0x8(%rbp),%rdi
call   1040 <print_number@plt>
mov    -0x8(%rbp),%rdi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_main>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1050 <open@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <print_header@plt>
mov    %rbx,%rdi
call   1040 <print_number@plt>
mov    %rbx,%rdi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.inhalt = type { i32 }
define i32 @print_main(%struct.inhalt* %0, i8* %1, i8* %2) {
%4 = alloca %struct.inhalt*
%5 = alloca i8*
%6 = alloca i8*
store %struct.inhalt* %0, %struct.inhalt** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.inhalt*, %struct.inhalt** %4
%8 = load i8*, i8** %5
%9 = call i32 @open(%struct.inhalt* %7, i8* %8)
%10 = load %struct.inhalt*, %struct.inhalt** %4
%11 = load i8*, i8** %6
%12 = call i32 @print_header(%struct.inhalt* %10, i8* %11)
%13 = load %struct.inhalt*, %struct.inhalt** %4
%14 = call i32 @print_number(%struct.inhalt* %13)
%15 = load %struct.inhalt*, %struct.inhalt** %4
%16 = call i32 @close(%struct.inhalt* %15)
ret i32 0
}

LLVM IR (-O2):
%struct.inhalt = type { i32 }
define i32 @print_main(%struct.inhalt* %0, i8* %1, i8* %2) {
%4 = tail call i32 @open(%struct.inhalt* %0, i8* %1)
%5 = tail call i32 @print_header(%struct.inhalt* %0, i8* %2)
%6 = tail call i32 @print_number(%struct.inhalt* %0)
%7 = tail call i32 @close(%struct.inhalt* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void walk(int *nums, int size) {
  int *limit = nums + size;
  for (; nums < limit;) {
    printf("%d ", *nums++);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<walk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1164 <walk+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1132 <walk+0x22>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<walk>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1155 <walk+0x35>
mov    %rdi,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%r15
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x4,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %r15,%rbx
jb     1140 <walk+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @walk(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
store i32* %9, i32** %5
br label %10
10: ; preds = %14, %2
%11 = load i32*, i32** %3
%12 = load i32*, i32** %5
%13 = icmp ult i32* %11, %12
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %3
%17 = load i32, i32* %15
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %10
19: ; preds = %10
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @walk(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = phi i32* [ %8, %6 ], [ %0, %2 ]
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %7
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp ult i32* %8, %4
br i1 %11, label %6, label %12
12: ; preds = %6, %2
%13 = tail call i32 @putchar(i32 10)
ret void
}
void TOSH_rfm_power_off(void) {}


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

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

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

LLVM IR (-O2):
define void @TOSH_rfm_power_off() {
ret void
}
double sub(double x) { return (x - .5) * (x - .25) * x * (x + .25) * (x + .5); }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee1(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xee8(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sub(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.000000e-01
%5 = load double, double* %2
%6 = fsub double %5, 2.500000e-01
%7 = fmul double %4, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = load double, double* %2
%11 = fadd double %10, 2.500000e-01
%12 = fmul double %9, %11
%13 = load double, double* %2
%14 = fadd double %13, 5.000000e-01
%15 = fmul double %12, %14
ret double %15
}

LLVM IR (-O2):
define double @sub(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = fadd double %0, -2.500000e-01
%4 = fmul double %2, %3
%5 = fmul double %4, %0
%6 = fadd double %0, 2.500000e-01
%7 = fmul double %6, %5
%8 = fadd double %0, 5.000000e-01
%9 = fmul double %8, %7
ret double %9
}
int test_imm_BFuint32_mem(unsigned int *val) {
  return ((*val) & (0xBF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BFuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 191
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ata_write_callback() {}


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

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

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

LLVM IR (-O2):
define void @ata_write_callback() {
ret void
}
long generic_pop_l(long a) { return __builtin_popcountl(a); }


x86 assembly (clang, -O0):
<generic_pop_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rcx,%rax
and    %rdx,%rax
shr    $0x2,%rcx
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_pop_l>:
mov    %rdi,%rax
shr    %rax
movabs $0x5555555555555555,%rcx
55 55 55
and    %rax,%rcx
sub    %rcx,%rdi
movabs $0x3333333333333333,%rax
33 33 33
mov    %rdi,%rcx
and    %rax,%rcx
shr    $0x2,%rdi
and    %rdi,%rax
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rax,%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rcx,%rdx
movabs $0x101010101010101,%rax
01 01 01
imul   %rdx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i64 @generic_pop_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctpop.i64(i64 %3)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @generic_pop_l(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ foobar(int);
void foo(void) {
  int i;
  for (i = 0; i < 100; i++) {
    foobar(i);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    113f <foo+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <foobar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <foobar@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <foo+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @foobar(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @foobar(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strcasecmp(char *, char *);
void strcasecmp_diff_length_1() {
  char *x = "abc";
  char *y = "aBdef";
  clang_analyzer_eval(strcasecmp(x, y) == -1);
}


x86 assembly (clang, -O0):
<strcasecmp_diff_length_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasecmp_diff_length_1>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [6 x i8] c"aBdef\00"
define void @strcasecmp_diff_length_1() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcasecmp(i8* %3, i8* %4)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [6 x i8] c"aBdef\00"
define void @strcasecmp_diff_length_1() {
%1 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ ASRT_Int(int, int);
int /*<<< orphan*/ ASRT_Mark(char *, int, char *);
int test_UIntOk() {
  do {
    ASRT_Mark("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/"
              "src/asrt_tests.c",
              215,
              "37"
              " == "
              "37");
    if (ASRT_Int(37, 37)) {
      return 1;
    };
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_UIntOk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0xd7,%esi
lea    0xf55(%rip),%rdx
call   1030 <ASRT_Mark@plt>
mov    $0x25,%esi
mov    %esi,%edi
call   1040 <ASRT_Int@plt>
cmp    $0x0,%rax
je     1162 <test_UIntOk+0x42>
movl   $0x1,-0x4(%rbp)
jmp    116e <test_UIntOk+0x4e>
jmp    1167 <test_UIntOk+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_UIntOk>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf61(%rip),%rdx
mov    $0xd7,%esi
call   1030 <ASRT_Mark@plt>
mov    $0x25,%edi
mov    $0x25,%esi
call   1040 <ASRT_Int@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [9 x i8] c"37 == 37\00"
define i32 @test_UIntOk() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 215, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = call i64 @ASRT_Int(i32 37, i32 37)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 1, i32* %1
br label %9
7: ; preds = %2
br label %8
8: ; preds = %7
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [9 x i8] c"37 == 37\00"
define i32 @test_UIntOk() {
%1 = tail call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 215, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @ASRT_Int(i32 37, i32 37)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ remove_filename(char *);
int main(void) {
  char url[] = "http://www.softis.com/start.htm";
  remove_filename(url);
  printf("%s\n", url);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <remove_filename@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <remove_filename@plt>
lea    0xed2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.url = [32 x i8] c"http://www.softis.com/start.htm\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
store i32 0, i32* %1
%3 = bitcast [32 x i8]* %2 to i8*
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @remove_filename(i8* %4)
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.url = [32 x i8] c"http://www.softis.com/start.htm\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @remove_filename(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int /*<<< orphan*/);
void C67_STB_PTR(int r, int r2) { C67_asm("STB.D *", r, r2, 0); }


x86 assembly (clang, -O0):
<C67_STB_PTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
xor    %ecx,%ecx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_STB_PTR>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"STB.D *\00"
define void @C67_STB_PTR(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 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"STB.D *\00"
define void @C67_STB_PTR(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t a52e_get_frmsiz(const uint8_t *p_a52) {
  return ((p_a52[2] & 0x7) << 8) | p_a52[3];
}


x86 assembly (clang, -O0):
<a52e_get_frmsiz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x7,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_get_frmsiz>:
mov    0x8(%rdi),%eax
and    $0x7,%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @a52e_get_frmsiz(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 7
%7 = shl i32 %6, 8
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 3
%10 = load i32, i32* %9
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @a52e_get_frmsiz(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 1792
%6 = getelementptr inbounds i32, i32* %0, i64 3
%7 = load i32, i32* %6
%8 = or i32 %5, %7
ret i32 %8
}
const char *sx_version(void) {
  return ("sx : V1.09 Peter Boesecke 2011-12-14");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"sx : V1.09 Peter Boesecke 2011-12-14\00"
define i8* @sx_version() {
ret i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [37 x i8] c"sx : V1.09 Peter Boesecke 2011-12-14\00"
define i8* @sx_version() {
ret i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0)
}
int calcGrid(int x, int y) { return 3 * (x / 3) + (y / 3); }


x86 assembly (clang, -O0):
<calcGrid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcGrid>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%ecx
movslq %esi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @calcGrid(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 = sdiv i32 %5, 3
%7 = mul nsw i32 3, %6
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 3
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @calcGrid(i32 %0, i32 %1) {
%3 = srem i32 %0, 3
%4 = sub i32 %0, %3
%5 = sdiv i32 %1, 3
%6 = add nsw i32 %4, %5
ret i32 %6
}