xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assertTrue(int, char *, char const *, char const *);
scalar_t__ strcmp(char const *, char const *);
void testRtaConfiguration_ComponentName(const char *(*getname)(void),
                                        const char *truth) {
  const char *name = getname();
  assertTrue(strcmp(name, truth) == 0, "Got wrong name, got %s expected %s",
             name, truth);
}


x86 assembly (clang, -O0):
<testRtaConfiguration_ComponentName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
call   *-0x8(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea1(%rip),%rsi
call   1030 <assertTrue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testRtaConfiguration_ComponentName>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   *%rdi
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Got wrong name, got %s expected %s\00"
define void @testRtaConfiguration_ComponentName(i8* ()* %0, i8* %1) {
%3 = alloca i8* ()*
%4 = alloca i8*
%5 = alloca i8*
store i8* ()* %0, i8* ()** %3
store i8* %1, i8** %4
%6 = load i8* ()*, i8* ()** %3
%7 = call i8* %6()
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %5
%14 = load i8*, i8** %4
%15 = call i32 @assertTrue(i32 %12, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Got wrong name, got %s expected %s\00"
define void @testRtaConfiguration_ComponentName(i8* ()* nocapture %0, i8* %1) {
%3 = tail call i8* %0()
%4 = tail call i64 @strcmp(i8* %3, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assertTrue(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %1)
ret void
}
void glmGenerateReverseVector3f(float result[3], const float v[3]) {
  result[0] = -v[0];
  result[1] = -v[1];
  result[2] = -v[2];
}


x86 assembly (clang, -O0):
<glmGenerateReverseVector3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateReverseVector3f>:
movss  (%rsi),%xmm0
movaps 0xef5(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateReverseVector3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = fneg float %7
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fneg float %13
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = fneg float %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @glmGenerateReverseVector3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fneg float %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fneg float %6
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = fneg float %10
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t CondSwapToBus64(uint64_t d) { return d; }


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

x86 assembly (clang, -O2):
<CondSwapToBus64>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @CondSwapToBus64(i32 returned %0) {
ret i32 %0
}
void do_state_7(char c, int *state, char *word, int *length) {
  word[(*length)++] = c;
  if (c >= '0' && c <= '7') {
    *state = 3;
  } else {
    *state = -1;
  }
}


x86 assembly (clang, -O0):
<do_state_7>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1159 <do_state_7+0x59>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
jg     1159 <do_state_7+0x59>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
jmp    1163 <do_state_7+0x63>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_state_7>:
movslq (%rcx),%r8
lea    0x1(%r8),%eax
mov    %eax,(%rcx)
mov    %dil,(%rdx,%r8,1)
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
lea    -0x1(,%rax,4),%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @do_state_7(i8 signext %0, i32* nocapture writeonly %1, i8* nocapture writeonly %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
store i8 %0, i8* %8
%9 = and i8 %0, -8
%10 = icmp eq i8 %9, 48
%11 = select i1 %10, i32 3, i32 -1
store i32 %11, i32* %1
ret void
}
void fs_scanfile(char *dir, char *name) {}


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

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

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

LLVM IR (-O2):
define void @fs_scanfile(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvwins_nwstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvwins_nwstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvwins_nwstr+0x2a>
jmp    1170 <cmd_mvwins_nwstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvwins_nwstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvwins_nwstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwins_nwstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwins_nwstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IOC(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ _IOC_WRITE;
int ioctl(int, int /*<<< orphan*/, char const *);
int CED_SendString(int fh, const char *szText, int n) {
  return ioctl(fh, _IOC(_IOC_WRITE, 0xce, 2, n), szText);
}


x86 assembly (clang, -O0):
<CED_SendString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%ecx
mov    $0xce,%esi
mov    $0x2,%edx
call   1030 <_IOC@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_SendString>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ecx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    $0xce,%esi
mov    $0x2,%edx
call   1030 <_IOC@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
@_IOC_WRITE = global i32 0
define i32 @CED_SendString(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* @_IOC_WRITE
%9 = load i32, i32* %6
%10 = call i32 @_IOC(i32 %8, i32 206, i32 2, i32 %9)
%11 = load i8*, i8** %5
%12 = call i32 @ioctl(i32 %7, i32 %10, i8* %11)
ret i32 %12
}

LLVM IR (-O2):
@_IOC_WRITE = global i32 0
define i32 @CED_SendString(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @_IOC_WRITE
%5 = tail call i32 @_IOC(i32 %4, i32 206, i32 2, i32 %2)
%6 = tail call i32 @ioctl(i32 %0, i32 %5, i8* %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage: %s\n", progname);
  fprintf(stderr, "   read data from stdin\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed7(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s\0A\00"
@.str.1 = [25 x i8] c" read data from stdin\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s\0A\00"
@.str.1 = [25 x i8] c" read data from stdin\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA2_Channel4_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA2_Channel4_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA2_Channel4_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int main() {
  int *p, *q, **r, a, b;
  p = &a;
  q = &b;
  if (a)
    p = &b;
  if (b)
    r = &p;
  else
    r = &q;
  printf("%u", *r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1141 <main+0x31>
lea    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1158 <main+0x48>
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1160 <main+0x50>
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
int test_imm_EBint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xEB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EBint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xeb,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EBint64_highword_mem>:
testb  $0xeb,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EBint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 235
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_EBint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1009317314560
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *__dlopen(char const *, int);
void *dlopen(char const *pathname, int mode) {
  return __dlopen(pathname, mode);
}


x86 assembly (clang, -O0):
<dlopen>:
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 <__dlopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlopen>:
jmp    1030 <__dlopen@plt>

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

LLVM IR (-O2):
define i8* @dlopen(i8* %0, i32 %1) {
%3 = tail call i8* @__dlopen(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ lang_load(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Usage: lngdump <lng file>\n");
    return 2;
  }
  lang_load(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1165 <main+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <lang_load@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1139 <main+0x19>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1040 <lang_load@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: lngdump <lng file>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @lang_load(i8* %13)
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@str = [26 x i8] c"Usage: lngdump <lng file>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @lang_load(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 2, %4 ], [ 0, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int uint64_t;
struct pcg_state_64 {
  int dummy;
};

/* Variables and functions */
int pcg_unique_64_xsl_rr_rr_64_random_r(struct pcg_state_64 *);
uint64_t pcg_unique_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_64 *rng,
                                                  uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_unique_64_xsl_rr_rr_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_unique_64_xsl_rr_rr_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_unique_64_xsl_rr_rr_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_unique_64_xsl_rr_rr_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_unique_64_xsl_rr_rr_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_unique_64_xsl_rr_rr_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_unique_64_xsl_rr_rr_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_unique_64_xsl_rr_rr_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_unique_64_xsl_rr_rr_64_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
%3 = alloca %struct.pcg_state_64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_64* %0, %struct.pcg_state_64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_64*, %struct.pcg_state_64** %3
%13 = call i32 @pcg_unique_64_xsl_rr_rr_64_random_r(%struct.pcg_state_64* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_unique_64_xsl_rr_rr_64_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_unique_64_xsl_rr_rr_64_random_r(%struct.pcg_state_64* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int snprintf(char *, int, char *, char const *, unsigned int);
int get_dump_file(unsigned veid, const char *dumpdir, char *buf, int size) {
  return snprintf(buf, size,
                  "%s/"
                  "Dump.%d",
                  dumpdir != NULL ? dumpdir : "/vz/dump", veid);
}


x86 assembly (clang, -O0):
<get_dump_file>:
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    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <get_dump_file+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    115c <get_dump_file+0x4c>
lea    0xeb8(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    115c <get_dump_file+0x4c>
mov    -0x20(%rbp),%esi
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rcx
mov    -0x4(%rbp),%r8d
lea    0xe8e(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dump_file>:
mov    %rdx,%r9
mov    %edi,%r8d
test   %rsi,%rsi
lea    0xeeb(%rip),%rax
cmovne %rsi,%rax
lea    0xed5(%rip),%rdx
mov    %r9,%rdi
mov    %ecx,%esi
mov    %rax,%rcx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s/Dump.%d\00"
@.str.1 = [9 x i8] c"/vz/dump\00"
define i32 @get_dump_file(i32 %0, i8* %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 i8*, i8** %7
%10 = load i32, i32* %8
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i8*, i8** %6
br label %16
15: ; preds = %4
br label %16
16: ; preds = %15, %13
%17 = phi i8* [ %14, %13 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %15 ]
%18 = load i32, i32* %5
%19 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s/Dump.%d\00"
@.str.1 = [9 x i8] c"/vz/dump\00"
define i32 @get_dump_file(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1
%7 = tail call i32 @snprintf(i8* %2, i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %0)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ DI_Set_Reset();
int di_reset(void) {
  DI_Set_Reset();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @di_reset() {
%1 = call i32 (...) @DI_Set_Reset()
ret i32 0
}

LLVM IR (-O2):
define i32 @di_reset() {
%1 = tail call i32 (...) @DI_Set_Reset()
ret i32 0
}
void f_stdarg3(const char *s, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @f_stdarg3(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Open Source SW Project\n");
  printf("First GitHub Trannung\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    0xee6(%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    0xef3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Open Source SW Project\0A\00"
@.str.1 = [23 x i8] c"First GitHub Trannung\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Open Source SW Project\00"
@str.2 = [22 x i8] c"First GitHub Trannung\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int emac2_etherstatsfragments_set(unsigned int dev_id,
                                  union emac2_etherstatsfragments_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac2_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):
<emac2_etherstatsfragments_set>:
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
%union.emac2_etherstatsfragments_u = type opaque
define i32 @emac2_etherstatsfragments_set(i32 %0, %union.emac2_etherstatsfragments_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
int /*<<< orphan*/ memcpy(char *, char *, int);
scalar_t__ refc_alloc(int);
char *string_conv(void *self, char *data, int length) {
  char *copy = (char *)refc_alloc(length + 1);
  assert(copy);
  copy[length] = '\0';
  memcpy(copy, data, length);
  return copy;
}


x86 assembly (clang, -O0):
<string_conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <refc_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @string_conv(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i64 @refc_alloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @assert(i8* %6)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 0, i8* %9
%10 = tail call i32 @memcpy(i8* %6, i8* %1, i32 %2)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_if(void *data) { (free(data), (data) = NULL); }


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

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

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

LLVM IR (-O2):
define void @free_if(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find_track(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char search_for[80];
  printf("Search for : ");
  scanf("%79s", search_for);
  find_track(search_for);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <find_track@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Search for : \00"
@.str.1 = [5 x i8] c"%79s\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @find_track(i8* %2)
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
char *remove_comments(char *line) {
  char *comment;
  comment = NULL;
  comment = strchr(line, '#');
  if (comment) {
    *comment = '\0';
  }
  return line;
}


x86 assembly (clang, -O0):
<remove_comments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <remove_comments+0x38>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_comments>:
push   %rbx
mov    %rdi,%rbx
mov    $0x23,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <remove_comments+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @remove_comments(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 35)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @remove_comments(i8* returned %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 35)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret i8* %0
}
void ASSERT() {}


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

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

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

LLVM IR (-O2):
define void @ASSERT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *getcwd(char *, size_t);
int strlen(char *);
int c0x_getcurrdir(char *dir, size_t max) {
  if (getcwd(dir, max) == NULL)
    return (-1);
  else
    return (strlen(dir));
}


x86 assembly (clang, -O0):
<c0x_getcurrdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <getcwd@plt>
cmp    $0x0,%rax
jne    1153 <c0x_getcurrdir+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <c0x_getcurrdir+0x3f>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c0x_getcurrdir>:
push   %rbx
mov    %rdi,%rbx
call   1040 <getcwd@plt>
test   %rax,%rax
je     1137 <c0x_getcurrdir+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @c0x_getcurrdir(i8* %0, i64 %1) {
%3 = tail call i32* @getcwd(i8* %0, i64 %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
int _strlen(char s[]) {
  int i = 0;
  while (s[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int execute_sched_setparam() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_sched_setparam() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_sched_setparam() {
ret i32 0
}
int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld,
                         int index) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.hda_codec = type opaque
%struct.hdmi_eld = type opaque
define i32 @snd_hda_eld_proc_new(%struct.hda_codec* %0, %struct.hdmi_eld* %1, i32 %2) {
%4 = alloca %struct.hda_codec*
%5 = alloca %struct.hdmi_eld*
%6 = alloca i32
store %struct.hda_codec* %0, %struct.hda_codec** %4
store %struct.hdmi_eld* %1, %struct.hdmi_eld** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.hda_codec = type opaque
%struct.hdmi_eld = type opaque
define i32 @snd_hda_eld_proc_new(%struct.hda_codec* nocapture readnone %0, %struct.hdmi_eld* nocapture readnone %1, i32 %2) {
ret i32 0
}
long consumeBlanksOrTabs(char *buffer, long lineLength) {
  long Counter;
  Counter = 0;
  while ((Counter < lineLength) && ((' ' == *buffer) || ('\t' == *buffer))) {
    Counter++;
    buffer++;
  }
  return (Counter);
}


x86 assembly (clang, -O0):
<consumeBlanksOrTabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jge    115a <consumeBlanksOrTabs+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%al
mov    $0x20,%ecx
cmp    %edx,%ecx
mov    %al,-0x1a(%rbp)
je     1154 <consumeBlanksOrTabs+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    116a <consumeBlanksOrTabs+0x6a>
jmp    1187 <consumeBlanksOrTabs+0x87>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <consumeBlanksOrTabs+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<consumeBlanksOrTabs>:
xor    %eax,%eax
test   %rsi,%rsi
jg     1119 <consumeBlanksOrTabs+0x19>
ret
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    %rax,%rsi
je     1129 <consumeBlanksOrTabs+0x29>
movzbl (%rdi,%rax,1),%ecx
cmp    $0x20,%cl
je     1110 <consumeBlanksOrTabs+0x10>
cmp    $0x9,%cl
je     1110 <consumeBlanksOrTabs+0x10>
jmp    1107 <consumeBlanksOrTabs+0x7>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @consumeBlanksOrTabs(i8* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %8
%5 = phi i64 [ %9, %8 ], [ 0, %2 ]
%6 = phi i8* [ %10, %8 ], [ %0, %2 ]
%7 = load i8, i8* %6
switch i8 %7, label %12 [
i8 32, label %8
i8 9, label %8
]
8: ; preds = %4, %4
%9 = add nuw nsw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = icmp eq i64 %9, %1
br i1 %11, label %12, label %4
12: ; preds = %8, %4, %2
%13 = phi i64 [ 0, %2 ], [ %5, %4 ], [ %1, %8 ]
ret i64 %13
}
/* Variables and functions */
void *Func_memmove_nodrain(void *, void const *, size_t);
void *pmem_memmove_nodrain(void *pmemdest, const void *src, size_t len) {
  return Func_memmove_nodrain(pmemdest, src, len);
}


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

x86 assembly (clang, -O2):
<pmem_memmove_nodrain>:
jmp    1030 <Func_memmove_nodrain@plt>

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

LLVM IR (-O2):
define i8* @pmem_memmove_nodrain(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @Func_memmove_nodrain(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int Blue7(int, int);
int /*<<< orphan*/ printf(char *);
extern int Bar7(int one, int two, int stop) {
  int sum = 0;
  if (stop == 0) {
    printf(" Bar7: once\n");
    sum = Blue7(one, two);
  } else {
    printf(" Bar7: twice\n");
    sum = one + two;
  }
  return sum;
}


x86 assembly (clang, -O0):
<Bar7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1161 <Bar7+0x41>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <Blue7@plt>
mov    %eax,-0x10(%rbp)
jmp    1176 <Bar7+0x56>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bar7>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %edx,%edx
je     1142 <Bar7+0x22>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <Blue7@plt>

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

LLVM IR (-O2):
@str = [13 x i8] c" Bar7: twice\00"
@str.2 = [12 x i8] c" Bar7: once\00"
define i32 @Bar7(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%7 = tail call i32 @Blue7(i32 %0, i32 %1)
br label %11
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%10 = add nsw i32 %1, %0
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ]
ret i32 %12
}
void pointerstest() {
  char n[] = "0";
  void *a = &n;
  int b = sizeof(a);
  int c = sizeof(*a);
}


x86 assembly (clang, -O0):
<pointerstest>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.pointerstest.n = [2 x i8] c"0\00"
define void @pointerstest() {
%1 = alloca [2 x i8]
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [2 x i8]* %1 to i8*
%6 = bitcast [2 x i8]* %1 to i8*
store i8* %6, i8** %2
store i32 8, i32* %3
store i32 1, i32* %4
ret void
}

LLVM IR (-O2):
define void @pointerstest() {
ret void
}