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

/* Variables and functions */
int spi_disable_blockprotect_generic(struct flashrom_flashctx *, int, int,
                                     int /*<<< orphan*/, int);
int spi_disable_blockprotect_bp2_srwd(struct flashrom_flashctx *flash) {
  return spi_disable_blockprotect_generic(flash, 0x1C, 1 << 7, 0, 0xFF);
}


x86 assembly (clang, -O0):
<spi_disable_blockprotect_bp2_srwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
call   1030 <spi_disable_blockprotect_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_disable_blockprotect_bp2_srwd>:
mov    $0x1c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
jmp    1030 <spi_disable_blockprotect_generic@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_disable_blockprotect_bp2_srwd(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @spi_disable_blockprotect_generic(%struct.flashrom_flashctx* %3, i32 28, i32 128, i32 0, i32 255)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_disable_blockprotect_bp2_srwd(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @spi_disable_blockprotect_generic(%struct.flashrom_flashctx* %0, i32 28, i32 128, i32 0, i32 255)
ret i32 %2
}
/* Variables and functions */
double fast_expf(float);
float fast_logisticf(float x) { return 1.0 / (1.0 + fast_expf(-x)); }


x86 assembly (clang, -O0):
<fast_logisticf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <fast_expf@plt>
movsd  0xec4(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_logisticf>:
push   %rax
xorpd  0xee7(%rip),%xmm0
call   1030 <fast_expf@plt>
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fast_logisticf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call double @fast_expf(float %4)
%6 = fadd double 1.000000e+00, %5
%7 = fdiv double 1.000000e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @fast_logisticf(float %0) {
%2 = fneg float %0
%3 = tail call double @fast_expf(float %2)
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void debug_stream_setup(uint16_t port) {}


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

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

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

LLVM IR (-O2):
define void @debug_stream_setup(i32 %0) {
ret void
}
signed long signedlong_ignoring_signedint(signed long x, signed int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @signedlong_ignoring_signedint(i64 returned %0, i32 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
int foo(void *a, void *b, unsigned int c) {
  if (c == 0)
    return 1;
  memcpy(a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1139 <foo+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1150 <foo+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edx,%edx
je     1121 <foo+0x11>
push   %rax
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ 0, %5 ], [ 1, %3 ]
ret i32 %8
}
unsigned short read_cs() {
  unsigned short r;
  asm volatile("mov %%cs, %0" : "=r"(r));
  return r;
}


x86 assembly (clang, -O0):
<read_cs>:
push   %rbp
mov    %rsp,%rbp
mov    %cs,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cs>:
mov    %cs,%ax
ret

LLVM IR (-O0):
define zeroext i16 @read_cs() {
%1 = alloca i16
%2 = call i16 asm sideeffect "mov %cs, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i16 %2, i16* %1
%3 = load i16, i16* %1
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @read_cs() {
%1 = tail call i16 asm sideeffect "mov %cs, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i16 %1
}
/* Variables and functions */
int /*<<< orphan*/ detect_cachesz(double, int /*<<< orphan*/);
int main(void) {
  detect_cachesz(0.0, 0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @detect_cachesz(double 0.000000e+00, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @detect_cachesz(double 0.000000e+00, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ backup_sync_msg(int, int /*<<< orphan*/);
void Backup_sync_all() { backup_sync_msg(15, 0); }


x86 assembly (clang, -O0):
<Backup_sync_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <backup_sync_msg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Backup_sync_all>:
mov    $0xf,%edi
xor    %esi,%esi
jmp    1030 <backup_sync_msg@plt>

LLVM IR (-O0):
define void @Backup_sync_all() {
%1 = call i32 @backup_sync_msg(i32 15, i32 0)
ret void
}

LLVM IR (-O2):
define void @Backup_sync_all() {
%1 = tail call i32 @backup_sync_msg(i32 15, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_members();
int /*<<< orphan*/ init_structs();
void init_all() {
  int ii;
  init_structs();
  init_members();
}


x86 assembly (clang, -O0):
<init_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <init_structs@plt>
mov    $0x0,%al
call   1040 <init_members@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_all() {
%1 = alloca i32
%2 = call i32 (...) @init_structs()
%3 = call i32 (...) @init_members()
ret void
}

LLVM IR (-O2):
define void @init_all() {
%1 = tail call i32 (...) @init_structs()
%2 = tail call i32 (...) @init_members()
ret void
}
unsigned long TapeImage_MillisecondsToTStates(unsigned long Milliseconds) {
  return ((3500000 / 1000) * Milliseconds);
}


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

x86 assembly (clang, -O2):
<TapeImage_MillisecondsToTStates>:
imul   $0xdac,%rdi,%rax
ret

LLVM IR (-O0):
define i64 @TapeImage_MillisecondsToTStates(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 3500, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @TapeImage_MillisecondsToTStates(i64 %0) {
%2 = mul i64 %0, 3500
ret i64 %2
}
int bit_test(unsigned int test, int n) {
  if (n < 0 || n > 32)
    return 0;
  if ((test >> (31 - n)) & 0x1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<bit_test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     111e <bit_test+0x1e>
cmpl   $0x20,-0xc(%rbp)
jle    112a <bit_test+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1156 <bit_test+0x56>
mov    -0x8(%rbp),%eax
mov    $0x1f,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <bit_test+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <bit_test+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test>:
mov    %esi,%ecx
cmp    $0x21,%esi
setb   %al
shl    %cl,%edi
shr    $0x1f,%edi
and    %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @bit_test(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, 32
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %21
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = sub nsw i32 31, %14
%16 = lshr i32 %13, %15
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 1, i32* %3
br label %21
20: ; preds = %12
store i32 0, i32* %3
br label %21
21: ; preds = %20, %19, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @bit_test(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, 33
%4 = lshr i32 -2147483648, %1
%5 = and i32 %4, %0
%6 = icmp ne i32 %5, 0
%7 = select i1 %3, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ swapbuffers();
void glutSwapBuffers(void) { swapbuffers(); }


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

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

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

LLVM IR (-O2):
define void @glutSwapBuffers() {
%1 = tail call i32 (...) @swapbuffers()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int A[], int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", A[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int get_index(char *);
int get_index_from_string(char *s) { return get_index(s); }


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

x86 assembly (clang, -O2):
<get_index_from_string>:
jmp    1030 <get_index@plt>

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

LLVM IR (-O2):
define i32 @get_index_from_string(i8* %0) {
%2 = tail call i32 @get_index(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  const char *prog;
  prog = getprogname();
  fprintf(
      stderr,
      "usage: %s [-x] [-B endian] [-b free-blocks] [-d debug-mask]\n"
      "\t[-F mtree-specfile] [-f free-files] [-M minimum-size]\n"
      "\t[-m maximum-size] [-N userdb-dir] [-o fs-options] [-S sector-size]\n"
      "\t[-s image-size] [-t fs-type] image-file directory [extra-directory "
      "...]\n",
      prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1030 <getprogname@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb8(%rip),%rsi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [257 x i8] c"usage: %s [-x] [-B endian] [-b free-blocks] [-d debug-mask]\0A\09[-F mtree-specfile] [-f free-files] [-M minimum-size]\0A\09[-m maximum-size] [-N userdb-dir] [-o fs-options] [-S sector-size]\0A\09[-s image-size] [-t fs-type] image-file directory [extra-directory ...]\0A\00"
define void @usage() {
%1 = alloca i8*
%2 = call i8* (...) @getprogname()
store i8* %2, i8** %1
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([257 x i8], [257 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [257 x i8] c"usage: %s [-x] [-B endian] [-b free-blocks] [-d debug-mask]\0A\09[-F mtree-specfile] [-f free-files] [-M minimum-size]\0A\09[-m maximum-size] [-N userdb-dir] [-o fs-options] [-S sector-size]\0A\09[-s image-size] [-t fs-type] image-file directory [extra-directory ...]\0A\00"
define void @usage() {
%1 = tail call i8* (...) @getprogname()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([257 x i8], [257 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
size_t uint32PackSize(const uint32_t *data) { return sizeof(*data); }


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

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

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

LLVM IR (-O2):
define i64 @uint32PackSize(i32* nocapture readnone %0) {
ret i64 4
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void reset_terminal(struct termios *old_args) {
  tcsetattr(0, TCSANOW, old_args);
}


x86 assembly (clang, -O0):
<reset_terminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
call   1030 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_terminal>:
mov    %rdi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
jmp    1030 <tcsetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCSANOW = global i32 0
define void @reset_terminal(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load i32, i32* @TCSANOW
%4 = load %struct.termios*, %struct.termios** %2
%5 = call i32 @tcsetattr(i32 0, i32 %3, %struct.termios* %4)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCSANOW = global i32 0
define void @reset_terminal(%struct.termios* %0) {
%2 = load i32, i32* @TCSANOW
%3 = tail call i32 @tcsetattr(i32 0, i32 %2, %struct.termios* %0)
ret void
}
/* Variables and functions */
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int);
int get_color_rgb(const char *c) {
  if (*c == '#')
    c++;
  return (int)strtol(c, NULL, 16);
}


x86 assembly (clang, -O0):
<get_color_rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1138 <get_color_rgb+0x28>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_color_rgb>:
xor    %eax,%eax
cmpb   $0x23,(%rdi)
sete   %al
add    %rax,%rdi
xor    %esi,%esi
mov    $0x10,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @get_color_rgb(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
%6 = tail call i64 @strtol(i8* nocapture %5, i32* null, i32 16)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __isoc99_scanf();
int /*<<< orphan*/ printf(char *, int);
int sumarray1(int *, unsigned int);
int main(int argc, char *argv[], char *envp[]) {
  unsigned int local0;
  int local1;
  unsigned int local2;
  int o0;
  __isoc99_scanf();
  local2 = 0;
  while ((int)local2 < (int)local0) {
    __isoc99_scanf();
    local2++;
  }
  o0 = sumarray1(&local1, local0);
  printf("Sum = %ld\n", o0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <__isoc99_scanf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1179 <main+0x49>
mov    $0x0,%al
call   1050 <__isoc99_scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1158 <main+0x28>
mov    -0x1c(%rbp),%esi
lea    -0x20(%rbp),%rdi
call   1040 <sumarray1@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <__isoc99_scanf@plt>
lea    0x4(%rsp),%rdi
call   1040 <sumarray1@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%12 = call i32 (...) @__isoc99_scanf()
store i32 0, i32* %10
br label %13
13: ; preds = %17, %3
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = call i32 (...) @__isoc99_scanf()
%19 = load i32, i32* %10
%20 = add i32 %19, 1
store i32 %20, i32* %10
br label %13
21: ; preds = %13
%22 = load i32, i32* %8
%23 = call i32 @sumarray1(i32* %9, i32 %22)
store i32 %23, i32* %11
%24 = load i32, i32* %11
%25 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 (...) @__isoc99_scanf()
%7 = call i32 @sumarray1(i32* %4, i32 undef)
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int rseq_cmpeqv_trystorev_storev(intptr_t *, intptr_t, intptr_t *, intptr_t,
                                 intptr_t, int);
__attribute__((always_)) int
rseq_cmpeqv_trystorev_storev_release(intptr_t *v, intptr_t expect, intptr_t *v2,
                                     intptr_t newv2, intptr_t newv, int cpu) {
  return rseq_cmpeqv_trystorev_storev(v, expect, v2, newv2, newv, cpu);
}


x86 assembly (clang, -O0):
<rseq_cmpeqv_trystorev_storev_release>:
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    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <rseq_cmpeqv_trystorev_storev@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rseq_cmpeqv_trystorev_storev_release>:
jmp    1030 <rseq_cmpeqv_trystorev_storev@plt>

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

LLVM IR (-O2):
define i32 @rseq_cmpeqv_trystorev_storev_release(i64* %0, i64 %1, i64* %2, i64 %3, i64 %4, i32 %5) {
%7 = tail call i32 @rseq_cmpeqv_trystorev_storev(i64* %0, i64 %1, i64* %2, i64 %3, i64 %4, i32 %5)
ret i32 %7
}
short test_65_2(short *mem) { return __atomic_fetch_nand(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_65_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    0x8(%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x28(%rbp)
and    %esi,%edx
mov    %edx,-0x24(%rbp)
not    %edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    116a <test_65_2+0x6a>
jmp    112d <test_65_2+0x2d>
mov    -0x1a(%rbp),%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_65_2>:
movzwl 0x8(%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ecx
not    %ecx
or     $0xfffe,%ecx
lock cmpxchg %cx,0x8(%rdi)
jne    1110 <test_65_2+0x10>
ret

LLVM IR (-O0):
define signext i16 @test_65_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 4
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw nand i16* %6, i16 %7 acq_rel
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @test_65_2(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 4
%3 = atomicrmw nand i16* %2, i16 1 acq_rel
ret i16 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ bit_array_to_byte_array(int /*<<< orphan*/ *, int,
                                           int /*<<< orphan*/ *);
int /*<<< orphan*/ byte_array_reserve(int /*<<< orphan*/ *, int);
int detect_endian();
double bit_array_to_double_native(uint8_t *bit_array) {
  double f;
  uint8_t byte_array[8];
  bit_array_to_byte_array(bit_array, 8, byte_array);
  if (detect_endian() == 1)
    byte_array_reserve(byte_array, 8);
  f = *((double *)byte_array);
  return f;
}


x86 assembly (clang, -O0):
<bit_array_to_double_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0x8,%esi
call   1050 <bit_array_to_byte_array@plt>
mov    $0x0,%al
call   1030 <detect_endian@plt>
cmp    $0x1,%eax
jne    116c <bit_array_to_double_native+0x3c>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1040 <byte_array_reserve@plt>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_array_to_double_native>:
sub    $0x28,%rsp
mov    %rsp,%rdx
mov    $0x8,%esi
call   1050 <bit_array_to_byte_array@plt>
xor    %eax,%eax
call   1030 <detect_endian@plt>
cmp    $0x1,%eax
jne    115a <bit_array_to_double_native+0x2a>
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <byte_array_reserve@plt>
movsd  (%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @bit_array_to_double_native(i32* %0) {
%2 = alloca i32*
%3 = alloca double
%4 = alloca [8 x i32]
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%7 = call i32 @bit_array_to_byte_array(i32* %5, i32 8, i32* %6)
%8 = call i32 (...) @detect_endian()
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%12 = call i32 @byte_array_reserve(i32* %11, i32 8)
br label %13
13: ; preds = %10, %1
%14 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%15 = bitcast i32* %14 to double*
%16 = load double, double* %15
store double %16, double* %3
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @bit_array_to_double_native(i32* %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @bit_array_to_byte_array(i32* %0, i32 8, i32* %4)
%6 = call i32 (...) @detect_endian()
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @byte_array_reserve(i32* %4, i32 8)
br label %10
10: ; preds = %8, %1
%11 = bitcast [8 x i32]* %2 to double*
%12 = load double, double* %11
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int write(int, char const *, int /*<<< orphan*/);
void printdocfooter(int fd) {
  const char *str = "\n</sphinx:document>\n \n";
  int bwrite;
  bwrite = write(fd, str, strlen(str));
  return;
}


x86 assembly (clang, -O0):
<printdocfooter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printdocfooter>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0A</sphinx:document>\0A \0A\00"
define void @printdocfooter(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i32, i32* %2
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
store i32 %9, i32* %4
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0A</sphinx:document>\0A \0A\00"
define void @printdocfooter(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[] = "CAFECAFE";
  char buffer[8];
  memcpy(buffer, str, 3);
  printf("%s\n", buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x11(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x3,%edx
call   1040 <memcpy@plt>
lea    -0x11(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x4546414345464143,%rax
41 46 45
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x18(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1040 <memcpy@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.str = [9 x i8] c"CAFECAFE\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %3, i32 3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u32;

/* Variables and functions */
volatile __u8 gtx_in8(volatile __u8 *mmioaddr, __u32 reg) {
  return *((volatile __u8 *)(mmioaddr + reg));
}


x86 assembly (clang, -O0):
<gtx_in8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtx_in8>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @gtx_in8(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load volatile i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @gtx_in8(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ func2();
int /*<<< orphan*/ func3();
void func1() {
  func3();
  func2();
  func();
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func3@plt>
mov    $0x0,%al
call   1040 <func2@plt>
mov    $0x0,%al
call   1050 <func@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rax
xor    %eax,%eax
call   1030 <func3@plt>
xor    %eax,%eax
call   1040 <func2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <func@plt>

LLVM IR (-O0):
define void @func1() {
%1 = call i32 (...) @func3()
%2 = call i32 (...) @func2()
%3 = call i32 (...) @func()
ret void
}

LLVM IR (-O2):
define void @func1() {
%1 = tail call i32 (...) @func3()
%2 = tail call i32 (...) @func2()
%3 = tail call i32 (...) @func()
ret void
}
/* Variables and functions */
int end_index(int *, int);
int start_index(int *, int);
int test_unordered() {
  int n[] = {4, 7, 10, 11, 7, 12, 6, 16, 18, 19};
  return 1 == start_index(n, 10) && 6 == end_index(n, 10);
}


x86 assembly (clang, -O0):
<test_unordered>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <start_index@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x31(%rbp)
jne    118c <test_unordered+0x5c>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <end_index@plt>
mov    %eax,%ecx
mov    $0x6,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unordered>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <start_index@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1174 <test_unordered+0x54>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <end_index@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x6,%ecx
sete   %al
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_unordered.n = [10 x i32] [i32 4, i32 7, i32 10, i32 11, i32 7, i32 12, i32 6, i32 16, i32 18, i32 19]
define i32 @test_unordered() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @start_index(i32* %3, i32 10)
%5 = icmp eq i32 1, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @end_index(i32* %7, i32 10)
%9 = icmp eq i32 6, %8
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test_unordered.n = [10 x i32] [i32 4, i32 7, i32 10, i32 11, i32 7, i32 12, i32 6, i32 16, i32 18, i32 19]
define i32 @test_unordered() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @start_index(i32* %3, i32 10)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @end_index(i32* %3, i32 10)
%8 = icmp eq i32 %7, 6
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void RNDResponseSink_AVTransport_GetCurrentTransportActions(
    struct UPnPService *Service, int ErrorCode, void *User, char *Actions) {
  printf("RND Invoke Response: "
         "AVTransport/GetCurrentTransportActions[ErrorCode:%d](%s)\r\n",
         ErrorCode, Actions);
}


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

x86 assembly (clang, -O2):
<RNDResponseSink_AVTransport_GetCurrentTransportActions>:
lea    0xee9(%rip),%rdi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [80 x i8] c"RND Invoke Response: AVTransport/GetCurrentTransportActions[ErrorCode:%d](%s)\0D\0A\00"
define void @RNDResponseSink_AVTransport_GetCurrentTransportActions(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %8
%11 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [80 x i8] c"RND Invoke Response: AVTransport/GetCurrentTransportActions[ErrorCode:%d](%s)\0D\0A\00"
define void @RNDResponseSink_AVTransport_GetCurrentTransportActions(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3)
ret void
}
/* Variables and functions */
double floor(double);
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double Floor(double a) {
  printf(gettext("Enter a decimal number: "));
  scanf("%lf", &a);
  return (floor(a));
}


x86 assembly (clang, -O0):
<Floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Floor>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1060 <floor@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Enter a decimal number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @llvm.floor.f64(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter a decimal number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @llvm.floor.f64(double %6)
ret double %7
}
int compare_int(void *l, void *r) { return *((int *)l) - *((int *)r); }


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_int(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, float);
void cpl(int pn) { brc(pn, 'F'); }


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

x86 assembly (clang, -O2):
<cpl>:
movss  0xee8(%rip),%xmm0
jmp    1030 <brc@plt>

LLVM IR (-O0):
define void @cpl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @brc(i32 %3, float 7.000000e+01)
ret void
}

LLVM IR (-O2):
define void @cpl(i32 %0) {
%2 = tail call i32 @brc(i32 %0, float 7.000000e+01)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bitops_getl(uint32_t *a, uint32_t sh, uint32_t l) {
  return (*a >> sh) & ((1 << (l)) - 1);
}


x86 assembly (clang, -O0):
<bitops_getl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitops_getl>:
mov    %esi,%ecx
mov    (%rdi),%esi
sar    %cl,%esi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @bitops_getl(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = ashr i32 %8, %9
%11 = load i32, i32* %6
%12 = shl i32 1, %11
%13 = sub nsw i32 %12, 1
%14 = and i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @bitops_getl(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = ashr i32 %4, %1
%6 = shl nsw i32 -1, %2
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
ret i32 %8
}
msgrcv(msqid, msgp, msgsz, msgtyp, msgflg) int msqid;
struct msgbuf *msgp;
int msgsz;
long msgtyp;
int msgflg;
{ return (syscall(49, 2, msqid, msgp, msgsz, msgtyp, msgflg)); }


x86 assembly (clang, -O0):
<msgrcv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    $0x31,%edi
mov    $0x2,%esi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgrcv>:
push   %rax
mov    %rcx,%r9
mov    %edx,%eax
mov    %rsi,%rcx
mov    %edi,%edx
mov    %r8d,(%rsp)
mov    $0x31,%edi
mov    $0x2,%esi
mov    %eax,%r8d
xor    %eax,%eax
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.msgbuf = type opaque
define i32 @msgrcv(i32 %0, %struct.msgbuf* %1, i32 %2, i64 %3, i32 %4) {
%6 = alloca i32
%7 = alloca %struct.msgbuf*
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
store i32 %0, i32* %6
store %struct.msgbuf* %1, %struct.msgbuf** %7
store i32 %2, i32* %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load %struct.msgbuf*, %struct.msgbuf** %7
%13 = load i32, i32* %8
%14 = load i64, i64* %9
%15 = load i32, i32* %10
%16 = call i32 (i32, i32, i32, %struct.msgbuf*, i32, i64, i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, i32, i32, %struct.msgbuf*, i32, i64, i32, ...)*)(i32 49, i32 2, i32 %11, %struct.msgbuf* %12, i32 %13, i64 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.msgbuf = type opaque
define i32 @msgrcv(i32 %0, %struct.msgbuf* %1, i32 %2, i64 %3, i32 %4) {
%6 = tail call i32 (i32, i32, i32, %struct.msgbuf*, i32, i64, i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, i32, i32, %struct.msgbuf*, i32, i64, i32, ...)*)(i32 49, i32 2, i32 %0, %struct.msgbuf* %1, i32 %2, i64 %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 0;
  while (n < 10) {
    n++;
    if (n % 2 == 0) {
      printf("The number %d is even.\n", n);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1161 <main+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115c <main+0x4c>
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"The number %d is even.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %6
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %6
br label %3
16: ; preds = %3
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [24 x i8] c"The number %d is even.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}