xunge/DecIR huggingface dataset:
/* Variables and functions */
int getchar();
char *gets(char *str) {
  int c;
  char *p;
  p = str;
  while ((c = getchar()) != '\n')
    *p++ = c;
  *p = '\0';
  return (str);
}


x86 assembly (clang, -O0):
<gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1152 <gets+0x42>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1124 <gets+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %r14,%rbx
cmp    $0xa,%eax
je     1142 <gets+0x32>
mov    %r14,%rbx
nopl   0x0(%rax)
mov    %al,(%rbx)
add    $0x1,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
jne    1130 <gets+0x20>
movb   $0x0,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @gets(i8* returned writeonly %0) {
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 10
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = trunc i32 %5 to i8
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %7, i8* %6
%9 = tail call i32 (...) @getchar()
%10 = icmp eq i32 %9, 10
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i8* [ %0, %1 ], [ %8, %4 ]
store i8 0, i8* %12
ret i8* %0
}
/* Type definitions */
typedef int GLint;
typedef int GLenum;

/* Variables and functions */
#define GL_HISTOGRAM_ALPHA_SIZE 135
#define GL_HISTOGRAM_BLUE_SIZE 134
#define GL_HISTOGRAM_FORMAT 133
#define GL_HISTOGRAM_GREEN_SIZE 132
#define GL_HISTOGRAM_LUMINANCE_SIZE 131
#define GL_HISTOGRAM_RED_SIZE 130
#define GL_HISTOGRAM_SINK 129
#define GL_HISTOGRAM_WIDTH 128
GLint __glGetHistogramParameterfv_size(GLenum pname) {
  switch (pname) {
  case GL_HISTOGRAM_WIDTH:
  case GL_HISTOGRAM_FORMAT:
  case GL_HISTOGRAM_RED_SIZE:
  case GL_HISTOGRAM_GREEN_SIZE:
  case GL_HISTOGRAM_BLUE_SIZE:
  case GL_HISTOGRAM_ALPHA_SIZE:
  case GL_HISTOGRAM_LUMINANCE_SIZE:
  case GL_HISTOGRAM_SINK:
    return 1;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<__glGetHistogramParameterfv_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x7,%eax
ja     1127 <__glGetHistogramParameterfv_size+0x27>
jmp    111b <__glGetHistogramParameterfv_size+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <__glGetHistogramParameterfv_size+0x2e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glGetHistogramParameterfv_size>:
and    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0x80,%edi
sete   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @__glGetHistogramParameterfv_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 128, label %5
i32 133, label %5
i32 130, label %5
i32 132, label %5
i32 134, label %5
i32 135, label %5
i32 131, label %5
i32 129, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @__glGetHistogramParameterfv_size(i32 %0) {
%2 = and i32 %0, -8
%3 = icmp eq i32 %2, 128
%4 = select i1 %3, i32 1, i32 -1
ret i32 %4
}
void _Init(void) {}


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

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

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

LLVM IR (-O2):
define void @_Init() {
ret void
}
/* Variables and functions */
bool isBitiSet(unsigned int byte, int i) {
  unsigned int mask = 1 << i;
  return (mask & byte);
}


x86 assembly (clang, -O0):
<isBitiSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBitiSet>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @isBitiSet(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* %4
%7 = shl i32 1, %6
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = and i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @isBitiSet(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
int atoi(const char *nptr) {
__ESBMC_HIDE:;
  int res;
  return res;
}


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

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

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fsetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninitvar_fsetpos(void) {
  FILE *fp;
  fpos_t pos;
  fpos_t *ppos;
  fsetpos(fp, &pos);
  fp = fopen("filename", "rt");
  fsetpos(fp, ppos);
  fclose(fp);
}


x86 assembly (clang, -O0):
<uninitvar_fsetpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <fsetpos@plt>
lea    0xeb4(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <fsetpos@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fsetpos>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
call   1050 <fsetpos@plt>
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fsetpos@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"filename\00"
@.str.1 = [3 x i8] c"rt\00"
define void @uninitvar_fsetpos() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32*
%4 = load i32*, i32** %1
%5 = call i32 @fsetpos(i32* %4, i32* %2)
%6 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = load i32*, i32** %3
%9 = call i32 @fsetpos(i32* %7, i32* %8)
%10 = load i32*, i32** %1
%11 = call i32 @fclose(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"filename\00"
@.str.1 = [3 x i8] c"rt\00"
define void @uninitvar_fsetpos() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @fsetpos(i32* undef, i32* %1)
%4 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @fsetpos(i32* %4, i32* undef)
%6 = call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setsid() {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setsid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setsid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setsid() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setsid() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Variables and functions */
int fun_stub_base_1_stub(int);
int /*<<< orphan*/ printf(char *, int);
int fun_stub_base_1_call(int a) {
  printf("fun_stub_base_1_call:a = %d \n", a);
  int x = fun_stub_base_1_stub(a);
  printf("fun_stub_base_1_stub return %d\n", x);
  return x;
}


x86 assembly (clang, -O0):
<fun_stub_base_1_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <fun_stub_base_1_stub@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_1_call>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <fun_stub_base_1_stub@plt>
mov    %eax,%ebx
lea    0xedd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [30 x i8] c"fun_stub_base_1_call:a = %d \0A\00"
@.str.1 = [32 x i8] c"fun_stub_base_1_stub return %d\0A\00"
define i32 @fun_stub_base_1_call(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @fun_stub_base_1_stub(i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 %3
}
void RTFileAioCtxDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileAioCtxDestroy() {
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
void test_vorrimm_s8x8(int8_t *__restrict__ dest, int8_t *a) {
  int i;
  for (i = 0; i < 8; i++) {
    dest[i] = a[i] | 1;
  }
}


x86 assembly (clang, -O0):
<test_vorrimm_s8x8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1144 <test_vorrimm_s8x8+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
or     $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vorrimm_s8x8+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorrimm_s8x8>:
movups (%rsi),%xmm0
movaps 0xef6(%rip),%xmm1
orps   %xmm1,%xmm0
movups %xmm0,(%rdi)
movups 0x10(%rsi),%xmm0
orps   %xmm1,%xmm0
movups %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vorrimm_s8x8(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = or <4 x i32> %4, <i32 1, i32 1, i32 1, i32 1>
%6 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %1, i64 4
%8 = getelementptr inbounds i32, i32* %0, i64 4
%9 = bitcast i32* %7 to <4 x i32>*
%10 = load <4 x i32>, <4 x i32>* %9
%11 = or <4 x i32> %10, <i32 1, i32 1, i32 1, i32 1>
%12 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %12
ret void
}
extern double n1n2d1(int n1, int n2, double d1) { return n1 + n2 + d1; }


x86 assembly (clang, -O0):
<n1n2d1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<n1n2d1>:
add    %esi,%edi
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @n1n2d1(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = load double, double* %6
%12 = fadd double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @n1n2d1(i32 %0, i32 %1, double %2) {
%4 = add nsw i32 %1, %0
%5 = sitofp i32 %4 to double
%6 = fadd double %5, %2
ret double %6
}
void H420ToRGB24() {}


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

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

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

LLVM IR (-O2):
define void @H420ToRGB24() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgstorsb(int n) { lgen("%s\t%c%d,al", "mov", n); }


x86 assembly (clang, -O0):
<cgstorsb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <lgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstorsb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09%c%d,al\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorsb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09%c%d,al\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorsb(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ba();
int /*<<< orphan*/ begin();
int /*<<< orphan*/ compword(char *);
void ifor() {
  compword("push");
  begin();
  compword("dofor");
  ba();
}


x86 assembly (clang, -O0):
<ifor>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <compword@plt>
mov    $0x0,%al
call   1050 <begin@plt>
lea    0xeb7(%rip),%rdi
call   1030 <compword@plt>
mov    $0x0,%al
call   1040 <ba@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifor>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <compword@plt>
xor    %eax,%eax
call   1050 <begin@plt>
lea    0xeba(%rip),%rdi
call   1030 <compword@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ba@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"push\00"
@.str.1 = [6 x i8] c"dofor\00"
define void @ifor() {
%1 = call i32 @compword(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @begin()
%3 = call i32 @compword(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @ba()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"push\00"
@.str.1 = [6 x i8] c"dofor\00"
define void @ifor() {
%1 = tail call i32 @compword(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @begin()
%3 = tail call i32 @compword(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @ba()
ret void
}
/* Type definitions */
struct per_cpu_info {
  int dummy;
};
struct blk_io_trace {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ process_fmt(char *, struct per_cpu_info *,
                               struct blk_io_trace *, unsigned long long,
                               int /*<<< orphan*/, int /*<<< orphan*/ *);
void log_generic(struct per_cpu_info *pci, struct blk_io_trace *t, char *act) {
  process_fmt(act, pci, t, -1ULL, 0, NULL);
}


x86 assembly (clang, -O0):
<log_generic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xffffffffffffffff,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <process_fmt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_generic>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rax,%rdi
mov    $0xffffffffffffffff,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <process_fmt@plt>

LLVM IR (-O0):
%struct.per_cpu_info = type { i32 }
%struct.blk_io_trace = type { i32 }
define void @log_generic(%struct.per_cpu_info* %0, %struct.blk_io_trace* %1, i8* %2) {
%4 = alloca %struct.per_cpu_info*
%5 = alloca %struct.blk_io_trace*
%6 = alloca i8*
store %struct.per_cpu_info* %0, %struct.per_cpu_info** %4
store %struct.blk_io_trace* %1, %struct.blk_io_trace** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load %struct.per_cpu_info*, %struct.per_cpu_info** %4
%9 = load %struct.blk_io_trace*, %struct.blk_io_trace** %5
%10 = call i32 @process_fmt(i8* %7, %struct.per_cpu_info* %8, %struct.blk_io_trace* %9, i64 -1, i32 0, i32* null)
ret void
}

LLVM IR (-O2):
%struct.per_cpu_info = type { i32 }
%struct.blk_io_trace = type { i32 }
define void @log_generic(%struct.per_cpu_info* %0, %struct.blk_io_trace* %1, i8* %2) {
%4 = tail call i32 @process_fmt(i8* %2, %struct.per_cpu_info* %0, %struct.blk_io_trace* %1, i64 -1, i32 0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cyield();
void cut_hair(void) {
  cyield();
  cyield();
  cyield();
  cyield;
  return;
}


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

x86 assembly (clang, -O2):
<cut_hair>:
push   %rax
xor    %eax,%eax
call   1030 <cyield@plt>
xor    %eax,%eax
call   1030 <cyield@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cyield@plt>

LLVM IR (-O0):
define void @cut_hair() {
%1 = call i32 (...) @cyield()
%2 = call i32 (...) @cyield()
%3 = call i32 (...) @cyield()
ret void
}

LLVM IR (-O2):
define void @cut_hair() {
%1 = tail call i32 (...) @cyield()
%2 = tail call i32 (...) @cyield()
%3 = tail call i32 (...) @cyield()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_mem;
typedef int /*<<< orphan*/ cl_command_queue;

/* Variables and functions */
int WriteToGPU(cl_command_queue cmd_q, cl_mem buf_dev, float *buf_host,
               int size) {
  return 0;
}


x86 assembly (clang, -O0):
<WriteToGPU>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @WriteToGPU(i32 %0, i32 %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store float* %2, float** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @WriteToGPU(i32 %0, i32 %1, float* nocapture readnone %2, i32 %3) {
ret i32 0
}
void strcpy_delspace(char *str1, char *str2) {
  while (*str1 != '\0') {
    if ((*str1) == 0x20) {
      ++str1;
    } else
      *str2++ = *str1++;
  }
  *str2 = '\0';
}


x86 assembly (clang, -O0):
<strcpy_delspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <strcpy_delspace+0x64>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    113d <strcpy_delspace+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    115f <strcpy_delspace+0x5f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy_delspace+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_delspace>:
jmp    1114 <strcpy_delspace+0x14>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x20,%al
je     1110 <strcpy_delspace+0x10>
test   %al,%al
je     1127 <strcpy_delspace+0x27>
mov    %al,(%rsi)
add    $0x1,%rsi
jmp    1110 <strcpy_delspace+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @strcpy_delspace(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %12
i8 32, label %9
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %9
9: ; preds = %3, %7
%10 = phi i8* [ %8, %7 ], [ %5, %3 ]
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
12: ; preds = %3
store i8 0, i8* %5
ret void
}
/* Variables and functions */
void _mm256_zeroall();
void test_mm256_zeroall() { return _mm256_zeroall(); }


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

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

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

LLVM IR (-O2):
define void @test_mm256_zeroall() {
tail call void (...) @_mm256_zeroall()
ret void
}
void g_queue_insert_before() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_insert_before() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR84_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR84_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR84_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
int test_imm_82int16_reg(short val) {
  return ((val) & (-0x82 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_82int16_reg(i16 signext %0) {
%2 = and i16 %0, -130
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  setbuf(stdout, NULL);
  while (1) {
    sleep(2);
    fprintf(stdout, "This is From stdout.");
    fprintf(stderr, "this is stderr.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1151 <main+0x21>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2e99(%rip),%r15
mov    (%r15),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
lea    0xeb0(%rip),%r14
mov    0x2e89(%rip),%r12
lea    0xeb7(%rip),%rbx
xchg   %ax,%ax
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
call   1040 <fprintf@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [21 x i8] c"This is From stdout.\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"this is stderr.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @setbuf(i32 %2, i32* null)
br label %4
4: ; preds = %0, %4
%5 = call i32 @sleep(i32 2)
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %4
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [21 x i8] c"This is From stdout.\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"this is stderr.\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
br label %3
3: ; preds = %0, %3
%4 = tail call i32 @sleep(i32 2)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %3
}
/* Variables and functions */
double _sincos(double, double, int, int);
double cos(double x) {
  if (x < 0.0)
    return _sincos(-x, 1.57079632679489661923 - x, 1, 1);
  else
    return _sincos(x, 1.57079632679489661923 + x, 1, 1);
}


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116a <cos+0x5a>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb1(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <_sincos@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    118d <cos+0x7d>
movsd  -0x10(%rbp),%xmm0
movsd  0xe89(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <_sincos@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1138 <cos+0x28>
movapd 0xeee(%rip),%xmm2
xorpd  %xmm0,%xmm2
movsd  0xed2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
jmp    1144 <cos+0x34>
movsd  0xec0(%rip),%xmm1
addsd  %xmm0,%xmm1
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <_sincos@plt>

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = load double, double* %3
%10 = fsub double 0x3FF921FB54442D18, %9
%11 = call double @_sincos(double %8, double %10, i32 1, i32 1)
store double %11, double* %2
br label %17
12: ; preds = %1
%13 = load double, double* %3
%14 = load double, double* %3
%15 = fadd double 0x3FF921FB54442D18, %14
%16 = call double @_sincos(double %13, double %15, i32 1, i32 1)
store double %16, double* %2
br label %17
17: ; preds = %12, %6
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = fsub double 0x3FF921FB54442D18, %0
%6 = tail call double @_sincos(double %4, double %5, i32 1, i32 1)
br label %10
7: ; preds = %1
%8 = fadd double %0, 0x3FF921FB54442D18
%9 = tail call double @_sincos(double %0, double %8, i32 1, i32 1)
br label %10
10: ; preds = %7, %3
%11 = phi double [ %6, %3 ], [ %9, %7 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
scalar_t__ xmalloc(int);
char *xnstrdup(char *str, int len) {
  char *x = (char *)xmalloc(len + 1);
  memcpy(x, str, len);
  x[len] = '\0';
  return x;
}


x86 assembly (clang, -O0):
<xnstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xnstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1030 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xnstrdup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i64 @xmalloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %5
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @xnstrdup(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @xmalloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %1)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
/* Variables and functions */
int WEXITSTATUS(int);
int wexitstatus(int status) { return WEXITSTATUS(status); }


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

x86 assembly (clang, -O2):
<wexitstatus>:
jmp    1030 <WEXITSTATUS@plt>

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

LLVM IR (-O2):
define i32 @wexitstatus(i32 %0) {
%2 = tail call i32 @WEXITSTATUS(i32 %0)
ret i32 %2
}
/* Type definitions */
struct ast {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ handle_output(struct ast *, char *, char *);
void handle_stmt_return(struct ast *param) {
  handle_output(param,
                "\x1b[2m"
                "= %.4g"
                "\x1b[22m",
                "\x1b[2m"
                "= %s"
                "\x1b[22m");
}


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

x86 assembly (clang, -O2):
<handle_stmt_return>:
lea    0xee9(%rip),%rsi
lea    0xef2(%rip),%rdx
jmp    1030 <handle_output@plt>

LLVM IR (-O0):
%struct.ast = type { i32 }
@.str = [16 x i8] c"\1B[2m= %.4g\1B[22m\00"
@.str.1 = [14 x i8] c"\1B[2m= %s\1B[22m\00"
define void @handle_stmt_return(%struct.ast* %0) {
%2 = alloca %struct.ast*
store %struct.ast* %0, %struct.ast** %2
%3 = load %struct.ast*, %struct.ast** %2
%4 = call i32 @handle_output(%struct.ast* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ast = type { i32 }
@.str = [16 x i8] c"\1B[2m= %.4g\1B[22m\00"
@.str.1 = [14 x i8] c"\1B[2m= %s\1B[22m\00"
define void @handle_stmt_return(%struct.ast* %0) {
%2 = tail call i32 @handle_output(%struct.ast* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, char const *);
int /*<<< orphan*/ stderr;
int dr_check_(int condition, const char *condition_s, const char *__file__,
              int __line__, const char *func) {
  if (!condition) {
    fprintf(stderr, "%s:%d:%s: dag recorder check failed : %s\n", __file__,
            __line__, func, condition_s);
    exit(1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<dr_check_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1172 <dr_check_+0x52>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x10(%rbp),%r9
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dr_check_>:
test   %edi,%edi
je     112a <dr_check_+0xa>
mov    $0x1,%eax
ret
push   %rax
mov    %rsi,%r9
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"%s:%d:%s: dag recorder check failed : %s\0A\00"
define i32 @dr_check_(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %5
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i8*, i8** %10
%18 = load i8*, i8** %7
%19 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i8* %17, i8* %18)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %5
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"%s:%d:%s: dag recorder check failed : %s\0A\00"
define i32 @dr_check_(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %4, i8* %1)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
ret i32 1
}
int swap(a, b)
short *a, *b;
{
  short temp;
  temp = *a;
  *a = *b;
  *b = temp;
  return (1);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x12(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movzwl (%rdi),%eax
movzwl (%rsi),%ecx
mov    %cx,(%rdi)
mov    %ax,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @swap(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = load i16, i16* %1
store i16 %4, i16* %0
store i16 %3, i16* %1
ret i32 1
}
int main() {
  int result = 0;
  int a = 1;
  int b = 2;
  int c = 3;
  if (a <= b) {
    result = 1;
  }
  if (b > c) {
    result = result - 10000;
  }
  if (c >= a + b) {
    result = result + 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     113a <main+0x3a>
movl   $0x1,-0x8(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1151 <main+0x51>
mov    -0x8(%rbp),%eax
sub    $0x2710,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jl     116b <main+0x6b>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 11
}
void __attribute__((no)) HEX00_cgiDatInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_cgiDatInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int main() {
  fprintf(stderr, "Calling sleep\n");
  sleep(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Calling sleep\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 10)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Calling sleep\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 10)
ret i32 0
}
int get_addr(int x, int y) {
  int i, j, k, d, n;
  int num_of_write = 0;
  int add_0;
  i = x / 8;
  j = x % 8;
  add_0 = 0x00037000 - 0x00010000 * i - 0x00001000 * j + 0x00000008 * y;
  return add_0;
}


x86 assembly (clang, -O0):
<get_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
mov    $0x37000,%eax
sub    %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0xc,%ecx
sub    %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_addr>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%ecx
shr    $0x3,%ecx
neg    %ecx
and    $0xffff8,%eax
sub    %eax,%edi
shl    $0x10,%ecx
shl    $0xc,%edi
sub    %edi,%ecx
lea    (%rcx,%rsi,8),%eax
add    $0x37000,%eax
ret

LLVM IR (-O0):
define i32 @get_addr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %10
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 8
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = srem i32 %14, 8
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = mul nsw i32 65536, %16
%18 = sub nsw i32 225280, %17
%19 = load i32, i32* %6
%20 = mul nsw i32 4096, %19
%21 = sub nsw i32 %18, %20
%22 = load i32, i32* %4
%23 = mul nsw i32 8, %22
%24 = add nsw i32 %21, %23
store i32 %24, i32* %11
%25 = load i32, i32* %11
ret i32 %25
}

LLVM IR (-O2):
define i32 @get_addr(i32 %0, i32 %1) {
%3 = sdiv i32 %0, -8
%4 = srem i32 %0, 8
%5 = shl i32 %3, 16
%6 = add i32 %5, 225280
%7 = mul nsw i32 %4, -4096
%8 = add i32 %6, %7
%9 = shl nsw i32 %1, 3
%10 = add nsw i32 %8, %9
ret i32 %10
}
/* Type definitions */
typedef int int32_t;
typedef int const int16_t;

/* Variables and functions */
int16_t PQCLEAN_KYBER51290S_CLEAN_barrett_reduce(int16_t a) {
  int32_t t;
  const int32_t v = (1U << 26) / 3329 + 1;
  t = v * a;
  t >>= 26;
  t *= 3329;
  return a - (int16_t)t;
}


x86 assembly (clang, -O0):
<PQCLEAN_KYBER51290S_CLEAN_barrett_reduce>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4ebf,-0xc(%rbp)
imul   $0x4ebf,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1a,%eax
mov    %eax,-0x8(%rbp)
imul   $0xd01,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PQCLEAN_KYBER51290S_CLEAN_barrett_reduce>:
imul   $0x4ebf,%edi,%eax
sar    $0x1a,%eax
imul   $0xfffff2ff,%eax,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @PQCLEAN_KYBER51290S_CLEAN_barrett_reduce(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 20159, i32* %4
%5 = load i32, i32* %2
%6 = mul nsw i32 20159, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = ashr i32 %7, 26
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 3329
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @PQCLEAN_KYBER51290S_CLEAN_barrett_reduce(i32 %0) {
%2 = mul nsw i32 %0, 20159
%3 = ashr i32 %2, 26
%4 = mul nsw i32 %3, -3329
%5 = add i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Omega_Left(int value) {
  if (value) {
    cpc_key_press(0x52);
  } else {
    cpc_key_unpress(0x52);
  };
}


x86 assembly (clang, -O0):
<Joy_Omega_Left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Omega_Left+0x24>
mov    $0x52,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Omega_Left+0x2e>
mov    $0x52,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Omega_Left>:
test   %edi,%edi
je     112e <Joy_Omega_Left+0xe>
mov    $0x52,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x52,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Omega_Left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @cpc_key_press(i32 82)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 82)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Omega_Left(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 82)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 82)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
char *strchr(char const *, int);
char *os_strchr(const char *s, int c) { return strchr(s, c); }


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

x86 assembly (clang, -O2):
<os_strchr>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @os_strchr(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 i8* @strchr(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @os_strchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}