xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M365_f(char *s) {
  debug("M365_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M365_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M365_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M365_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M365_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M365_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M365_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int Media_init(int videoFormat) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Media_init(i32 %0) {
ret i32 1
}
int compare_floats(const void *p1, const void *p2) {
  float *p1_point, *p2_point;
  p1_point = (float *)p1;
  p2_point = (float *)p2;
  if (*p1_point < *p2_point) {
    return -1;
  }
  if (*p1_point > *p2_point) {
    return +1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare_floats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1141 <compare_floats+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <compare_floats+0x69>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    1162 <compare_floats+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <compare_floats+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_floats>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_floats(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float*
%7 = alloca float*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
store float* %9, float** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
store float* %11, float** %7
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = load float*, float** %7
%15 = load float, float* %14
%16 = fcmp olt float %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load float*, float** %6
%20 = load float, float* %19
%21 = load float*, float** %7
%22 = load float, float* %21
%23 = fcmp ogt float %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compare_floats(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = fcmp ogt float %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *cli_malloc(size_t len) {
  void *ptr;
  if ((ptr = calloc(1, len)) == NULL)
    fatal("calloc: %s", strerror(errno));
  return (ptr);
}


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

x86 assembly (clang, -O2):
<cli_malloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1162 <cli_malloc+0x32>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1050 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"calloc: %s\00"
@errno = global i32 0
define i8* @cli_malloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ IDGetBit(unsigned long long *, int);
int /*<<< orphan*/ WriteBit(int /*<<< orphan*/);
int /*<<< orphan*/ writeByte(int);
void SelectSensor(unsigned long long ID) {
  int BitIndex;
  char Bit;
  writeByte(0x55);
  for (BitIndex = 0; BitIndex < 64; BitIndex++) {
    WriteBit(IDGetBit(&ID, BitIndex));
  }
}


x86 assembly (clang, -O0):
<SelectSensor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x55,%edi
call   1050 <writeByte@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1178 <SelectSensor+0x48>
mov    -0xc(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1040 <IDGetBit@plt>
mov    %eax,%edi
call   1030 <WriteBit@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <SelectSensor+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SelectSensor>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    $0x55,%edi
call   1050 <writeByte@plt>
xor    %ebx,%ebx
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <IDGetBit@plt>
mov    %eax,%edi
call   1030 <WriteBit@plt>
add    $0x1,%ebx
cmp    $0x40,%ebx
jne    1150 <SelectSensor+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @SelectSensor(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i8
store i64 %0, i64* %2
%5 = call i32 @writeByte(i32 85)
store i32 0, i32* %3
br label %6
6: ; preds = %13, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 64
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %3
%11 = call i32 @IDGetBit(i64* %2, i32 %10)
%12 = call i32 @WriteBit(i32 %11)
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @SelectSensor(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = tail call i32 @writeByte(i32 85)
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = call i32 @IDGetBit(i64* %2, i32 %5)
%7 = call i32 @WriteBit(i32 %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 64
br i1 %9, label %10, label %4
10: ; preds = %4
ret void
}
/* Variables and functions */
double mercLat(double);
double geohashGetYWGS84(double y) { return mercLat(y); }


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

x86 assembly (clang, -O2):
<geohashGetYWGS84>:
jmp    1030 <mercLat@plt>

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

LLVM IR (-O2):
define double @geohashGetYWGS84(double %0) {
%2 = tail call double @mercLat(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ nand_reset();
void nand_init(void) {
  (*(volatile unsigned long *)(0x4E000000 + 0x00)) =
      (1 << 12) | (2 << 8) | (0 << 4);
  (*(volatile unsigned long *)(0x4E000000 + 0x04)) =
      (1 << 4) | (1 << 1) | (1 << 0);
  (*(volatile unsigned long *)(0x4E000000 + 0x20)) = 0;
  nand_reset();
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000000,%eax
movq   $0x1200,(%rax)
mov    $0x4e000004,%eax
movq   $0x13,(%rax)
mov    $0x4e000020,%eax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1030 <nand_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
movq   $0x1200,0x4e000000
movq   $0x13,0x4e000004
movq   $0x0,0x4e000020
xor    %eax,%eax
jmp    1030 <nand_reset@plt>

LLVM IR (-O0):
define void @nand_init() {
store volatile i64 4608, i64* inttoptr (i64 1308622848 to i64*)
store volatile i64 19, i64* inttoptr (i64 1308622852 to i64*)
store volatile i64 0, i64* inttoptr (i64 1308622880 to i64*)
%1 = call i32 (...) @nand_reset()
ret void
}

LLVM IR (-O2):
define void @nand_init() {
store volatile i64 4608, i64* inttoptr (i64 1308622848 to i64*)
store volatile i64 19, i64* inttoptr (i64 1308622852 to i64*)
store volatile i64 0, i64* inttoptr (i64 1308622880 to i64*)
%1 = tail call i32 (...) @nand_reset()
ret void
}
void swap(int *i, int *j) {
  int tmp = *i;
  *i = *j;
  *j = tmp;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int /*<<< orphan*/);
void C67_LDB_PTR(int r, int r2) { C67_asm("LDB.D *", r, r2, 0); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"LDB.D *\00"
define void @C67_LDB_PTR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 0)
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ free(struct ring_buf *);
void ring_buf_end(struct ring_buf *rb) { free(rb); }


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

x86 assembly (clang, -O2):
<ring_buf_end>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ring_buf = type { i32 }
define void @ring_buf_end(%struct.ring_buf* nocapture %0) {
%2 = tail call i32 @free(%struct.ring_buf* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *,
                           char *, int /*<<< orphan*/);
int /*<<< orphan*/ gai_strerror(int);
int /*<<< orphan*/ stderr;
int _ping_gaierror(char const *message, int error) {
  fprintf(stderr, "%s%s%s%s\n",
          "ping"
          ": ",
          message, ": ", gai_strerror(error));
  return -1;
}


x86 assembly (clang, -O0):
<_ping_gaierror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <gai_strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rcx
mov    %eax,%r9d
lea    0xea4(%rip),%rsi
lea    0xea7(%rip),%rdx
lea    0xea4(%rip),%r8
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ping_gaierror>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    %esi,%edi
call   1030 <gai_strerror@plt>
lea    0xec3(%rip),%rsi
lea    0xec6(%rip),%rdx
lea    0xec3(%rip),%r8
mov    %ebp,%edi
mov    %rbx,%rcx
mov    %eax,%r9d
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s%s%s%s\0A\00"
@.str.1 = [7 x i8] c"ping: \00"
@.str.2 = [3 x i8] c": \00"
define i32 @_ping_gaierror(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @gai_strerror(i32 %1)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeCAN(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000066, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeCAN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x66,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeCAN>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x66,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeCAN(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 102, i32 8)
ret void
}
float Mul(float a, float b) { return (a * b); }


x86 assembly (clang, -O0):
<Mul>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mul>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Mul(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @Mul(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
void rqi_ext(void) {
  void bail();
  bail("ERROR: rqi_ext called, but not yet implemented. Sorry.", 1);
}


x86 assembly (clang, -O0):
<rqi_ext>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <bail@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rqi_ext>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <bail@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"ERROR: rqi_ext called, but not yet implemented. Sorry.\00"
define void @rqi_ext() {
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"ERROR: rqi_ext called, but not yet implemented. Sorry.\00"
define void @rqi_ext() {
tail call void (i8*, i32, ...) bitcast (void (...)* @bail to void (i8*, i32, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int f41(int *);
int f42(int *p) { return f41(p); }


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

x86 assembly (clang, -O2):
<f42>:
jmp    1030 <f41@plt>

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

LLVM IR (-O2):
define i32 @f42(i32* %0) {
%2 = tail call i32 @f41(i32* %0)
ret i32 %2
}
float return_float() { return 3.14; }


x86 assembly (clang, -O0):
<return_float>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_float>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @return_float() {
ret float 0x40091EB860000000
}

LLVM IR (-O2):
define float @return_float() {
ret float 0x40091EB860000000
}
/* Variables and functions */
int /*<<< orphan*/ get_name();
int main() {
  get_name();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_name()
ret i32 0
}
char *str_cat(char *dst, const char *src) {
  char *cp = dst;
  while (*cp)
    cp++;
  while (*cp++ = *src++)
    ;
  return (dst);
}


x86 assembly (clang, -O0):
<str_cat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <str_cat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <str_cat+0x14>
jmp    1137 <str_cat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <str_cat+0x66>
jmp    1137 <str_cat+0x37>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <str_cat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <str_cat+0x20>
ret

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

LLVM IR (-O2):
define i8* @str_cat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ alloc_failed();
size_t mul(size_t a, size_t b) {
  size_t product = a * b;
  if (b != 0 && product / b != a)
    alloc_failed();
  return product;
}


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <mul+0x45>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    -0x8(%rbp),%rax
je     1155 <mul+0x45>
mov    $0x0,%al
call   1030 <alloc_failed@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
push   %rbx
mov    %rsi,%rax
mul    %rdi
mov    %rax,%rbx
seto   %al
test   %rsi,%rsi
je     112d <mul+0x1d>
test   %al,%al
je     112d <mul+0x1d>
xor    %eax,%eax
call   1030 <alloc_failed@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @mul(i64 %0, i64 %1) {
%3 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%4 = icmp eq i64 %1, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = extractvalue { i64, i1 } %3, 1
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (...) @alloc_failed()
br label %9
9: ; preds = %7, %5, %2
%10 = extractvalue { i64, i1 } %3, 0
ret i64 %10
}
/* Variables and functions */
double __ocml_sub_rtz_f64(double, double);
double __dsub_rz(double x, double y) { return __ocml_sub_rtz_f64(x, y); }


x86 assembly (clang, -O0):
<__dsub_rz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__ocml_sub_rtz_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dsub_rz>:
jmp    1030 <__ocml_sub_rtz_f64@plt>

LLVM IR (-O0):
define double @__dsub_rz(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__ocml_sub_rtz_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dsub_rz(double %0, double %1) {
%3 = tail call double @__ocml_sub_rtz_f64(double %0, double %1)
ret double %3
}
void unify_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @unify_Init() {
ret void
}
int get_score(unsigned char *s) {
  int score = 0;
  for (; *s;)
    score += *s++;
  score %= 100;
  return score;
}


x86 assembly (clang, -O0):
<get_score>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1139 <get_score+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_score+0xf>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_score>:
mov    (%rdi),%cl
test   %cl,%cl
je     1133 <get_score+0x33>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <get_score+0x10>
mov    %eax,%ecx
imul   $0x51eb851f,%rcx,%rcx
shr    $0x25,%rcx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_score(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i32
%10 = add nuw nsw i32 %6, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = urem i32 %10, 100
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int test29() { exit(1); }


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

x86 assembly (clang, -O2):
<test29>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @test29() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @test29() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
void net_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @net_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
toomuch() {
  fprintf(stderr, "erl: Too many arguments\n");
  return (-1);
}


x86 assembly (clang, -O0):
<toomuch>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toomuch>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"erl: Too many arguments\0A\00"
define i32 @toomuch() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"erl: Too many arguments\0A\00"
define i32 @toomuch() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fail(char *mesg) {
  fprintf(stderr, "error: %s\n", mesg);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"error: %s\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"error: %s\0A\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(double);
int main() {
  printf("Square root of %lf is %lf\n", 4.0, sqrt(4.0));
  printf("Square root of %lf is %lf\n", 5.0, sqrt(5.0));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
call   1040 <sqrt@plt>
mov    %eax,%esi
lea    0xecb(%rip),%rdi
movsd  0xebb(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xea6(%rip),%xmm0
call   1040 <sqrt@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
movsd  0xe90(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xed7(%rip),%xmm0
call   1040 <sqrt@plt>
lea    0xedb(%rip),%rbx
mov    %rbx,%rdi
movsd  0xec0(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xeb9(%rip),%xmm0
call   1040 <sqrt@plt>
mov    %rbx,%rdi
movsd  0xea9(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Square root of %lf is %lf\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sqrt(double 4.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double 4.000000e+00, i32 %2)
%4 = call i32 @sqrt(double 5.000000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double 5.000000e+00, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Square root of %lf is %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @sqrt(double 4.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double 4.000000e+00, i32 %1)
%3 = tail call i32 @sqrt(double 5.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double 5.000000e+00, i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  typedef int A[];
  A a = {1, 2}, b = {3, 4, 5};
  printf("%lu %lu\n", sizeof(a), sizeof(b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x8,%esi
mov    $0xc,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
mov    $0xc,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%lu %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8, i32 12)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readmemb_common(int /*<<< orphan*/);
int /*<<< orphan*/ wait(int, int);
uint8_t readmemb(uint32_t a) {
  uint8_t ret;
  wait(4, 1);
  ret = readmemb_common(a);
  return ret;
}


x86 assembly (clang, -O0):
<readmemb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <wait@plt>
mov    -0x4(%rbp),%edi
call   1030 <readmemb_common@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readmemb>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <wait@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <readmemb_common@plt>

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

LLVM IR (-O2):
define i32 @readmemb(i32 %0) {
%2 = tail call i32 @wait(i32 4, i32 1)
%3 = tail call i32 @readmemb_common(i32 %0)
ret i32 %3
}
/* Variables and functions */
size_t json_parse_nested_struct(char const *, char, char, char *, size_t);
size_t json_parse_nested_array(const char *str, char *buf, size_t size) {
  return json_parse_nested_struct(str, '[', ']', buf, size);
}


x86 assembly (clang, -O0):
<json_parse_nested_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x5b,%esi
mov    $0x5d,%edx
call   1030 <json_parse_nested_struct@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_parse_nested_array>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    $0x5b,%esi
mov    $0x5d,%edx
jmp    1030 <json_parse_nested_struct@plt>

LLVM IR (-O0):
define i64 @json_parse_nested_array(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @json_parse_nested_struct(i8* %7, i8 signext 91, i8 signext 93, i8* %8, i64 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @json_parse_nested_array(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @json_parse_nested_struct(i8* %0, i8 signext 91, i8 signext 93, i8* %1, i64 %2)
ret i64 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int mmio_read_32(uintptr_t);
int /*<<< orphan*/ mmio_write_32(uintptr_t, int);
void mmio_clrsetbits_32(uintptr_t addr, uint32_t clear, uint32_t set) {
  mmio_write_32(addr, (mmio_read_32(addr) & ~clear) | set);
}


x86 assembly (clang, -O0):
<mmio_clrsetbits_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mmio_read_32@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
or     -0x10(%rbp),%esi
call   1030 <mmio_write_32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmio_clrsetbits_32>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <mmio_read_32@plt>
not    %ebp
and    %eax,%ebp
or     %r14d,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mmio_write_32@plt>

LLVM IR (-O0):
define void @mmio_clrsetbits_32(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %4
%9 = call i32 @mmio_read_32(i64 %8)
%10 = load i32, i32* %5
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = load i32, i32* %6
%14 = or i32 %12, %13
%15 = call i32 @mmio_write_32(i64 %7, i32 %14)
ret void
}

LLVM IR (-O2):
define void @mmio_clrsetbits_32(i64 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mmio_read_32(i64 %0)
%5 = xor i32 %1, -1
%6 = and i32 %4, %5
%7 = or i32 %6, %2
%8 = tail call i32 @mmio_write_32(i64 %0, i32 %7)
ret void
}
void gtk_font_selection_set_preview_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_selection_set_preview_text() {
ret void
}
char cmp(int x, int y) { return (x <= y) ? 0 : 1; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmovle %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define signext i8 @cmp(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 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @cmp(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
g() { long t; }


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

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

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

LLVM IR (-O2):
define i32 @g() {
ret i32 undef
}
/* Variables and functions */
int strcmp(char *, char *);
int ifj16_compare(char *s1, char *s2) {
  int ret = strcmp(s1, s2);
  if (ret < 0) {
    return -1;
  } else if (ret > 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<ifj16_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1146 <ifj16_compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <ifj16_compare+0x53>
cmpl   $0x0,-0x1c(%rbp)
jle    115c <ifj16_compare+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <ifj16_compare+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifj16_compare>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ifj16_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp sgt i32 %3, -1
%7 = select i1 %6, i32 %5, i32 -1
ret i32 %7
}
float UI_ProportionalSizeScale(int style) {
  if (style & 0x00000010) {
    return 0.75;
  }
  return 1.00;
}


x86 assembly (clang, -O0):
<UI_ProportionalSizeScale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1128 <UI_ProportionalSizeScale+0x28>
movss  0xee6(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1135 <UI_ProportionalSizeScale+0x35>
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_ProportionalSizeScale>:
xor    %eax,%eax
test   $0x10,%dil
sete   %al
lea    0xef0(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @UI_ProportionalSizeScale(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 16
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store float 7.500000e-01, float* %2
br label %9
8: ; preds = %1
store float 1.000000e+00, float* %2
br label %9
9: ; preds = %8, %7
%10 = load float, float* %2
ret float %10
}

LLVM IR (-O2):
define float @UI_ProportionalSizeScale(i32 %0) {
%2 = and i32 %0, 16
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, float 1.000000e+00, float 7.500000e-01
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printIntVector(int *, int);
int /*<<< orphan*/ selectionSort(int *, int);
int main() {
  int vector[10] = {6, 5, 7, 4, 8, 3, 9, 2, 0, 1};
  selectionSort(vector, 10);
  printIntVector(vector, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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 <selectionSort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <printIntVector@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <selectionSort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printIntVector@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.vector = [10 x i32] [i32 6, i32 5, i32 7, i32 4, i32 8, i32 3, i32 9, i32 2, i32 0, i32 1]
define i32 @main() {
%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 @selectionSort(i32* %3, i32 10)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @printIntVector(i32* %5, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vector = [10 x i32] [i32 6, i32 5, i32 7, i32 4, i32 8, i32 3, i32 9, i32 2, i32 0, i32 1]
define i32 @main() {
%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 @selectionSort(i32* %3, i32 10)
%5 = call i32 @printIntVector(i32* %3, i32 10)
ret i32 0
}
long labs(long x) {
  do {
  } while (0);
  return x < 0 ? -x : x;
}


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <labs+0xd>
cmpq   $0x0,-0x8(%rbp)
jge    1127 <labs+0x27>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112f <labs+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load i64, i64* %2
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %12
10: ; preds = %4
%11 = load i64, i64* %2
br label %12
12: ; preds = %10, %7
%13 = phi i64 [ %9, %7 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}