xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_empty();
int /*<<< orphan*/ printf(char *, float, float, float, float);
void print4(__m128 v) {
  float *p = (float *)&v;
  _mm_empty();
  printf("[%13.8g, %13.8g, %13.8g, %13.8g]", p[0], p[1], p[2], p[3]);
}


x86 assembly (clang, -O0):
<print4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <_mm_empty@plt>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm3
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print4>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <_mm_empty@plt>
movd   %ebx,%xmm0
lea    0xecb(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"[%13.8g, %13.8g, %13.8g, %13.8g]\00"
define void @print4(i32 %0) {
%2 = alloca i32
%3 = alloca float*
store i32 %0, i32* %2
%4 = bitcast i32* %2 to float*
store float* %4, float** %3
%5 = call i32 (...) @_mm_empty()
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 2
%14 = load float, float* %13
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 3
%17 = load float, float* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), float %8, float %11, float %14, float %17)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"[%13.8g, %13.8g, %13.8g, %13.8g]\00"
define void @print4(i32 %0) {
%2 = tail call i32 (...) @_mm_empty()
%3 = bitcast i32 %0 to float
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), float %3, float poison, float poison, float poison)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XIMStatusDrawCallbackStruct;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XIMStatusDrawCallbackStruct(void *_p) {
  if (_p == NULL)
    abort();
  free((XIMStatusDrawCallbackStruct *)_p);
}


x86 assembly (clang, -O0):
<free_XIMStatusDrawCallbackStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XIMStatusDrawCallbackStruct+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XIMStatusDrawCallbackStruct>:
test   %rdi,%rdi
je     112a <free_XIMStatusDrawCallbackStruct+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XIMStatusDrawCallbackStruct(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XIMStatusDrawCallbackStruct(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
unsigned int get_const_mask(const char *basemask, const int bits) {
  const char *const end = basemask + bits;
  unsigned int curbit = 1;
  unsigned int bitmap = 0;
  for (; basemask < end; basemask++, curbit <<= 1) {
    if (*basemask == 1)
      bitmap |= curbit;
  }
  return bitmap;
}


x86 assembly (clang, -O0):
<get_const_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    116e <get_const_mask+0x6e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    114f <get_const_mask+0x4f>
mov    -0x1c(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1154 <get_const_mask+0x54>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1128 <get_const_mask+0x28>
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_const_mask>:
test   %esi,%esi
jle    1139 <get_const_mask+0x39>
movslq %esi,%rcx
add    %rdi,%rcx
mov    $0x1,%edx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x1,(%rdi)
mov    $0x0,%esi
cmove  %edx,%esi
or     %esi,%eax
add    $0x1,%rdi
add    %edx,%edx
cmp    %rcx,%rdi
jb     1120 <get_const_mask+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_const_mask(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8* %11, i8** %5
store i32 1, i32* %6
store i32 0, i32* %7
br label %12
12: ; preds = %26, %2
%13 = load i8*, i8** %3
%14 = load i8*, i8** %5
%15 = icmp ult i8* %13, %14
br i1 %15, label %16, label %31
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %25
21: ; preds = %16
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = or i32 %23, %22
store i32 %24, i32* %7
br label %25
25: ; preds = %21, %16
br label %26
26: ; preds = %25
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
%29 = load i32, i32* %6
%30 = shl i32 %29, 1
store i32 %30, i32* %6
br label %12
31: ; preds = %12
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @get_const_mask(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %17
6: ; preds = %2, %6
%7 = phi i32 [ %13, %6 ], [ 0, %2 ]
%8 = phi i32 [ %15, %6 ], [ 1, %2 ]
%9 = phi i8* [ %14, %6 ], [ %0, %2 ]
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 1
%12 = select i1 %11, i32 %8, i32 0
%13 = or i32 %12, %7
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = shl i32 %8, 1
%16 = icmp ult i8* %14, %4
br i1 %16, label %6, label %17
17: ; preds = %6, %2
%18 = phi i32 [ 0, %2 ], [ %13, %6 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void *realloc(void *, size_t);
void *localRealloc(void *memory, size_t size) {
  if ((memory = realloc(memory, size)))
    return memory;
  else {
    error("Out of memory!\n");
    return (void *)0;
  }
}


x86 assembly (clang, -O0):
<localRealloc>:
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 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1158 <localRealloc+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <localRealloc+0x4c>
lea    0xea1(%rip),%rdi
call   1040 <error@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localRealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <localRealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @localRealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i8*, i8** %4
%7 = load i64, i64* %5
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %4
store i8* %11, i8** %3
br label %14
12: ; preds = %2
%13 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %14
14: ; preds = %12, %10
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory!\0A\00"
define noalias i8* @localRealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
ret i8* %3
}
void parseISO_base_media_file_format() {}


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

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

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

LLVM IR (-O2):
define void @parseISO_base_media_file_format() {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isdigit_or_questionmark(int c) {
  if (isdigit(c) || c == '?')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isdigit_or_questionmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    1137 <isdigit_or_questionmark+0x27>
cmpl   $0x3f,-0x8(%rbp)
jne    1143 <isdigit_or_questionmark+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <isdigit_or_questionmark+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit_or_questionmark>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
cmp    $0x3f,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isdigit_or_questionmark(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 63
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i32 1, i32* %2
br label %12
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @isdigit_or_questionmark(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 63
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRCREATEBITMAPINDIRECT_set(void) {
  return U_WMRCORENONE_set("U_WMRCREATEBITMAPINDIRECT");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"U_WMRCREATEBITMAPINDIRECT\00"
define i8* @U_WMRCREATEBITMAPINDIRECT_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [26 x i8] c"U_WMRCREATEBITMAPINDIRECT\00"
define i8* @U_WMRCREATEBITMAPINDIRECT_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
char *memchr(char const *, char, size_t);
size_t rpl_strnlen(const char *string, size_t maxlen) {
  const char *end = memchr(string, '\0', maxlen);
  return end ? (size_t)(end - string) : maxlen;
}


x86 assembly (clang, -O0):
<rpl_strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <rpl_strnlen+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <rpl_strnlen+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @rpl_strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @memchr(i8* %6, i8 signext 0, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
br label %19
17: ; preds = %2
%18 = load i64, i64* %4
br label %19
19: ; preds = %17, %11
%20 = phi i64 [ %16, %11 ], [ %18, %17 ]
ret i64 %20
}

LLVM IR (-O2):
define i64 @rpl_strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i8 signext 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Variables and functions */
char *getenv(char *);
char *getenv_null(char *ename) {
  char *s = getenv(ename);
  if (!s)
    return "(NULL)";
  return s;
}


x86 assembly (clang, -O0):
<getenv_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1144 <getenv_null+0x34>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <getenv_null+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_null>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"(NULL)\00"
define i8* @getenv_null(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @getenv(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
10: ; preds = %1
%11 = load i8*, i8** %4
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %9
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"(NULL)\00"
define i8* @getenv_null(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
void dimensions(int x[]) {
  x[0] = 2;
  x[1] = 3;
  x[2] = 1;
  x[3] = 2;
}


x86 assembly (clang, -O0):
<dimensions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dimensions>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @dimensions(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 2, i32 3, i32 1, i32 2>, <4 x i32>* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, double);
int main(int argc, const char *argv[]) {
  float x = 3.14, y = 42.0;
  double sum = x + y;
  printf("The sum of %f and %f is %f.\n", x, y, sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
movsd  0xed8(%rip),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"The sum of %f and %f is %f.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca float
%6 = alloca float
%7 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
store float 0x40091EB860000000, float* %5
store float 4.200000e+01, float* %6
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fadd float %8, %9
%11 = fpext float %10 to double
store double %11, double* %7
%12 = load float, float* %5
%13 = load float, float* %6
%14 = load double, double* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %12, float %13, double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"The sum of %f and %f is %f.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0x40091EB860000000, float 4.200000e+01, double 0x404691EB80000000)
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(char const);
int geti(const char *s) {
  int n;
  n = 0;
  while (isdigit(*s))
    n = n * 10 + *s++ - '0';
  return n;
}


x86 assembly (clang, -O0):
<geti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     115c <geti+0x4c>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <geti+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geti>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1153 <geti+0x43>
add    $0x1,%rbx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    (%r14,%r14,4),%eax
movsbl -0x1(%rbx),%ecx
lea    (%rcx,%rax,2),%r14d
add    $0xffffffd0,%r14d
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <geti+0x20>
jmp    1156 <geti+0x46>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @geti(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = call i64 @isdigit(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = add nsw i32 %11, %15
%17 = sub nsw i32 %16, 48
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @geti(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isdigit(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %13, %5 ], [ 0, %1 ]
%7 = phi i8* [ %9, %5 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 10
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = add i32 %8, -48
%13 = add i32 %12, %11
%14 = load i8, i8* %9
%15 = tail call i64 @isdigit(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ ex2();
int main() {
  ex2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ex2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t Array_new_capacity_default(size_t capacity, size_t index) {
  assert(capacity == capacity);
  return index + 1;
}


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

x86 assembly (clang, -O2):
<Array_new_capacity_default>:
push   %rbx
mov    %rsi,%rbx
mov    $0x1,%edi
call   1030 <assert@plt>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @Array_new_capacity_default(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i64, i64* %4
%11 = add i64 %10, 1
ret i64 %11
}

LLVM IR (-O2):
define i64 @Array_new_capacity_default(i64 %0, i64 %1) {
%3 = tail call i32 @assert(i32 1)
%4 = add i64 %1, 1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(void *, size_t const, int const, int /*<<< orphan*/ *);
int fwritex(void *ptr, const size_t size, const int nitems, FILE *fp) {
  return (fwrite(ptr, size, nitems, fp));
}


x86 assembly (clang, -O0):
<fwritex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwritex>:
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define i32 @fwritex(i8* nocapture %0, i64 %1, i32 %2, i32* nocapture %3) {
%5 = tail call i32 @fwrite(i8* %0, i64 %1, i32 %2, i32* %3)
ret i32 %5
}
zcall(sname) char *sname;
{
  ot("CALL ");
  outname(sname);
  nl();
}


x86 assembly (clang, -O0):
<zcall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outname@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zcall>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outname@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"CALL \00"
define i32 @zcall(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %5)
%7 = call i32 (...) @nl()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"CALL \00"
define i32 @zcall(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (...) @nl()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void aeron_release() {
  volatile int64_t dummy = 0;
  (void)dummy;
}


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

x86 assembly (clang, -O2):
<aeron_release>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define void @aeron_release() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Enter equation without any whitespace\n");
  printf("For e.g., send+more=money\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Enter equation without any whitespace\0A\00"
@.str.1 = [27 x i8] c"For e.g., send+more=money\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Enter equation without any whitespace\00"
@str.2 = [26 x i8] c"For e.g., send+more=money\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.2, i64 0, i64 0))
ret void
}
void g_get_user_data_dir() {}


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

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

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

LLVM IR (-O2):
define void @g_get_user_data_dir() {
ret void
}
/* Type definitions */
struct grid {
  int dummy;
};

/* Variables and functions */
scalar_t__ is_within_ij(struct grid *, int, int);
int is_within_ijk(struct grid *g, int i, int j, int k) {
  return (is_within_ij(g, i, j) && k >= 0 && k < 8);
}


x86 assembly (clang, -O0):
<is_within_ijk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <is_within_ij@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x15(%rbp)
je     115f <is_within_ijk+0x4f>
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jl     115f <is_within_ijk+0x4f>
cmpl   $0x8,-0x14(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_within_ijk>:
push   %rbx
mov    %ecx,%ebx
call   1030 <is_within_ij@plt>
test   %rax,%rax
setne  %al
cmp    $0x8,%ebx
setb   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.grid = type { i32 }
define i32 @is_within_ijk(%struct.grid* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.grid*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.grid* %0, %struct.grid** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.grid*, %struct.grid** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i64 @is_within_ij(%struct.grid* %9, i32 %10, i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %4
%15 = load i32, i32* %8
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %8
%19 = icmp slt i32 %18, 8
br label %20
20: ; preds = %17, %14, %4
%21 = phi i1 [ false, %14 ], [ false, %4 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%struct.grid = type { i32 }
define i32 @is_within_ijk(%struct.grid* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @is_within_ij(%struct.grid* %0, i32 %1, i32 %2)
%6 = icmp ne i64 %5, 0
%7 = icmp ult i32 %3, 8
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void f1(char a[], int b) { printf("%s %d\n", a, b); }


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

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %d\0A\00"
define void @f1(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank1High(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vrc2_4_SetChrROMBank1();
void vrc2_4_setParamsBXX3(uint16_t addr, uint8_t val) {
  __setCHRBank1High(addr, val);
  vrc2_4_SetChrROMBank1();
}


x86 assembly (clang, -O0):
<vrc2_4_setParamsBXX3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <__setCHRBank1High@plt>
mov    $0x0,%al
call   1030 <vrc2_4_SetChrROMBank1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vrc2_4_setParamsBXX3(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 @__setCHRBank1High(i32 %5, i32 %6)
%8 = call i32 (...) @vrc2_4_SetChrROMBank1()
ret void
}

LLVM IR (-O2):
define void @vrc2_4_setParamsBXX3(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank1High(i32 %0, i32 %1)
%4 = tail call i32 (...) @vrc2_4_SetChrROMBank1()
ret void
}
/* Variables and functions */
double *new_double();
double test_from_void() {
  double *x = new_double();
  return (x[2] == 43);
}


x86 assembly (clang, -O0):
<test_from_void>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <new_double@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_from_void>:
push   %rax
xor    %eax,%eax
call   1030 <new_double@plt>
movsd  0xee0(%rip),%xmm1
cmpeqsd 0x10(%rax),%xmm1
movsd  0xeda(%rip),%xmm0
andpd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @test_from_void() {
%1 = alloca double*
%2 = call double* (...) @new_double()
store double* %2, double** %1
%3 = load double*, double** %1
%4 = getelementptr inbounds double, double* %3, i64 2
%5 = load double, double* %4
%6 = fcmp oeq double %5, 4.300000e+01
%7 = zext i1 %6 to i32
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @test_from_void() {
%1 = tail call double* (...) @new_double()
%2 = getelementptr inbounds double, double* %1, i64 2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 4.300000e+01
%5 = uitofp i1 %4 to double
ret double %5
}
/* Variables and functions */
unsigned long GetHwnd75();
unsigned long gethwnd() { return GetHwnd75(); }


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

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

LLVM IR (-O0):
define i64 @gethwnd() {
%1 = call i64 (...) @GetHwnd75()
ret i64 %1
}

LLVM IR (-O2):
define i64 @gethwnd() {
%1 = tail call i64 (...) @GetHwnd75()
ret i64 %1
}
void UserPtr_VerifyChecksum(void *ptr) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @UserPtr_VerifyChecksum(i8* nocapture %0) {
ret void
}
short int test16(int a, int b) {
  short int sum;
  short unsigned int sumus;
  sum = a + b;
  sumus = a + b;
  return sum;
}


x86 assembly (clang, -O0):
<test16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %ax,-0xc(%rbp)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test16>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define signext i16 @test16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
%14 = trunc i32 %13 to i16
store i16 %14, i16* %6
%15 = load i16, i16* %5
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @test16(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = trunc i32 %3 to i16
ret i16 %4
}
extern void traceopen(const char *file) {}


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

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

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

LLVM IR (-O2):
define void @traceopen(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int rand();
unsigned int flip(void) { return rand() % 2; }


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @flip() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 2
ret i32 %2
}

LLVM IR (-O2):
define i32 @flip() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 2
ret i32 %2
}
int SetSocketInlineOutOfBandData(const int fd __attribute__((__unused__)),
                                 const int onoff __attribute__((__unused__))) {
  ;
  ;
  return (-1);
}


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

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

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

LLVM IR (-O2):
define i32 @SetSocketInlineOutOfBandData(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ io_scroll_cell_cursor(int, int);
void scroll_cell_cursor(int dir, int repeat) {
  io_scroll_cell_cursor(dir, repeat);
}


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

x86 assembly (clang, -O2):
<scroll_cell_cursor>:
jmp    1030 <io_scroll_cell_cursor@plt>

LLVM IR (-O0):
define void @scroll_cell_cursor(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 @io_scroll_cell_cursor(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @scroll_cell_cursor(i32 %0, i32 %1) {
%3 = tail call i32 @io_scroll_cell_cursor(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
const char *get_compiler(void) {
  static char buffer[100] = {0x00};
  snprintf(buffer, sizeof(buffer) - 1, "GCC %i.%i", 9, 4);
  return buffer;
}


x86 assembly (clang, -O0):
<get_compiler>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x63,%esi
lea    0xed9(%rip),%rdx
mov    $0x9,%ecx
mov    $0x4,%r8d
call   1030 <snprintf@plt>
lea    0x2f02(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_compiler>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x63,%esi
mov    $0x9,%ecx
mov    $0x4,%r8d
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_compiler.buffer = internal global [100 x i8] zeroinitializer
@.str = [10 x i8] c"GCC %i.%i\00"
define i8* @get_compiler() {
%1 = call i32 @snprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compiler.buffer, i64 0, i64 0), i32 99, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9, i32 4)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compiler.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@get_compiler.buffer = internal global [100 x i8] zeroinitializer
@.str = [10 x i8] c"GCC %i.%i\00"
define i8* @get_compiler() {
%1 = tail call i32 @snprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compiler.buffer, i64 0, i64 0), i32 99, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9, i32 4)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compiler.buffer, i64 0, i64 0)
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_number_of_multprec_Laurentials(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(572, length, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_multprec_Laurentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x23c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_multprec_Laurentials>:
mov    %rdi,%rsi
mov    $0x23c,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_number_of_multprec_Laurentials(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 572, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_number_of_multprec_Laurentials(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 572, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ send_req(int, int);
int poll_server_p1(int sock) {
  ;
  return send_req(sock, 3) > 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<poll_server_p1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1030 <send_req@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poll_server_p1>:
push   %rax
mov    $0x3,%esi
call   1030 <send_req@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @poll_server_p1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @send_req(i32 %3, i32 3)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @poll_server_p1(i32 %0) {
%2 = tail call i64 @send_req(i32 %0, i32 3)
%3 = icmp sgt i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
int scale_from_percentage(int val, int max_val) {
  if (val < 0)
    return (val * max_val - 50) / 100;
  return (val * max_val + 50) / 100;
}


x86 assembly (clang, -O0):
<scale_from_percentage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    112e <scale_from_percentage+0x2e>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
sub    $0x32,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1143 <scale_from_percentage+0x43>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    $0x32,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_from_percentage>:
imul   %edi,%esi
lea    0x32(%rsi),%eax
add    $0xffffffce,%esi
test   %edi,%edi
cmovns %eax,%esi
movslq %esi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @scale_from_percentage(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* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = mul nsw i32 %9, %10
%12 = sub nsw i32 %11, 50
%13 = sdiv i32 %12, 100
store i32 %13, i32* %3
br label %20
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = mul nsw i32 %15, %16
%18 = add nsw i32 %17, 50
%19 = sdiv i32 %18, 100
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @scale_from_percentage(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = mul nsw i32 %1, %0
%5 = select i1 %3, i32 -50, i32 50
%6 = add nsw i32 %4, %5
%7 = sdiv i32 %6, 100
ret i32 %7
}
void example01(char *led) {
  int i = 0;
  if (i == 5000000) {
    led[0] = ~led[0];
  } else {
    i++;
  }
}


x86 assembly (clang, -O0):
<example01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4c4b40,-0xc(%rbp)
jne    1133 <example01+0x33>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    113c <example01+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @example01(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 5000000
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
br label %18
15: ; preds = %1
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %6
ret void
}

LLVM IR (-O2):
define void @example01(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ cmp3(void const *, void const *);
scalar_t__ cmp4(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool cmp7(const void *a, const void *b) {
  return cmp3(a, b) && cmp4((uint8_t *)a + 3, (uint8_t *)b + 3);
}


x86 assembly (clang, -O0):
<cmp7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cmp3@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     116e <cmp7+0x4e>
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
mov    -0x10(%rbp),%rsi
add    $0xc,%rsi
call   1040 <cmp4@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp7>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cmp3@plt>
test   %rax,%rax
je     1154 <cmp7+0x34>
add    $0xc,%rbx
add    $0xc,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <cmp4@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1156 <cmp7+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @cmp7(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @cmp3(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = call i64 @cmp4(i32* %12, i32* %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %9, %2
%19 = phi i1 [ false, %2 ], [ %17, %9 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @cmp7(i8* %0, i8* %1) {
%3 = tail call i64 @cmp3(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 12
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i8, i8* %1, i64 12
%9 = bitcast i8* %8 to i32*
%10 = tail call i64 @cmp4(i32* %7, i32* %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %14
}
void enemy_collision_shots_dontcare(struct jumpnrun_enemy *self,
                                    struct jumpnrun_game_state *state) {
  (void)self;
  (void)state;
}


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

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

LLVM IR (-O0):
%struct.jumpnrun_enemy = type opaque
%struct.jumpnrun_game_state = type opaque
define void @enemy_collision_shots_dontcare(%struct.jumpnrun_enemy* %0, %struct.jumpnrun_game_state* %1) {
%3 = alloca %struct.jumpnrun_enemy*
%4 = alloca %struct.jumpnrun_game_state*
store %struct.jumpnrun_enemy* %0, %struct.jumpnrun_enemy** %3
store %struct.jumpnrun_game_state* %1, %struct.jumpnrun_game_state** %4
%5 = load %struct.jumpnrun_enemy*, %struct.jumpnrun_enemy** %3
%6 = load %struct.jumpnrun_game_state*, %struct.jumpnrun_game_state** %4
ret void
}

LLVM IR (-O2):
%struct.jumpnrun_enemy = type opaque
%struct.jumpnrun_game_state = type opaque
define void @enemy_collision_shots_dontcare(%struct.jumpnrun_enemy* nocapture %0, %struct.jumpnrun_game_state* nocapture %1) {
ret void
}