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

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ **malloc(int);
void _arr_alloc_2d(const size_t x, const size_t y, mpfr_t ***aptr) {
  *aptr = malloc(sizeof(mpfr_t[x][y]));
  assert(*aptr != NULL);
}


x86 assembly (clang, -O0):
<_arr_alloc_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_arr_alloc_2d>:
push   %rbx
mov    %rdx,%rbx
imul   %esi,%edi
shl    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
xor    %edi,%edi
test   %rax,%rax
setne  %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @_arr_alloc_2d(i64 %0, i64 %1, i32*** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32***
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32*** %2, i32**** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul nuw i64 %7, %8
%10 = mul nuw i64 4, %9
%11 = trunc i64 %10 to i32
%12 = call i32** @malloc(i32 %11)
%13 = load i32***, i32**** %6
store i32** %12, i32*** %13
%14 = load i32***, i32**** %6
%15 = load i32**, i32*** %14
%16 = icmp ne i32** %15, null
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}

LLVM IR (-O2):
define void @_arr_alloc_2d(i64 %0, i64 %1, i32*** nocapture writeonly %2) {
%4 = mul nuw i64 %1, %0
%5 = trunc i64 %4 to i32
%6 = shl i32 %5, 2
%7 = tail call i32** @malloc(i32 %6)
store i32** %7, i32*** %2
%8 = icmp ne i32** %7, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret void
}
/* Variables and functions */
double log10(int);
float x264_ssim(float ssim) { return -10.0 * log10(1 - ssim); }


x86 assembly (clang, -O0):
<x264_ssim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x264_ssim>:
push   %rax
movss  0xee7(%rip),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <log10@plt>
mulsd  0xeda(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @x264_ssim(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float 1.000000e+00, %3
%5 = fptosi float %4 to i32
%6 = call double @log10(i32 %5)
%7 = fmul double -1.000000e+01, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @x264_ssim(float %0) {
%2 = fsub float 1.000000e+00, %0
%3 = fptosi float %2 to i32
%4 = tail call double @log10(i32 %3)
%5 = fmul double %4, -1.000000e+01
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ klicks(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char sentence[160];
  scanf("%[^\n]s", sentence);
  klicks(sentence);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xb0(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xb0(%rbp),%rdi
call   1030 <klicks@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <klicks@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [160 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [160 x i8], [160 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [160 x i8], [160 x i8]* %2, i64 0, i64 0
%6 = call i32 @klicks(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [160 x i8]
%2 = getelementptr inbounds [160 x i8], [160 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @klicks(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Audible or visual alert. \a\n");
  printf("Form feed. \f\n");
  printf("This escape sequence \rmoves the active position "
         "to the initial position of the current line.\n");
  printf("Vertical tab, \v, is tricky, as its behaviour is "
         "unspecified under certain conditions.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf49(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Audible or visual alert. \07\0A\00"
@.str.1 = [14 x i8] c"Form feed. \0C\0A\00"
@.str.2 = [94 x i8] c"This escape sequence \0Dmoves the active position to the initial position of the current line.\0A\00"
@.str.3 = [87 x i8] c"Vertical tab, \0B, is tricky, as its behaviour is unspecified under certain conditions.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Audible or visual alert. \07\00"
@str.4 = [13 x i8] c"Form feed. \0C\00"
@str.5 = [93 x i8] c"This escape sequence \0Dmoves the active position to the initial position of the current line.\00"
@str.6 = [86 x i8] c"Vertical tab, \0B, is tricky, as its behaviour is unspecified under certain conditions.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void __main(void) { puts("hello world\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define void @__main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world\0A\00"
define void @__main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void EVP_CIPHER_CTX_set_app_data(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_set_app_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror("usage: RNAinverse [-F[mp]] [-a ALPHABET] [-R [repeats]] [-f final]\n"
          "                  [-T temp] [-4] [-d[2]] [-noGU] [-P paramfile] [-e "
          "e_set] [-v]");
}


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

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

LLVM IR (-O0):
@.str = [147 x i8] c"usage: RNAinverse [-F[mp]] [-a ALPHABET] [-R [repeats]] [-f final]\0A [-T temp] [-4] [-d[2]] [-noGU] [-P paramfile] [-e e_set] [-v]\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [147 x i8] c"usage: RNAinverse [-F[mp]] [-a ALPHABET] [-R [repeats]] [-f final]\0A [-T temp] [-4] [-d[2]] [-noGU] [-P paramfile] [-e e_set] [-v]\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0))
ret void
}
int f(double aaa, double bbb) {
  int xa = !__builtin_isunordered(aaa, aaa);
  int xb = !__builtin_isunordered(bbb, bbb);
  return xa & xb;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fcmp uno double %7, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %5
%12 = load double, double* %4
%13 = load double, double* %4
%14 = fcmp uno double %12, %13
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = and i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @f(double %0, double %1) {
%3 = fcmp ord double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int abs(int);
int sign(int a, int b) {
  int x;
  x = abs(a);
  if (b > 0)
    return (x);
  else
    return (-x);
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113e <sign+0x2e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <sign+0x36>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    %ecx,%eax
neg    %eax
test   %esi,%esi
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp sgt i32 %1, 0
%5 = sub nsw i32 0, %3
%6 = select i1 %4, i32 %3, i32 %5
ret i32 %6
}
int init_soil(void) {}


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

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

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

LLVM IR (-O2):
define i32 @init_soil() {
ret i32 undef
}
void radix_tree_tag_clear(int *node) {
  int *path[2], **pathp = path, height;
  volatile int *addr;
  height = 1;
  pathp[0] = node;
  while (height > 0) {
    pathp[1] = pathp[0];
    pathp++;
    height--;
  }
  addr = pathp[0];
  *addr = 1;
}


x86 assembly (clang, -O0):
<radix_tree_tag_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
cmpl   $0x0,-0x2c(%rbp)
jle    1155 <radix_tree_tag_clear+0x55>
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    1122 <radix_tree_tag_clear+0x22>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_tree_tag_clear>:
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @radix_tree_tag_clear(i32* %0) {
%2 = alloca i32*
%3 = alloca [2 x i32*]
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %2
%7 = getelementptr inbounds [2 x i32*], [2 x i32*]* %3, i64 0, i64 0
store i32** %7, i32*** %4
store i32 1, i32* %5
%8 = load i32*, i32** %2
%9 = load i32**, i32*** %4
%10 = getelementptr inbounds i32*, i32** %9, i64 0
store i32* %8, i32** %10
br label %11
11: ; preds = %14, %1
%12 = load i32, i32* %5
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32**, i32*** %4
%16 = getelementptr inbounds i32*, i32** %15, i64 0
%17 = load i32*, i32** %16
%18 = load i32**, i32*** %4
%19 = getelementptr inbounds i32*, i32** %18, i64 1
store i32* %17, i32** %19
%20 = load i32**, i32*** %4
%21 = getelementptr inbounds i32*, i32** %20, i32 1
store i32** %21, i32*** %4
%22 = load i32, i32* %5
%23 = add nsw i32 %22, -1
store i32 %23, i32* %5
br label %11
24: ; preds = %11
%25 = load i32**, i32*** %4
%26 = getelementptr inbounds i32*, i32** %25, i64 0
%27 = load i32*, i32** %26
store i32* %27, i32** %6
%28 = load i32*, i32** %6
store volatile i32 1, i32* %28
ret void
}

LLVM IR (-O2):
define void @radix_tree_tag_clear(i32* %0) {
store volatile i32 1, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getwc(int /*<<< orphan*/ *);
void uninitvar_getwc(void) {
  FILE *stream;
  (void)getwc(stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_getwc>:
jmp    1030 <getwc@plt>

LLVM IR (-O0):
define void @uninitvar_getwc() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @getwc(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_getwc() {
%1 = tail call i32 @getwc(i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Print(char *);
int cIntroMsg(void) {
  Print("BLOOD RED V.0.1 BY MAJUMA");
  Print("TYPE 'CMDLIST' FOR COMMAND LIST");
  Print("PRESS TYLDE TO ENTER GAME");
  return 1;
}


x86 assembly (clang, -O0):
<cIntroMsg>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <Print@plt>
lea    0xef3(%rip),%rdi
call   1030 <Print@plt>
lea    0xf07(%rip),%rdi
call   1030 <Print@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cIntroMsg>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <Print@plt>
lea    0xef6(%rip),%rdi
call   1030 <Print@plt>
lea    0xf0a(%rip),%rdi
call   1030 <Print@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"BLOOD RED V.0.1 BY MAJUMA\00"
@.str.1 = [32 x i8] c"TYPE 'CMDLIST' FOR COMMAND LIST\00"
@.str.2 = [26 x i8] c"PRESS TYLDE TO ENTER GAME\00"
define i32 @cIntroMsg() {
%1 = call i32 @Print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @Print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [26 x i8] c"BLOOD RED V.0.1 BY MAJUMA\00"
@.str.1 = [32 x i8] c"TYPE 'CMDLIST' FOR COMMAND LIST\00"
@.str.2 = [26 x i8] c"PRESS TYLDE TO ENTER GAME\00"
define i32 @cIntroMsg() {
%1 = tail call i32 @Print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @Print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}
unsigned long max(unsigned long a, unsigned long b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(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* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
void my_memcpy(uint8_t **dest, void *src, int size) {
  memcpy(*dest, src, size);
  *dest += size;
}


x86 assembly (clang, -O0):
<my_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_memcpy>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1030 <memcpy@plt>
movslq %ebx,%rax
shl    $0x2,%rax
add    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @my_memcpy(i32** %0, i8* %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i8*
%6 = alloca i32
store i32** %0, i32*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32**, i32*** %4
%8 = load i32*, i32** %7
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @memcpy(i32* %8, i8* %9, i32 %10)
%12 = load i32, i32* %6
%13 = load i32**, i32*** %4
%14 = load i32*, i32** %13
%15 = sext i32 %12 to i64
%16 = getelementptr inbounds i32, i32* %14, i64 %15
store i32* %16, i32** %13
ret void
}

LLVM IR (-O2):
define void @my_memcpy(i32** nocapture %0, i8* %1, i32 %2) {
%4 = load i32*, i32** %0
%5 = tail call i32 @memcpy(i32* %4, i8* %1, i32 %2)
%6 = load i32*, i32** %0
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
store i32* %8, i32** %0
ret void
}
int emac1_etherstatsfragments_set(unsigned int dev_id,
                                  union emac1_etherstatsfragments_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac1_etherstatsfragments_u = type opaque
define i32 @emac1_etherstatsfragments_set(i32 %0, %union.emac1_etherstatsfragments_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatsfragments_u*
store i32 %0, i32* %3
store %union.emac1_etherstatsfragments_u* %1, %union.emac1_etherstatsfragments_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatsfragments_u = type opaque
define i32 @emac1_etherstatsfragments_set(i32 %0, %union.emac1_etherstatsfragments_u* nocapture readnone %1) {
ret i32 1
}
void f(void) {
  int i, j;
#pragma acc loop
  for (i = 1; i < 30; i++) {
    if (i == 7)
      goto out;
#pragma acc loop
    for (j = 5; j < 10; j++) {
      if (i == 6 && j == 7)
        goto out;
    }
  }
out:;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x1e,-0x4(%rbp)
jge    1174 <f+0x74>
cmpl   $0x7,-0x4(%rbp)
jne    1124 <f+0x24>
jmp    1179 <f+0x79>
movl   $0x5,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1161 <f+0x61>
cmpl   $0x6,-0x4(%rbp)
jne    114e <f+0x4e>
cmpl   $0x7,-0x8(%rbp)
jne    114e <f+0x4e>
jmp    1179 <f+0x79>
jmp    1153 <f+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <f+0x2b>
jmp    1166 <f+0x66>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f+0xb>
jmp    1179 <f+0x79>
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ cstr_appendm(struct cstr_t *, int, char const *);
int /*<<< orphan*/ cstr_clear(struct cstr_t *);
int strnlen(char const *, int);
void cstr_assignstrn(struct cstr_t *dst, const char *src, int n) {
  ;
  cstr_clear(dst);
  int l = n < 0 ? 0 : strnlen(src, n);
  cstr_appendm(dst, l, src);
  { return; };
}


x86 assembly (clang, -O0):
<cstr_assignstrn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <cstr_clear@plt>
cmpl   $0x0,-0x14(%rbp)
jge    1160 <cstr_assignstrn+0x30>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    116f <cstr_assignstrn+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strnlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <cstr_appendm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstr_assignstrn>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <cstr_clear@plt>
test   %ebp,%ebp
js     1153 <cstr_assignstrn+0x23>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <strnlen@plt>
mov    %eax,%esi
jmp    1155 <cstr_assignstrn+0x25>
xor    %esi,%esi
mov    %rbx,%rdi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cstr_appendm@plt>

LLVM IR (-O0):
%struct.cstr_t = type { i32 }
define void @cstr_assignstrn(%struct.cstr_t* %0, i8* %1, i32 %2) {
%4 = alloca %struct.cstr_t*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.cstr_t* %0, %struct.cstr_t** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.cstr_t*, %struct.cstr_t** %4
%9 = call i32 @cstr_clear(%struct.cstr_t* %8)
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
br label %17
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @strnlen(i8* %14, i32 %15)
br label %17
17: ; preds = %13, %12
%18 = phi i32 [ 0, %12 ], [ %16, %13 ]
store i32 %18, i32* %7
%19 = load %struct.cstr_t*, %struct.cstr_t** %4
%20 = load i32, i32* %7
%21 = load i8*, i8** %5
%22 = call i32 @cstr_appendm(%struct.cstr_t* %19, i32 %20, i8* %21)
ret void
}

LLVM IR (-O2):
%struct.cstr_t = type { i32 }
define void @cstr_assignstrn(%struct.cstr_t* %0, i8* %1, i32 %2) {
%4 = tail call i32 @cstr_clear(%struct.cstr_t* %0)
%5 = icmp slt i32 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @strnlen(i8* %1, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
%10 = tail call i32 @cstr_appendm(%struct.cstr_t* %0, i32 %9, i8* %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int bitmap_pad;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_bitmap_pad(void *_p, int _v) {
  ((XImage *)_p)->bitmap_pad = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XImage_bitmap_pad>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XImage_bitmap_pad(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XImage_bitmap_pad(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int errno;
int _set_errno(int n) {
  if (n < 0) {
    errno = -n;
    return -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<_set_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    112b <_set_errno+0x2b>
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    0x2ec3(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1131 <_set_errno+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_errno>:
mov    %edi,%eax
test   %edi,%edi
js     1107 <_set_errno+0x7>
ret
neg    %eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @_set_errno(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = sub nsw i32 0, %0
store i32 %4, i32* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ -1, %3 ], [ %0, %1 ]
ret i32 %6
}
/* Variables and functions */
size_t TestingEqual(size_t index, size_t total) { return 1000; }


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

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

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

LLVM IR (-O2):
define i64 @TestingEqual(i64 %0, i64 %1) {
ret i64 1000
}
void dpf_except() {}


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

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

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

LLVM IR (-O2):
define void @dpf_except() {
ret void
}
int setMotorRightVal(int dataProcessed, int joyValue) {
  int motorValue = dataProcessed + joyValue;
  return motorValue;
}


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

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

LLVM IR (-O0):
define i32 @setMotorRightVal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @setMotorRightVal(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
char *langDbgRegsAy8950() { return "AY8950 Registers"; }


x86 assembly (clang, -O0):
<langDbgRegsAy8950>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgRegsAy8950>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"AY8950 Registers\00"
define i8* @langDbgRegsAy8950() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"AY8950 Registers\00"
define i8* @langDbgRegsAy8950() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int proper_divisors_sum(int);
void proper_divisors_sum_test(void) {
  assert(proper_divisors_sum(1) == 1);
  assert(proper_divisors_sum(2) == 1);
  assert(proper_divisors_sum(9) == 4);
  assert(proper_divisors_sum(-9) == 4);
}


x86 assembly (clang, -O0):
<proper_divisors_sum_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <proper_divisors_sum@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x2,%edi
call   1040 <proper_divisors_sum@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x9,%edi
call   1040 <proper_divisors_sum@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0xfffffff7,%edi
call   1040 <proper_divisors_sum@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<proper_divisors_sum_test>:
push   %rax
mov    $0x1,%edi
call   1040 <proper_divisors_sum@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x2,%edi
call   1040 <proper_divisors_sum@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x9,%edi
call   1040 <proper_divisors_sum@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0xfffffff7,%edi
call   1040 <proper_divisors_sum@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @proper_divisors_sum_test() {
%1 = call i32 @proper_divisors_sum(i32 1)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @proper_divisors_sum(i32 2)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @proper_divisors_sum(i32 9)
%10 = icmp eq i32 %9, 4
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @proper_divisors_sum(i32 -9)
%14 = icmp eq i32 %13, 4
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
define void @proper_divisors_sum_test() {
%1 = tail call i32 @proper_divisors_sum(i32 1)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @proper_divisors_sum(i32 2)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @proper_divisors_sum(i32 9)
%10 = icmp eq i32 %9, 4
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @proper_divisors_sum(i32 -9)
%14 = icmp eq i32 %13, 4
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ G_AdvanceMapRotation(int /*<<< orphan*/);
void Svcmd_G_AdvanceMapRotation_f(void) { G_AdvanceMapRotation(0); }


x86 assembly (clang, -O0):
<Svcmd_G_AdvanceMapRotation_f>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <G_AdvanceMapRotation@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_G_AdvanceMapRotation_f>:
xor    %edi,%edi
jmp    1030 <G_AdvanceMapRotation@plt>

LLVM IR (-O0):
define void @Svcmd_G_AdvanceMapRotation_f() {
%1 = call i32 @G_AdvanceMapRotation(i32 0)
ret void
}

LLVM IR (-O2):
define void @Svcmd_G_AdvanceMapRotation_f() {
%1 = tail call i32 @G_AdvanceMapRotation(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) {
  return cond_wait(cond, mutex);
}


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

x86 assembly (clang, -O2):
<pthread_cond_wait>:
jmp    1030 <cond_wait@plt>

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

LLVM IR (-O2):
define i32 @pthread_cond_wait(i32* %0, i32* %1) {
%3 = tail call i32 @cond_wait(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(char);
void outcomma() { outbyte(','); }


x86 assembly (clang, -O0):
<outcomma>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c,%edi
call   1030 <outbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<outcomma>:
mov    $0x2c,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define void @outcomma() {
%1 = call i32 @outbyte(i8 signext 44)
ret void
}

LLVM IR (-O2):
define void @outcomma() {
%1 = tail call i32 @outbyte(i8 signext 44)
ret void
}
unsigned char *_setcharzero(int num, unsigned char *ptr) {
  while (num--) {
    *ptr++ = 0;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<_setcharzero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1136 <_setcharzero+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    110b <_setcharzero+0xb>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_setcharzero>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %edi,%edi
je     1133 <_setcharzero+0x23>
mov    %edi,%ebx
mov    %edi,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0xffffffff,%ebx
add    %rbx,%r14
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_setcharzero(i32 %0, i8* writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = add i32 %0, -1
%7 = zext i32 %6 to i64
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr i8, i8* %1, i64 %8
br label %10
10: ; preds = %4, %2
%11 = phi i8* [ %1, %2 ], [ %9, %4 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ write_msg_id(int, char);
int /*<<< orphan*/ write_param(int, char *, int);
void write_msg(int socket, char msg_id, char *param, int size) {
  write_msg_id(socket, msg_id);
  write_param(socket, param, size);
}


x86 assembly (clang, -O0):
<write_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movsbl -0x5(%rbp),%esi
call   1040 <write_msg_id@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write_param@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_msg>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %edi,%ebp
call   1040 <write_msg_id@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write_param@plt>

LLVM IR (-O0):
define void @write_msg(i32 %0, i8 signext %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8 %1, i8* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8, i8* %6
%11 = call i32 @write_msg_id(i32 %9, i8 signext %10)
%12 = load i32, i32* %5
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @write_param(i32 %12, i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @write_msg(i32 %0, i8 signext %1, i8* %2, i32 %3) {
%5 = tail call i32 @write_msg_id(i32 %0, i8 signext %1)
%6 = tail call i32 @write_param(i32 %0, i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle19() { kprintf("ISR %d.\n", 19); }


x86 assembly (clang, -O0):
<isrHandle19>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x13,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle19>:
lea    0xee9(%rip),%rdi
mov    $0x13,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle19() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 19)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle19() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 19)
ret void
}
void deleteMat(int **xs, int r) {
  for (int i = 0; i < r; i++)
    free(xs[i]);
  free(xs);
}


x86 assembly (clang, -O0):
<deleteMat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <deleteMat+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <deleteMat+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteMat>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <deleteMat+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <deleteMat+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deleteMat(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i32** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32*, i32** %0, i64 %9
%11 = bitcast i32** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
unsigned int hashlittle(void const *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(void const *);
unsigned int name_hashfunc(const void *key) {
  return hashlittle(key, strlen(key), 0);
}


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

x86 assembly (clang, -O2):
<name_hashfunc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <hashlittle@plt>

LLVM IR (-O0):
define i32 @name_hashfunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @hashlittle(i8* %3, i32 %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
define i32 @name_hashfunc(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @hashlittle(i8* %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
scalar_t__ get_basename(char *);
char *get_basename_nc(char *filename) { return (char *)get_basename(filename); }


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

x86 assembly (clang, -O2):
<get_basename_nc>:
jmp    1030 <get_basename@plt>

LLVM IR (-O0):
define i8* @get_basename_nc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @get_basename(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @get_basename_nc(i8* %0) {
%2 = tail call i64 @get_basename(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void prefetch(const void *ptr) {
  typedef struct {
    char x[64];
  } cacheline_t;
  asm volatile("prefetcht0 %0" : : "m"(*(const cacheline_t *)ptr));
}


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

x86 assembly (clang, -O2):
<prefetch>:
prefetcht0 (%rdi)
ret

LLVM IR (-O0):
%struct.cacheline_t = type { [64 x i8] }
define void @prefetch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.cacheline_t*
ret void
}

LLVM IR (-O2):
%struct.cacheline_t = type { [64 x i8] }
define void @prefetch(i8* %0) {
%2 = bitcast i8* %0 to %struct.cacheline_t*
tail call void asm sideeffect "prefetcht0 $0", "*m,~{dirflag},~{fpsr},~{flags}"(%struct.cacheline_t* elementtype(%struct.cacheline_t) %2)
ret void
}
int uasm_rel_highest(long val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uasm_rel_highest(i64 %0) {
ret i32 0
}
int get(unsigned char a, unsigned char pos) { return (a >> pos) & 1; }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = ashr i32 %6, %8
%10 = and i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @get(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = lshr i32 %3, %4
%6 = and i32 %5, 1
ret i32 %6
}
void outw(unsigned short port, unsigned short val) {
  asm volatile("outw %0, %1" : : "a"(val), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    -0x2(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw $0, $1", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %1, i16 %0)
ret void
}
/* Type definitions */
typedef char wchar_t;
struct _Locale_codecvt {
  int dummy;
};
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t _WLocale_mbtowc(struct _Locale_codecvt *lcodecvt
                       __attribute__((__unused__)),
                       wchar_t *to, const char *from,
                       size_t n __attribute__((__unused__)),
                       mbstate_t *st __attribute__((__unused__))) {
  *to = *from;
  return 1;
}


x86 assembly (clang, -O0):
<_WLocale_mbtowc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_WLocale_mbtowc>:
mov    (%rdx),%al
mov    %al,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct._Locale_codecvt = type { i32 }
define i64 @_WLocale_mbtowc(%struct._Locale_codecvt* %0, i8* %1, i8* %2, i64 %3, i32* %4) {
%6 = alloca %struct._Locale_codecvt*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
store %struct._Locale_codecvt* %0, %struct._Locale_codecvt** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%11 = load i8*, i8** %8
%12 = load i8, i8* %11
%13 = load i8*, i8** %7
store i8 %12, i8* %13
ret i64 1
}

LLVM IR (-O2):
%struct._Locale_codecvt = type { i32 }
define i64 @_WLocale_mbtowc(%struct._Locale_codecvt* nocapture readnone %0, i8* nocapture writeonly %1, i8* nocapture %2, i64 %3, i32* nocapture readnone %4) {
%6 = load i8, i8* %2
store i8 %6, i8* %1
ret i64 1
}
int f(int x) { int y; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}