xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char *, char *);
int default_compare(void *a, void *b) { return strcmp((char *)a, (char *)b); }


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

x86 assembly (clang, -O2):
<default_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @default_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal(char *, int /*<<< orphan*/, int);
void *malloc(size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *emalloc(size_t n) {
  void *rv;
  if ((rv = malloc(n)) == NULL)
    fatal("malloc() failed: ", strerror(errno), 1);
  return rv;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1174 <emalloc+0x44>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x1,%edx
call   1050 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115f <emalloc+0x2f>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"malloc() failed: \00"
@errno = global i32 0
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @fatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %9, i32 1)
br label %11
11: ; preds = %7, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [18 x i8] c"malloc() failed: \00"
@errno = global i32 0
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6, i32 1)
br label %8
8: ; preds = %4, %1
ret i8* %2
}
int main() {
  int x = 1;
  while (1) {
    x += 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ reset_ebb_with_clear_mask(int);
void reset_ebb(void) { reset_ebb_with_clear_mask(0x00000080 | 0x80000000); }


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

x86 assembly (clang, -O2):
<reset_ebb>:
mov    $0x80000080,%edi
jmp    1030 <reset_ebb_with_clear_mask@plt>

LLVM IR (-O0):
define void @reset_ebb() {
%1 = call i32 @reset_ebb_with_clear_mask(i32 -2147483520)
ret void
}

LLVM IR (-O2):
define void @reset_ebb() {
%1 = tail call i32 @reset_ebb_with_clear_mask(i32 -2147483520)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
void Error(int errNo) {
  printf("syntax error:%d\n", errNo);
  system("pause");
  exit(1);
}


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
call   1030 <system@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Error>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <system@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"syntax error:%d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define void @Error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"syntax error:%d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define void @Error(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ msm_ois_i2c_read(unsigned short, unsigned int *, int);
void RamRead32(unsigned char RamAddrH, unsigned char RamAddrL,
               unsigned long *ReadData) {
  unsigned short reg_addr;
  unsigned int reg_data;
  reg_addr = (RamAddrH << 8) | RamAddrL;
  msm_ois_i2c_read(reg_addr, &reg_data, 4);
  *ReadData = reg_data;
}


x86 assembly (clang, -O0):
<RamRead32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0x12(%rbp)
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
movzwl -0x12(%rbp),%edi
call   1030 <msm_ois_i2c_read@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RamRead32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
shl    $0x8,%edi
or     %esi,%edi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <msm_ois_i2c_read@plt>
mov    0xc(%rsp),%eax
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @RamRead32(i8 zeroext %0, i8 zeroext %1, i64* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i64*
%7 = alloca i16
%8 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i64* %2, i64** %6
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i16
store i16 %15, i16* %7
%16 = load i16, i16* %7
%17 = call i32 @msm_ois_i2c_read(i16 zeroext %16, i32* %8, i32 4)
%18 = load i32, i32* %8
%19 = zext i32 %18 to i64
%20 = load i64*, i64** %6
store i64 %19, i64* %20
ret void
}

LLVM IR (-O2):
define void @RamRead32(i8 zeroext %0, i8 zeroext %1, i64* nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = zext i8 %0 to i16
%7 = shl nuw i16 %6, 8
%8 = zext i8 %1 to i16
%9 = or i16 %7, %8
%10 = call i32 @msm_ois_i2c_read(i16 zeroext %9, i32* %4, i32 4)
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
store i64 %12, i64* %2
ret void
}
long long zzuz() { return 0x000000007fff0000LL; }


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

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

LLVM IR (-O0):
define i64 @zzuz() {
ret i64 2147418112
}

LLVM IR (-O2):
define i64 @zzuz() {
ret i64 2147418112
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ unia_get_nextnumacpu(int);
int main(int argc, char **argv) {
  if (argc == 1) {
    unia_get_nextnumacpu(0);
    unia_get_nextnumacpu(1);
  } else {
    unia_get_nextnumacpu(atoi(argv[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)
cmpl   $0x1,-0x8(%rbp)
jne    1156 <main+0x36>
xor    %edi,%edi
call   1040 <unia_get_nextnumacpu@plt>
mov    $0x1,%edi
call   1040 <unia_get_nextnumacpu@plt>
jmp    116a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <unia_get_nextnumacpu@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1134 <main+0x14>
xor    %edi,%edi
call   1040 <unia_get_nextnumacpu@plt>
mov    $0x1,%edi
jmp    113f <main+0x1f>
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <unia_get_nextnumacpu@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 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @unia_get_nextnumacpu(i32 0)
%10 = call i32 @unia_get_nextnumacpu(i32 1)
br label %17
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
%16 = call i32 @unia_get_nextnumacpu(i32 %15)
br label %17
17: ; preds = %11, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @unia_get_nextnumacpu(i32 0)
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %9, %6 ], [ 1, %4 ]
%12 = tail call i32 @unia_get_nextnumacpu(i32 %11)
ret i32 0
}
/* Variables and functions */
unsigned char floorf(float);
unsigned char clamp_u8(float v) {
  if (v > 255.)
    return 255;
  else if (v < 0)
    return 0;
  else
    return floorf(v + .5);
}


x86 assembly (clang, -O0):
<clamp_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <clamp_u8+0x31>
movb   $0xff,-0x1(%rbp)
jmp    1178 <clamp_u8+0x68>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1157 <clamp_u8+0x47>
movb   $0x0,-0x1(%rbp)
jmp    1178 <clamp_u8+0x68>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <floorf@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_u8>:
mov    $0xff,%al
ucomiss 0xee7(%rip),%xmm0
ja     1125 <clamp_u8+0x15>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1126 <clamp_u8+0x16>
xor    %eax,%eax
ret
addss  0xed6(%rip),%xmm0
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define zeroext i8 @clamp_u8(float %0) {
%2 = alloca i8
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 2.550000e+02
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 -1, i8* %2
br label %18
8: ; preds = %1
%9 = load float, float* %3
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store i8 0, i8* %2
br label %18
12: ; preds = %8
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fadd double %14, 5.000000e-01
%16 = fptrunc double %15 to float
%17 = call zeroext i8 @floorf(float %16)
store i8 %17, i8* %2
br label %18
18: ; preds = %12, %11, %7
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @clamp_u8(float %0) {
%2 = fcmp ogt float %0, 2.550000e+02
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = fcmp olt float %0, 0.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fadd float %0, 5.000000e-01
%7 = tail call zeroext i8 @floorf(float %6)
br label %8
8: ; preds = %3, %1, %5
%9 = phi i8 [ %7, %5 ], [ -1, %1 ], [ 0, %3 ]
ret i8 %9
}
__attribute((pure, no, const)) void __xxx(void) {}


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

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

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

LLVM IR (-O2):
define void @__xxx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
nel() { esc("E"); }


x86 assembly (clang, -O0):
<nel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <esc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"E\00"
define i32 @nel() {
%1 = alloca i32
%2 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [2 x i8] c"E\00"
define i32 @nel() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int strcmp(char const *, char const *);
int mystrcmp(const void *s1, const void *s2) {
  return strcmp((const char *)s1, (const char *)s2);
}


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

x86 assembly (clang, -O2):
<mystrcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @mystrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void swap_short(a) unsigned short *a;
{
  union {
    unsigned short val;
    char bytes[2];
  } swapper;
  char tmp;
  swapper.val = *a;
  tmp = swapper.bytes[0];
  swapper.bytes[0] = swapper.bytes[1];
  swapper.bytes[1] = tmp;
  *a = swapper.val;
}


x86 assembly (clang, -O0):
<swap_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x10(%rbp)
mov    -0x10(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0x10(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x10(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_short>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
%union.anon = type { i16 }
define void @swap_short(i16* %0) {
%2 = alloca i16*
%3 = alloca %union.anon
%4 = alloca i8
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = load i16, i16* %5
%7 = bitcast %union.anon* %3 to i16*
store i16 %6, i16* %7
%8 = bitcast %union.anon* %3 to [2 x i8]*
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%10 = load i8, i8* %9
store i8 %10, i8* %4
%11 = bitcast %union.anon* %3 to [2 x i8]*
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 1
%13 = load i8, i8* %12
%14 = bitcast %union.anon* %3 to [2 x i8]*
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %14, i64 0, i64 0
store i8 %13, i8* %15
%16 = load i8, i8* %4
%17 = bitcast %union.anon* %3 to [2 x i8]*
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %17, i64 0, i64 1
store i8 %16, i8* %18
%19 = bitcast %union.anon* %3 to i16*
%20 = load i16, i16* %19
%21 = load i16*, i16** %2
store i16 %20, i16* %21
ret void
}

LLVM IR (-O2):
define void @swap_short(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
store i16 %3, i16* %0
ret void
}
int findNextMultiple(int num1, int num2) {
  int next_multiple = num1 + num2 - num1 % num2;
  return (next_multiple);
}


x86 assembly (clang, -O0):
<findNextMultiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNextMultiple>:
mov    %edi,%eax
lea    (%rsi,%rax,1),%ecx
cltd
idiv   %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @findNextMultiple(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 = add nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
%12 = sub nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @findNextMultiple(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = srem i32 %0, %1
%5 = sub i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int bbm_read(void *, unsigned short, unsigned char *);
int fc8150_bb_read(void *hDevice, unsigned short addr, unsigned char *data) {
  int res;
  res = bbm_read(hDevice, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<fc8150_bb_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
call   1030 <bbm_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8150_bb_read>:
jmp    1030 <bbm_read@plt>

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

LLVM IR (-O2):
define i32 @fc8150_bb_read(i8* %0, i16 zeroext %1, i8* %2) {
%4 = tail call i32 @bbm_read(i8* %0, i16 zeroext %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pic_send_EOI_normal(int /*<<< orphan*/);
void isr_irq_0() { pic_send_EOI_normal(0); }


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

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

LLVM IR (-O0):
define void @isr_irq_0() {
%1 = call i32 @pic_send_EOI_normal(i32 0)
ret void
}

LLVM IR (-O2):
define void @isr_irq_0() {
%1 = tail call i32 @pic_send_EOI_normal(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int main() {
  int x, y, i;
  x = 0;
  y = 0;
  for (i = 0; i < 10; i++) {
    x++;
    y++;
  }
  __CRAB_assert(x >= y);
  __CRAB_assert(y >= x);
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    115e <main+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <__CRAB_assert@plt>
mov    $0x1,%edi
call   1030 <__CRAB_assert@plt>
mov    $0x14,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__CRAB_assert(i32 1)
%2 = tail call i32 @__CRAB_assert(i32 1)
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ puts(char *);
void puthex(int value) {
  char buf[256];
  itoa(value, buf, 16);
  puts("0x");
  puts(buf);
}


x86 assembly (clang, -O0):
<puthex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x10,%edx
call   1040 <itoa@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    -0x110(%rbp),%rdi
call   1030 <puts@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puthex>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itoa@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"0x\00"
define void @puthex(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = call i32 @itoa(i32 %4, i8* %5, i32 16)
%7 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"0x\00"
define void @puthex(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @itoa(i32 %0, i8* %3, i32 16)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @puts(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printUsage(char *string) {
  printf("Usage: %s [Options] filename.mkv *.fits\n", string);
}


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

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

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

LLVM IR (-O2):
@.str = [41 x i8] c"Usage: %s [Options] filename.mkv *.fits\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test() {
  int i;
  {
    hash(1);
    hash(-1);
  };
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0xffffffff,%edi
pop    %rax
jmp    1030 <hash@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = call i32 @hash(i32 1)
%3 = call i32 @hash(i32 -1)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @hash(i32 1)
%2 = tail call i32 @hash(i32 -1)
ret void
}
float cubic_ease_out(float p) {
  float f = (p - 1.0f);
  return f * f * f + 1.0f;
}


x86 assembly (clang, -O0):
<cubic_ease_out>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec6(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_ease_out>:
addss  0xef8(%rip),%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
addss  0xee9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @cubic_ease_out(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float %4, 1.000000e+00
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = load float, float* %3
%10 = call float @llvm.fmuladd.f32(float %8, float %9, float 1.000000e+00)
ret float %10
}

LLVM IR (-O2):
define float @cubic_ease_out(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fmul float %2, %2
%4 = tail call float @llvm.fmuladd.f32(float %3, float %2, float 1.000000e+00)
ret float %4
}
/* Type definitions */
typedef scalar_t__ c;

/* Variables and functions */
scalar_t__ isalnum(unsigned char);
int is_alpha_num(unsigned char c) {
  if (isalnum(c))
    return 1;
  if (((c)&0x80))
    return 1;
  if (((c) && (c) < ' '))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_alpha_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     113d <is_alpha_num+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1188 <is_alpha_num+0x78>
movzbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     115b <is_alpha_num+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1188 <is_alpha_num+0x78>
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     1181 <is_alpha_num+0x71>
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jge    1181 <is_alpha_num+0x71>
movl   $0x1,-0x4(%rbp)
jmp    1188 <is_alpha_num+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha_num>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
test   %bl,%bl
sets   %cl
lea    -0x1(%rbx),%edx
cmp    $0x1f,%dl
setb   %dl
or     %al,%cl
or     %dl,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_alpha_num(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalnum(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %24
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = and i32 %10, 128
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %24
14: ; preds = %8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = icmp slt i32 %20, 32
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %2
br label %24
23: ; preds = %18, %14
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22, %13, %7
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_alpha_num(i8 zeroext %0) {
%2 = tail call i64 @isalnum(i8 zeroext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp slt i8 %0, 0
%5 = add i8 %0, -1
%6 = icmp ult i8 %5, 31
%7 = or i1 %4, %3
%8 = or i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int atoi(char *);
short int CShortChars(char *Sorc) {
  int ret = atoi(Sorc);
  return (short int)ret;
}


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

x86 assembly (clang, -O2):
<CShortChars>:
push   %rax
call   1030 <atoi@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @CShortChars(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @atoi(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @CShortChars(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = trunc i32 %2 to i16
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ solibfunction();
int main() {
  solibfunction();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @solibfunction()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @solibfunction()
ret i32 0
}
/* Type definitions */
typedef double int32_t;

/* Variables and functions */
float calculate(double, double, double, float, float, double, int);
float calculate_sunrise(int32_t year, int32_t month, int32_t day, float lat,
                        float lng, int32_t utc_offset) {
  return calculate(year, month, day, lat, lng, utc_offset / 4.0, 1);
}


x86 assembly (clang, -O0):
<calculate_sunrise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movss  %xmm3,-0x1c(%rbp)
movss  %xmm4,-0x20(%rbp)
movsd  %xmm5,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm3
movss  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  0xea4(%rip),%xmm6
divsd  %xmm6,%xmm5
mov    $0x1,%edi
call   1030 <calculate@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_sunrise>:
mulsd  0xee8(%rip),%xmm5
mov    $0x1,%edi
jmp    1030 <calculate@plt>

LLVM IR (-O0):
define float @calculate_sunrise(double %0, double %1, double %2, float %3, float %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca float
%11 = alloca float
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store float %3, float* %10
store float %4, float* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load float, float* %10
%17 = load float, float* %11
%18 = load double, double* %12
%19 = fdiv double %18, 4.000000e+00
%20 = call float @calculate(double %13, double %14, double %15, float %16, float %17, double %19, i32 1)
ret float %20
}

LLVM IR (-O2):
define float @calculate_sunrise(double %0, double %1, double %2, float %3, float %4, double %5) {
%7 = fmul double %5, 2.500000e-01
%8 = tail call float @calculate(double %0, double %1, double %2, float %3, float %4, double %7, i32 1)
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void XMLDB_Generate_Begin_Preformatted(FILE *dest_doc) {
  fprintf(dest_doc, "%s", "<literallayout class=\"monospaced\">\n");
}


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

x86 assembly (clang, -O2):
<XMLDB_Generate_Begin_Preformatted>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [36 x i8] c"<literallayout class=\22monospaced\22>\0A\00"
define void @XMLDB_Generate_Begin_Preformatted(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"<literallayout class=\22monospaced\22>\0A\00"
define void @XMLDB_Generate_Begin_Preformatted(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i64 35, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int fabs(double);
double E0F(void) { return (16 / 2) * (16 / 2) * fabs(0.5); }


x86 assembly (clang, -O0):
<E0F>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
call   1030 <fabs@plt>
shl    $0x6,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<E0F>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <fabs@plt>
shl    $0x6,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @E0F() {
%1 = call i32 @fabs(double 5.000000e-01)
%2 = mul nsw i32 64, %1
%3 = sitofp i32 %2 to double
ret double %3
}

LLVM IR (-O2):
define double @E0F() {
%1 = tail call i32 @fabs(double 5.000000e-01)
%2 = shl nsw i32 %1, 6
%3 = sitofp i32 %2 to double
ret double %3
}
int test_imm_B8int16_reg(short val) {
  return ((val) & (-0xB8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B8int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff48,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B8int16_reg>:
test   $0xff48,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B8int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -184
%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_B8int16_reg(i16 signext %0) {
%2 = and i16 %0, -184
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int fill_style;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
void set_XGCValues_fill_style(void *_p, int _v) {
  ((XGCValues *)_p)->fill_style = (int)_v;
}


x86 assembly (clang, -O0):
<set_XGCValues_fill_style>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XGCValues_fill_style>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGCValues_fill_style(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGCValues_fill_style(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *const);
void logDebug(const char *const msg) { printf("[DEBUG] %s\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"[DEBUG] %s\0A\00"
define void @logDebug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double umath_double_asin(double);
double umath_double_sqrt(double);
double umath_double_atan(double x) {
  return umath_double_asin(x / umath_double_sqrt((x * x) + 1.0));
}


x86 assembly (clang, -O0):
<umath_double_atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <umath_double_sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <umath_double_asin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umath_double_atan>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xece(%rip),%xmm0
call   1030 <umath_double_sqrt@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
jmp    1040 <umath_double_asin@plt>

LLVM IR (-O0):
define double @umath_double_atan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double 1.000000e+00)
%7 = call double @umath_double_sqrt(double %6)
%8 = fdiv double %3, %7
%9 = call double @umath_double_asin(double %8)
ret double %9
}

LLVM IR (-O2):
define double @umath_double_atan(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = tail call double @umath_double_sqrt(double %2)
%4 = fdiv double %0, %3
%5 = tail call double @umath_double_asin(double %4)
ret double %5
}
void anc_max14744_refresh_headset_type(int headset_type) { return; }


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

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

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

LLVM IR (-O2):
define void @anc_max14744_refresh_headset_type(i32 %0) {
ret void
}
copy(dest, src) register char *dest, *src;
{
  while ((*dest++ = *src++) != '\n')
    ;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0xa,%eax
je     113f <copy+0x3f>
jmp    110c <copy+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
cmp    $0xa,%cl
jne    1110 <copy+0x10>
ret

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

LLVM IR (-O2):
define i32 @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 10
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2_mul();
int /*<<< orphan*/ test3_div();
int /*<<< orphan*/ test4_add();
int /*<<< orphan*/ test5_sub();
int /*<<< orphan*/ test6();
int main() {
  test1();
  test2_mul();
  test3_div();
  test4_add();
  test5_sub();
  test6();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test1@plt>
mov    $0x0,%al
call   1050 <test2_mul@plt>
mov    $0x0,%al
call   1080 <test3_div@plt>
mov    $0x0,%al
call   1030 <test4_add@plt>
mov    $0x0,%al
call   1070 <test5_sub@plt>
mov    $0x0,%al
call   1060 <test6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1050 <test2_mul@plt>
xor    %eax,%eax
call   1080 <test3_div@plt>
xor    %eax,%eax
call   1030 <test4_add@plt>
xor    %eax,%eax
call   1070 <test5_sub@plt>
xor    %eax,%eax
call   1060 <test6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2_mul()
%4 = call i32 (...) @test3_div()
%5 = call i32 (...) @test4_add()
%6 = call i32 (...) @test5_sub()
%7 = call i32 (...) @test6()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2_mul()
%3 = tail call i32 (...) @test3_div()
%4 = tail call i32 (...) @test4_add()
%5 = tail call i32 (...) @test5_sub()
%6 = tail call i32 (...) @test6()
ret i32 0
}
/* Variables and functions */
int invert(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 0;
  int p = 7;
  int n = 4;
  printf("0x%x\n", invert(x, p, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <invert@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x7,%esi
mov    $0x4,%edx
call   1030 <invert@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 @invert(i32 0, i32 7, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_shufflehi_epi16(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_shufflelo_epi16(int /*<<< orphan*/, int);
__attribute__((always_)) __m128i rot16(__m128i x) {
  return _mm_shufflehi_epi16(_mm_shufflelo_epi16(x, 0xB1), 0xB1);
}


x86 assembly (clang, -O0):
<rot16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xb1,%esi
call   1030 <_mm_shufflelo_epi16@plt>
mov    %eax,%edi
mov    $0xb1,%esi
call   1040 <_mm_shufflehi_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot16>:
push   %rax
mov    $0xb1,%esi
call   1030 <_mm_shufflelo_epi16@plt>
mov    %eax,%edi
mov    $0xb1,%esi
pop    %rax
jmp    1040 <_mm_shufflehi_epi16@plt>

LLVM IR (-O0):
define i32 @rot16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm_shufflelo_epi16(i32 %3, i32 177)
%5 = call i32 @_mm_shufflehi_epi16(i32 %4, i32 177)
ret i32 %5
}

LLVM IR (-O2):
define i32 @rot16(i32 %0) {
%2 = tail call i32 @_mm_shufflelo_epi16(i32 %0, i32 177)
%3 = tail call i32 @_mm_shufflehi_epi16(i32 %2, i32 177)
ret i32 %3
}
void ASN1_UNIVERSALSTRING_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_UNIVERSALSTRING_new() {
ret void
}
int is_abspath(path) const char *path;
{ return (((path[0]) == '/')); }


x86 assembly (clang, -O0):
<is_abspath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_abspath>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_abspath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_abspath(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
int __attribute__((target("sse4.2"))) redecl1(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @redecl1() {
ret i32 1
}
char get_bit_val(unsigned val, unsigned pos) {
  return (val & ((unsigned)1 << pos)) != 0;
}


x86 assembly (clang, -O0):
<get_bit_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit_val>:
bt     %esi,%edi
setb   %al
ret

LLVM IR (-O0):
define signext i8 @get_bit_val(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @get_bit_val(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i8
ret i8 %6
}
char EsaDec(char numero) { return (numero >> 4) * 10 + (numero & 0x0F); }


x86 assembly (clang, -O0):
<EsaDec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%eax
movsbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @EsaDec(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = mul nsw i32 %5, 10
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = and i32 %8, 15
%10 = add nsw i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @EsaDec(i8 signext %0) {
%2 = ashr i8 %0, 4
%3 = mul nsw i8 %2, 10
%4 = and i8 %0, 15
%5 = add nsw i8 %3, %4
ret i8 %5
}
void __CUT_BRINGUP__arr() {}


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

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

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

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