xunge/DecIR huggingface dataset:
/* Variables and functions */
int f328(int *);
int f329(int *p) { return f328(p); }


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

x86 assembly (clang, -O2):
<f329>:
jmp    1030 <f328@plt>

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

LLVM IR (-O2):
define i32 @f329(i32* %0) {
%2 = tail call i32 @f328(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t endianSwap32(uint32_t value) {
  return ((value & 0x000000ff) << 24) | ((value & 0x0000ff00) << 8) |
         ((value & 0x00ff0000) >> 8) | ((value & 0xff000000) >> 24);
}


x86 assembly (clang, -O0):
<endianSwap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endianSwap32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @endianSwap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @endianSwap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void terminate(int param) {
  printf("Illegal characters in input file\nPlease remove those before trying "
         "again\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [74 x i8] c"Illegal characters in input file\0APlease remove those before trying again\0A\00"
@EXIT_FAILURE = global i32 0
define void @terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [73 x i8] c"Illegal characters in input file\0APlease remove those before trying again\00"
define void @terminate(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
__attribute__((always_, pure)) int bigint_is_zero_raw(const uint64_t *value0,
                                                      unsigned int size) {
  const uint64_t *value = value0;
  uint64_t value_i;
  do {
    value_i = *(value++);
    if (value_i)
      break;
  } while (--size);
  return (value_i == 0);
}


x86 assembly (clang, -O0):
<bigint_is_zero_raw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1139 <bigint_is_zero_raw+0x39>
jmp    1150 <bigint_is_zero_raw+0x50>
jmp    113e <bigint_is_zero_raw+0x3e>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    1113 <bigint_is_zero_raw+0x13>
cmpq   $0x0,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigint_is_zero_raw>:
add    $0xffffffff,%esi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rdi,%rax,8),%rcx
test   %rcx,%rcx
jne    1124 <bigint_is_zero_raw+0x24>
lea    0x1(%rax),%rdx
cmp    %eax,%esi
mov    %rdx,%rax
jne    1110 <bigint_is_zero_raw+0x10>
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @bigint_is_zero_raw(i64* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64* [ %0, %2 ], [ %8, %3 ]
%5 = phi i32 [ %1, %2 ], [ %9, %3 ]
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
%8 = getelementptr inbounds i64, i64* %4, i64 1
%9 = add i32 %5, -1
%10 = icmp eq i32 %9, 0
%11 = select i1 %7, i1 true, i1 %10
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = icmp eq i64 %6, 0
%14 = zext i1 %13 to i32
ret i32 %14
}
void BN_bn2hex(void) {}


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

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

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

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


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

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

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

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

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t fread_s(void *buffer, size_t bufferSize, size_t elementSize,
               size_t count, FILE *stream) {
  return fread(buffer, elementSize, count, stream);
}


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

x86 assembly (clang, -O2):
<fread_s>:
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i64 @fread_s(i8* %0, i64 %1, i64 %2, i64 %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %8
%13 = load i64, i64* %9
%14 = load i32*, i32** %10
%15 = call i64 @fread(i8* %11, i64 %12, i64 %13, i32* %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @fread_s(i8* nocapture %0, i64 %1, i64 %2, i64 %3, i32* nocapture %4) {
%6 = tail call i64 @fread(i8* %0, i64 %2, i64 %3, i32* %4)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ testFunc(char **);
int main(int argc, char **argv) {
  testFunc(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    -0x10(%rbp),%rdi
call   1030 <testFunc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @testFunc(i8** %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int ph_ftp_handle_packet(void *handler, const char *packet, ssize_t len) {
  return 0;
}


x86 assembly (clang, -O0):
<ph_ftp_handle_packet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ph_ftp_handle_packet(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @ph_ftp_handle_packet(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
void _x86_cpuid(int op, int *a, int *b, int *c, int *d) {
  asm volatile("pushq %%rbx      \n\t"
               "cpuid            \n\t"
               "movl %%ebx, %1   \n\t"
               "popq %%rbx       \n\t"
               : "=a"(*a), "=r"(*b), "=c"(*c), "=d"(*d)
               : "a"(op)
               : "cc");
}


x86 assembly (clang, -O0):
<_x86_cpuid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
push   %rbx
cpuid
mov    %ebx,%r8d
pop    %rbx
mov    %eax,%r10d
mov    -0x38(%rbp),%rax
mov    %ecx,%esi
mov    -0x30(%rbp),%rcx
mov    %r10d,(%r9)
mov    %r8d,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_x86_cpuid>:
mov    %rcx,%r9
mov    %rdx,%r10
mov    %edi,%eax
push   %rbx
cpuid
mov    %ebx,%edi
pop    %rbx
mov    %eax,(%rsi)
mov    %edi,(%r10)
mov    %ecx,(%r9)
mov    %edx,(%r8)
ret

LLVM IR (-O0):
define void @_x86_cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32, i32* %6
%16 = call { i32, i32, i32, i32 } asm sideeffect "pushq %rbx \0A\09cpuid \0A\09movl %ebx, $1 \0A\09popq %rbx \0A\09", "={ax},=r,={cx},={dx},{ax},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %15)
%17 = extractvalue { i32, i32, i32, i32 } %16, 0
%18 = extractvalue { i32, i32, i32, i32 } %16, 1
%19 = extractvalue { i32, i32, i32, i32 } %16, 2
%20 = extractvalue { i32, i32, i32, i32 } %16, 3
store i32 %17, i32* %11
store i32 %18, i32* %12
store i32 %19, i32* %13
store i32 %20, i32* %14
ret void
}

LLVM IR (-O2):
define void @_x86_cpuid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "pushq %rbx \0A\09cpuid \0A\09movl %ebx, $1 \0A\09popq %rbx \0A\09", "={ax},=r,={cx},={dx},{ax},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
ret void
}
/* Type definitions */
typedef long long *__m128;

/* Variables and functions */
long long __attribute__((__always___, __nodebug__)) _mm_cvttss_si64(__m128 a) {
  return a[0];
}


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

x86 assembly (clang, -O2):
<_mm_cvttss_si64>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @_mm_cvttss_si64(i64* nocapture %0) {
%2 = load i64, i64* %0
ret i64 %2
}
float myabs(x)
float x;
{
  if (x < 0)
    return (-1.0 * x);
  else
    return (x);
}


x86 assembly (clang, -O0):
<myabs>:
push   %rbp
mov    %rsp,%rbp
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    113d <myabs+0x3d>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1147 <myabs+0x47>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<myabs>:
cvtsd2ss %xmm0,%xmm1
movaps 0xef5(%rip),%xmm2
xorps  %xmm1,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm1,%xmm0
cmpltss %xmm3,%xmm0
andps  %xmm0,%xmm2
andnps %xmm1,%xmm0
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @myabs(double %0) {
%2 = alloca float
%3 = alloca float
%4 = fptrunc double %0 to float
store float %4, float* %3
%5 = load float, float* %3
%6 = fcmp olt float %5, 0.000000e+00
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fmul double -1.000000e+00, %9
%11 = fptrunc double %10 to float
store float %11, float* %2
br label %14
12: ; preds = %1
%13 = load float, float* %3
store float %13, float* %2
br label %14
14: ; preds = %12, %7
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @myabs(double %0) {
%2 = fptrunc double %0 to float
%3 = fcmp olt float %2, 0.000000e+00
%4 = fneg float %2
%5 = select i1 %3, float %4, float %2
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int);
uint32_t charhex_to_uint32(char *buff) {
  return (uint32_t)strtoul(buff, NULL, 16);
}


x86 assembly (clang, -O0):
<charhex_to_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtoul@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charhex_to_uint32>:
xor    %esi,%esi
mov    $0x10,%edx
jmp    1030 <strtoul@plt>

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

LLVM IR (-O2):
define i32 @charhex_to_uint32(i8* nocapture %0) {
%2 = tail call i32 @strtoul(i8* nocapture %0, i32* null, i32 16)
ret i32 %2
}
int Snack_CanDispense(int unused__User __attribute__((__unused__)), int Item) {
  if (Item < 0 || Item > 99)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<Snack_CanDispense>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     111e <Snack_CanDispense+0x1e>
cmpl   $0x63,-0xc(%rbp)
jle    112a <Snack_CanDispense+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1131 <Snack_CanDispense+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Snack_CanDispense>:
xor    %eax,%eax
cmp    $0x64,%esi
adc    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @Snack_CanDispense(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 99
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %13
12: ; preds = %8
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @Snack_CanDispense(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 99
%4 = sext i1 %3 to i32
ret i32 %4
}
foo() {
  int x = 1;
label:
  x = 2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ testcircle();
int /*<<< orphan*/ teststar();
void testboth() {
  teststar();
  testcircle();
}


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

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

LLVM IR (-O0):
define void @testboth() {
%1 = call i32 (...) @teststar()
%2 = call i32 (...) @testcircle()
ret void
}

LLVM IR (-O2):
define void @testboth() {
%1 = tail call i32 (...) @teststar()
%2 = tail call i32 (...) @testcircle()
ret void
}
void waitForVBlank() {
  while (*(volatile unsigned short *)0x4000006 > 160)
    ;
  while (*(volatile unsigned short *)0x4000006 < 160)
    ;
}


x86 assembly (clang, -O0):
<waitForVBlank>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <waitForVBlank+0x9>
mov    $0x4000006,%eax
mov    (%rax),%ax
movzwl %ax,%eax
cmp    $0xa0,%eax
jle    1124 <waitForVBlank+0x24>
jmp    1109 <waitForVBlank+0x9>
jmp    1129 <waitForVBlank+0x29>
mov    $0x4000006,%eax
mov    (%rax),%ax
movzwl %ax,%eax
cmp    $0xa0,%eax
jge    1144 <waitForVBlank+0x44>
jmp    1129 <waitForVBlank+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForVBlank>:
movzwl 0x4000006,%eax
04
cmp    $0xa0,%eax
ja     1100 <waitForVBlank>
nop
movzwl 0x4000006,%eax
04
cmp    $0xa0,%eax
jb     1110 <waitForVBlank+0x10>
ret

LLVM IR (-O0):
define void @waitForVBlank() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i16, i16* inttoptr (i64 67108870 to i16*)
%3 = zext i16 %2 to i32
%4 = icmp sgt i32 %3, 160
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
br label %7
7: ; preds = %11, %6
%8 = load volatile i16, i16* inttoptr (i64 67108870 to i16*)
%9 = zext i16 %8 to i32
%10 = icmp slt i32 %9, 160
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @waitForVBlank() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i16, i16* inttoptr (i64 67108870 to i16*)
%3 = icmp ugt i16 %2, 160
br i1 %3, label %1, label %4
4: ; preds = %1, %4
%5 = load volatile i16, i16* inttoptr (i64 67108870 to i16*)
%6 = icmp ult i16 %5, 160
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printa(int **, int, int, int, int /*<<< orphan*/);
int main() {
  int a[5][5] = {{0, 0, 2, 1, 1},
                 {1, 0, 2, 0, 0},
                 {1, 0, 0, 0, 2},
                 {1, 0, 2, 0, 2},
                 {1, 0, 0, 0, 1}};
  printa(a, 1, 1, 5, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x64,%edx
call   1030 <memcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x1,%edx
mov    $0x5,%ecx
xor    %r8d,%r8d
mov    %edx,%esi
call   1040 <printa@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
mov    0xf46(%rip),%eax
mov    %eax,0x60(%rsp)
movaps 0xf2b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9f(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1030 <printa@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x [5 x i32]] [[5 x i32] [i32 0, i32 0, i32 2, i32 1, i32 1], [5 x i32] [i32 1, i32 0, i32 2, i32 0, i32 0], [5 x i32] [i32 1, i32 0, i32 0, i32 0, i32 2], [5 x i32] [i32 1, i32 0, i32 2, i32 0, i32 2], [5 x i32] [i32 1, i32 0, i32 0, i32 0, i32 1]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i32]]
store i32 0, i32* %1
%3 = bitcast [5 x [5 x i32]]* %2 to i8*
%4 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%5 = bitcast [5 x i32]* %4 to i32**
%6 = call i32 @printa(i32** %5, i32 1, i32 1, i32 5, i32 0)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x [5 x i32]] [[5 x i32] [i32 0, i32 0, i32 2, i32 1, i32 1], [5 x i32] [i32 1, i32 0, i32 2, i32 0, i32 0], [5 x i32] [i32 1, i32 0, i32 0, i32 0, i32 2], [5 x i32] [i32 1, i32 0, i32 2, i32 0, i32 2], [5 x i32] [i32 1, i32 0, i32 0, i32 0, i32 1]]
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = bitcast [5 x [5 x i32]]* %1 to i8*
%3 = bitcast [5 x [5 x i32]]* %1 to i32**
%4 = call i32 @printa(i32** %3, i32 1, i32 1, i32 5, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _OS_POP();
void _OS_ReturnNoSave(void) { _OS_POP(); }


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

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

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

LLVM IR (-O2):
define void @_OS_ReturnNoSave() {
%1 = tail call i32 (...) @_OS_POP()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _void() { printf("called _void() from extension\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"called _void() from extension\0A\00"
define void @_void() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"called _void() from extension\00"
define void @_void() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
char is_conmutative(char fcode) {
  if (fcode == 0x20 || fcode == 0x18 || fcode == 0x25 || fcode == 0x26 ||
      fcode == 0x24) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_conmutative>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
je     114b <is_conmutative+0x4b>
movsbl -0x2(%rbp),%eax
cmp    $0x18,%eax
je     114b <is_conmutative+0x4b>
movsbl -0x2(%rbp),%eax
cmp    $0x25,%eax
je     114b <is_conmutative+0x4b>
movsbl -0x2(%rbp),%eax
cmp    $0x26,%eax
je     114b <is_conmutative+0x4b>
movsbl -0x2(%rbp),%eax
cmp    $0x24,%eax
jne    1154 <is_conmutative+0x54>
movb   $0x1,-0x1(%rbp)
jmp    1158 <is_conmutative+0x58>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_conmutative>:
cmp    $0x26,%dil
ja     111d <is_conmutative+0x1d>
mov    $0x1,%al
movzbl %dil,%ecx
movabs $0x7101000000,%rdx
bt     %rcx,%rdx
jae    111d <is_conmutative+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @is_conmutative(i8 signext %0) {
switch i8 %0, label %2 [
i8 38, label %3
i8 37, label %3
i8 36, label %3
i8 32, label %3
i8 24, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i8 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int vuln() {
  char command[64];
  puts("PLEASE STATE YOUR COMMAND.");
  printf("Your response? ");
  gets(command);
}


x86 assembly (clang, -O0):
<vuln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <gets@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vuln>:
sub    $0x48,%rsp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rdi
call   1050 <gets@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"PLEASE STATE YOUR COMMAND.\00"
@.str.1 = [16 x i8] c"Your response? \00"
define i32 @vuln() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [27 x i8] c"PLEASE STATE YOUR COMMAND.\00"
@.str.1 = [16 x i8] c"Your response? \00"
define i32 @vuln() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @gets(i8* %2)
ret i32 undef
}
char GetEncoding7() { return 0x41; }


x86 assembly (clang, -O0):
<GetEncoding7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEncoding7>:
mov    $0x41,%al
ret

LLVM IR (-O0):
define signext i8 @GetEncoding7() {
ret i8 65
}

LLVM IR (-O2):
define signext i8 @GetEncoding7() {
ret i8 65
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ scroll_message(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int print_date() {
  char chr_time[256];
  time_t mytime;
  mytime = time(NULL);
  sprintf(chr_time, "%s", ctime(&mytime));
  scroll_message(chr_time, 133);
}


x86 assembly (clang, -O0):
<print_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x114(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x120(%rbp)
lea    -0x114(%rbp),%rdi
call   1030 <ctime@plt>
mov    -0x120(%rbp),%rdi
mov    %rax,%rdx
lea    0xe7b(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x85,%esi
call   1050 <scroll_message@plt>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_date>:
push   %rbx
sub    $0x110,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <ctime@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x85,%esi
call   1060 <scroll_message@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @print_date() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = call i8* @ctime(i32* %3)
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%9 = call i32 @scroll_message(i8* %8, i32 133)
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @print_date() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = call i8* @ctime(i32* %2)
%7 = call i8* @strcpy(i8* %3, i8* dereferenceable(1) %6)
%8 = call i32 @scroll_message(i8* %3, i32 133)
ret i32 undef
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ my_exit(int, char *);
void vecalloc(double **vec, int n) {
  if ((*vec = (double *)calloc(n + 1, sizeof(double))) != NULL) {
    **vec = n;
    return;
  } else
    my_exit(3, "vecalloc");
}


x86 assembly (clang, -O0):
<vecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     1165 <vecalloc+0x45>
cvtsi2sdl -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax)
jmp    1176 <vecalloc+0x56>
mov    $0x3,%edi
lea    0xe8f(%rip),%rsi
call   1030 <my_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecalloc>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x1(%rbx),%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     114e <vecalloc+0x2e>
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xeab(%rip),%rsi
mov    $0x3,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <my_exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"vecalloc\00"
define void @vecalloc(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
store double** %0, double*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
%7 = call i64 @calloc(i32 %6, i32 8)
%8 = inttoptr i64 %7 to double*
%9 = load double**, double*** %3
store double* %8, double** %9
%10 = icmp ne double* %8, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = load double**, double*** %3
%15 = load double*, double** %14
store double %13, double* %15
br label %18
16: ; preds = %2
%17 = call i32 @my_exit(i32 3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %11, %16
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"vecalloc\00"
define void @vecalloc(double** nocapture writeonly %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @calloc(i32 %3, i32 8)
%5 = inttoptr i64 %4 to double*
store double* %5, double** %0
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = sitofp i32 %1 to double
store double %8, double* %5
br label %11
9: ; preds = %2
%10 = tail call i32 @my_exit(i32 3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %7, %9
ret void
}
void mbc_mbc5_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @mbc_mbc5_cleanup() {
ret void
}
/* Variables and functions */
double log10(double);
double flux_to_absmag(double flux) { return -2.5 * log10(flux); }


x86 assembly (clang, -O0):
<flux_to_absmag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flux_to_absmag>:
push   %rax
call   1030 <log10@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @flux_to_absmag(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10(double %3)
%5 = fmul double -2.500000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @flux_to_absmag(double %0) {
%2 = tail call double @log10(double %0)
%3 = fmul double %2, -2.500000e+00
ret double %3
}
int main1() {
  int *arr1 = (int *)0x02000000;
  *(arr1 + 1) = 0;
  for (int i = 0; i < 10; i++) {
    *(arr1 + 1) += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1144 <main1+0x44>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <main1+0x1f>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main1>:
movl   $0xa,0x2000004
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main1() {
store i32 10, i32* inttoptr (i64 33554436 to i32*)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int fcntl(int, int /*<<< orphan*/, int);
int restore_flags(int fd, int flags) { return fcntl(fd, F_SETFL, flags); }


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

x86 assembly (clang, -O2):
<restore_flags>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
define i32 @restore_flags(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* @F_SETFL
%7 = load i32, i32* %4
%8 = call i32 @fcntl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@F_SETFL = global i32 0
define i32 @restore_flags(i32 %0, i32 %1) {
%3 = load i32, i32* @F_SETFL
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
int test_imm_E8uint32_reg(unsigned int val) {
  return ((val) & (0xE8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E8uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E8uint32_reg(i32 %0) {
%2 = and i32 %0, 232
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int hex2int(char);
int get_hex8(char *txt) {
  int val, val2;
  val = hex2int(txt[0]);
  val2 = hex2int(txt[1]);
  if (val < 0 || val2 < 0)
    return -1;
  return (val * 16 + val2) & 0xff;
}


x86 assembly (clang, -O0):
<get_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <hex2int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <hex2int@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     114f <get_hex8+0x3f>
cmpl   $0x0,-0x18(%rbp)
jge    115b <get_hex8+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <get_hex8+0x5c>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
add    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hex8>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <hex2int@plt>
mov    %eax,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <hex2int@plt>
mov    %ebp,%ecx
shl    $0x4,%ecx
add    %eax,%ecx
movzbl %cl,%ecx
or     %eax,%ebp
mov    $0xffffffff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_hex8(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = call i32 @hex2int(i8 signext %8)
store i32 %9, i32* %4
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = call i32 @hex2int(i8 signext %12)
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %1
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16, %1
store i32 -1, i32* %2
br label %26
20: ; preds = %16
%21 = load i32, i32* %4
%22 = mul nsw i32 %21, 16
%23 = load i32, i32* %5
%24 = add nsw i32 %22, %23
%25 = and i32 %24, 255
store i32 %25, i32* %2
br label %26
26: ; preds = %20, %19
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @get_hex8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @hex2int(i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @hex2int(i8 signext %5)
%7 = icmp slt i32 %3, 0
%8 = icmp slt i32 %6, 0
%9 = select i1 %7, i1 true, i1 %8
%10 = shl nsw i32 %3, 4
%11 = add nsw i32 %6, %10
%12 = and i32 %11, 255
%13 = select i1 %9, i32 -1, i32 %12
ret i32 %13
}
/* Type definitions */
typedef unsigned char ch;

/* Variables and functions */
int /*<<< orphan*/ USARTPutc(unsigned char);
void putcdec(unsigned char ch) {
  USARTPutc((ch / 100) + '0');
  ch %= 100;
  USARTPutc((ch / 10) + '0');
  ch %= 10;
  USARTPutc((ch) + '0');
}


x86 assembly (clang, -O0):
<putcdec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
movzbl %al,%edi
call   1030 <USARTPutc@plt>
movzbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
movzbl %al,%edi
call   1030 <USARTPutc@plt>
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x30,%eax
movzbl %al,%edi
call   1030 <USARTPutc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putcdec>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    (%rbx,%rbx,4),%eax
lea    (%rbx,%rax,8),%ebp
shr    $0xc,%ebp
mov    %ebp,%eax
or     $0x30,%al
movzbl %al,%edi
call   1030 <USARTPutc@plt>
imul   $0x64,%ebp,%eax
sub    %al,%bl
movzbl %bl,%ebx
imul   $0xcd,%ebx,%ebp
shr    $0xb,%ebp
mov    %ebp,%eax
or     $0x30,%al
movzbl %al,%edi
call   1030 <USARTPutc@plt>
add    %ebp,%ebp
lea    0x0(%rbp,%rbp,4),%eax
sub    %al,%bl
or     $0x30,%bl
movzbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <USARTPutc@plt>

LLVM IR (-O0):
define void @putcdec(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = add nsw i32 %5, 48
%7 = trunc i32 %6 to i8
%8 = call i32 @USARTPutc(i8 zeroext %7)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = srem i32 %10, 100
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = sdiv i32 %14, 10
%16 = add nsw i32 %15, 48
%17 = trunc i32 %16 to i8
%18 = call i32 @USARTPutc(i8 zeroext %17)
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = srem i32 %20, 10
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = add nsw i32 %24, 48
%26 = trunc i32 %25 to i8
%27 = call i32 @USARTPutc(i8 zeroext %26)
ret void
}

LLVM IR (-O2):
define void @putcdec(i8 zeroext %0) {
%2 = udiv i8 %0, 100
%3 = or i8 %2, 48
%4 = tail call i32 @USARTPutc(i8 zeroext %3)
%5 = urem i8 %0, 100
%6 = udiv i8 %5, 10
%7 = or i8 %6, 48
%8 = tail call i32 @USARTPutc(i8 zeroext %7)
%9 = urem i8 %5, 10
%10 = or i8 %9, 48
%11 = tail call i32 @USARTPutc(i8 zeroext %10)
ret void
}
int sizetoalloc(int len) {
  int size = 1;
  while (size <= len + 1)
    size *= 2;
  return size;
}


x86 assembly (clang, -O0):
<sizetoalloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     112d <sizetoalloc+0x2d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <sizetoalloc+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizetoalloc>:
add    $0x1,%edi
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jle    1110 <sizetoalloc+0x10>
ret

LLVM IR (-O0):
define i32 @sizetoalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = icmp sle i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 2
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @sizetoalloc(i32 %0) {
%2 = add nsw i32 %0, 1
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 1, %1 ], [ %6, %3 ]
%5 = icmp sgt i32 %4, %2
%6 = shl nsw i32 %4, 1
br i1 %5, label %7, label %3
7: ; preds = %3
ret i32 %4
}
void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @iio_device_unregister_trigger_consumer(%struct.iio_dev* nocapture %0) {
ret void
}
float umrechnung_durchschnittsverbrauch(float durchschnittsverbrauch) {
  const float umrechnungsfaktor = 235.2146;
  float umgerechneter_durchschnittsverbrauch = 0.0;
  umgerechneter_durchschnittsverbrauch =
      umrechnungsfaktor / durchschnittsverbrauch;
  return umgerechneter_durchschnittsverbrauch;
}


x86 assembly (clang, -O0):
<umrechnung_durchschnittsverbrauch>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeda(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<umrechnung_durchschnittsverbrauch>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @umrechnung_durchschnittsverbrauch(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
store float 0x406D66DE00000000, float* %3
store float 0.000000e+00, float* %4
%5 = load float, float* %2
%6 = fdiv float 0x406D66DE00000000, %5
store float %6, float* %4
%7 = load float, float* %4
ret float %7
}

LLVM IR (-O2):
define float @umrechnung_durchschnittsverbrauch(float %0) {
%2 = fdiv float 0x406D66DE00000000, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ remove_node_link(int, int);
void remove_link(int n0, int n1) {
  remove_node_link(n0, n1);
  remove_node_link(n1, n0);
}


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

x86 assembly (clang, -O2):
<remove_link>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <remove_node_link@plt>
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <remove_node_link@plt>

LLVM IR (-O0):
define void @remove_link(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 @remove_node_link(i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @remove_node_link(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @remove_link(i32 %0, i32 %1) {
%3 = tail call i32 @remove_node_link(i32 %0, i32 %1)
%4 = tail call i32 @remove_node_link(i32 %1, i32 %0)
ret void
}
/* Variables and functions */
float atanhf(float);
float coshf(float);
float __attribute__((no)) coshatanhf_(float x) {
  float atg = atanhf(x);
  return coshf(atg) + atg;
}


x86 assembly (clang, -O0):
<coshatanhf_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <atanhf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <coshf@plt>
addss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coshatanhf_>:
push   %rax
call   1040 <atanhf@plt>
movss  %xmm0,0x4(%rsp)
call   1030 <coshf@plt>
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @coshatanhf_(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @atanhf(float %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = call float @coshf(float %6)
%8 = load float, float* %3
%9 = fadd float %7, %8
ret float %9
}

LLVM IR (-O2):
define float @coshatanhf_(float %0) {
%2 = tail call float @atanhf(float %0)
%3 = tail call float @coshf(float %2)
%4 = fadd float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *a = "Hello World!";
  printf("%s", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef5(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}