xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *xmalloc(int, char *);
char *xstrdup(const char *str) {
  char *new;
  int len;
  len = strlen(str);
  new = xmalloc(len + 1, "xstrdup string");
  memcpy(new, str, len);
  new[len] = '\0';
  return new;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"xstrdup string\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = call i8* @xmalloc(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [15 x i8] c"xstrdup string\00"
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @xmalloc(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %2)
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
int test_imm_F8uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xF8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F8uint64_midword_mem>:
testb  $0xf8,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F8uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 248
%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_F8uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16252928
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun877() { return 877; }


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

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

LLVM IR (-O0):
define i32 @fun877() {
ret i32 877
}

LLVM IR (-O2):
define i32 @fun877() {
ret i32 877
}
int vm_nop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vm_nop() {
ret i32 0
}
void av_new_program() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ui_statusline_draw() {
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
int isDataLine(char *line) {
  int isData = 0;
  if (strlen(line))
    if (line[0] != '#')
      isData = 1;
  return (isData);
}


x86 assembly (clang, -O0):
<isDataLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     1152 <isDataLine+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     114d <isDataLine+0x3d>
movl   $0x1,-0xc(%rbp)
jmp    1152 <isDataLine+0x42>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDataLine>:
mov    (%rdi),%al
test   %al,%al
setne  %cl
cmp    $0x23,%al
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @isDataLine(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 0
%4 = icmp ne i8 %2, 35
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int abs(int /*<<< orphan*/);
int /*<<< orphan*/ rand();
int randu(int a, int b) {
  int r;
  if (a >= b)
    return a;
  r = a + (abs(rand()) % (b - a + 1));
  return r;
}


x86 assembly (clang, -O0):
<randu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1145 <randu+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <randu+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%edi
call   1030 <abs@plt>
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randu>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
sub    %edi,%ebp
jle    1131 <randu+0x21>
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
add    $0x1,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randu(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 = load i32, i32* %5
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %4
store i32 %11, i32* %3
br label %23
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i32 (...) @rand()
%15 = call i32 @abs(i32 %14)
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = sub nsw i32 %16, %17
%19 = add nsw i32 %18, 1
%20 = srem i32 %15, %19
%21 = add nsw i32 %13, %20
store i32 %21, i32* %6
%22 = load i32, i32* %6
store i32 %22, i32* %3
br label %23
23: ; preds = %12, %10
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @randu(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = tail call i32 (...) @rand()
%6 = tail call i32 @llvm.abs.i32(i32 %5, i1 true)
%7 = sub i32 1, %0
%8 = add i32 %7, %1
%9 = srem i32 %6, %8
%10 = add nsw i32 %9, %0
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ %10, %4 ], [ %0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  for (int i = 0; i < 1000000; i++)
    printf("Hello, World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    114d <main+0x3d>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xf4240,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000000
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 1000000
br i1 %6, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage:\n");
  printf("   [-d device] [-r %%rd] [-q qdepth] [-n npool] [-s secs] [-p]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [64 x i8] c" [-d device] [-r %%rd] [-q qdepth] [-n npool] [-s secs] [-p]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [64 x i8] c" [-d device] [-r %%rd] [-q qdepth] [-n npool] [-s secs] [-p]\0A\00"
@str = [7 x i8] c"Usage:\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int function_int(int a, int b) {
  int c;
  c = (a + b) / a * b;
  return c;
}


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

x86 assembly (clang, -O2):
<function_int>:
lea    (%rsi,%rdi,1),%eax
cltd
idiv   %edi
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @function_int(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
%9 = load i32, i32* %3
%10 = sdiv i32 %8, %9
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @function_int(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sdiv i32 %3, %0
%5 = mul nsw i32 %4, %1
ret i32 %5
}
void foo() {
  typedef int Object;
  Object obj;
}


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

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
int exp_a(int x) { return !~x; }


x86 assembly (clang, -O0):
<exp_a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_a>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @exp_a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @exp_a(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
void alsa_UnLockAudioBuffer(void) {}


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

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

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

LLVM IR (-O2):
define void @alsa_UnLockAudioBuffer() {
ret void
}
/* Variables and functions */
char *strchr(const char *p, int ch) {
  char c = ch;
  for (;; ++p) {
    if (*p == c)
      return ((char *)p);
    if (!*p)
      return ((char *)NULL);
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <strchr+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <strchr+0x61>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    114b <strchr+0x4b>
movq   $0x0,-0x8(%rbp)
jmp    1161 <strchr+0x61>
jmp    1150 <strchr+0x50>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1111 <strchr+0x11>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %2
%18 = phi i8* [ %0, %2 ], [ null, %8 ], [ %13, %12 ]
ret i8* %18
}
/* Variables and functions */
scalar_t__ get_unum();
int /*<<< orphan*/ printf(char *, ...);
int read_number(unsigned int *data) {
  int index = 0;
  printf(" Index: ");
  index = (int)get_unum();
  printf(" Number at data[%d] is %u\n", index, data[index]);
  return 0;
}


x86 assembly (clang, -O0):
<read_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <get_unum@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_number>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <get_unum@plt>
movslq %eax,%rsi
mov    (%rbx,%rsi,4),%edx
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c" Index: \00"
@.str.1 = [27 x i8] c" Number at data[%d] is %u\0A\00"
define i32 @read_number(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i64 (...) @get_unum()
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c" Index: \00"
@.str.1 = [27 x i8] c" Number at data[%d] is %u\0A\00"
define i32 @read_number(i32* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 (...) @get_unum()
%4 = trunc i64 %3 to i32
%5 = shl i64 %3, 32
%6 = ashr exact i64 %5, 32
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %8)
ret i32 0
}
void lenz2_to_nmra2(unsigned int lenz, unsigned char port, unsigned int *nmra_a,
                    unsigned char *nmra_p) {
  if (lenz > 0) {
    *nmra_p = ((lenz - 1) % 4) << 1;
    *nmra_p |= port & 0x01;
    *nmra_a = (lenz + 3) >> 2;
  } else {
    *nmra_p = 0;
    *nmra_a = 0;
  }
}


x86 assembly (clang, -O0):
<lenz2_to_nmra2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1159 <lenz2_to_nmra2+0x59>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    $0x3,%eax
shl    $0x1,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x5(%rbp),%edx
and    $0x1,%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
mov    -0x4(%rbp),%ecx
add    $0x3,%ecx
shr    $0x2,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    116a <lenz2_to_nmra2+0x6a>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenz2_to_nmra2>:
test   %edi,%edi
je     111d <lenz2_to_nmra2+0x1d>
and    $0x1,%sil
lea    (%rdi,%rdi,1),%eax
add    $0x6,%al
and    $0x6,%al
or     %sil,%al
mov    %al,(%rcx)
add    $0x3,%edi
shr    $0x2,%edi
mov    %edi,(%rdx)
ret
movb   $0x0,(%rcx)
xor    %edi,%edi
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @lenz2_to_nmra2(i32 %0, i8 zeroext %1, i32* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32*
%8 = alloca i8*
store i32 %0, i32* %5
store i8 %1, i8* %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = icmp ugt i32 %9, 0
br i1 %10, label %11, label %30
11: ; preds = %4
%12 = load i32, i32* %5
%13 = sub i32 %12, 1
%14 = urem i32 %13, 4
%15 = shl i32 %14, 1
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %8
store i8 %16, i8* %17
%18 = load i8, i8* %6
%19 = zext i8 %18 to i32
%20 = and i32 %19, 1
%21 = load i8*, i8** %8
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %23, %20
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
%26 = load i32, i32* %5
%27 = add i32 %26, 3
%28 = lshr i32 %27, 2
%29 = load i32*, i32** %7
store i32 %28, i32* %29
br label %33
30: ; preds = %4
%31 = load i8*, i8** %8
store i8 0, i8* %31
%32 = load i32*, i32** %7
store i32 0, i32* %32
br label %33
33: ; preds = %30, %11
ret void
}

LLVM IR (-O2):
define void @lenz2_to_nmra2(i32 %0, i8 zeroext %1, i32* nocapture writeonly %2, i8* nocapture writeonly %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %15, label %6
6: ; preds = %4
%7 = and i8 %1, 1
%8 = trunc i32 %0 to i8
%9 = shl i8 %8, 1
%10 = add i8 %9, 6
%11 = and i8 %10, 6
%12 = or i8 %11, %7
store i8 %12, i8* %3
%13 = add i32 %0, 3
%14 = lshr i32 %13, 2
br label %16
15: ; preds = %4
store i8 0, i8* %3
br label %16
16: ; preds = %15, %6
%17 = phi i32 [ 0, %15 ], [ %14, %6 ]
store i32 %17, i32* %2
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t ne_int16_t(int16_t a, int16_t b) { return a != b; }


x86 assembly (clang, -O0):
<ne_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_int16_t>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @ne_int16_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ne_int16_t(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
__attribute__((always_)) void invlpg(void *vAddr) {
  asm volatile("invlpg (%0)" : : "r"(vAddr) : "memory");
}


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

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

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

LLVM IR (-O2):
define void @invlpg(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct list *);
int /*<<< orphan*/ list_clear(struct list *);
void list_free(struct list *list) {
  list_clear(list);
  free(list);
}


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

x86 assembly (clang, -O2):
<list_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_free(%struct.list* %0) {
%2 = tail call i32 @list_clear(%struct.list* %0)
%3 = tail call i32 @free(%struct.list* %0)
ret void
}
void view_hotel_power(void) {}


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

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

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

LLVM IR (-O2):
define void @view_hotel_power() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_pmu_sar_override(int);
void flash_turn_off() { set_pmu_sar_override(47); }


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

x86 assembly (clang, -O2):
<flash_turn_off>:
mov    $0x2f,%edi
jmp    1030 <set_pmu_sar_override@plt>

LLVM IR (-O0):
define void @flash_turn_off() {
%1 = call i32 @set_pmu_sar_override(i32 47)
ret void
}

LLVM IR (-O2):
define void @flash_turn_off() {
%1 = tail call i32 @set_pmu_sar_override(i32 47)
ret void
}
const char *jac_chain_nm4_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<jac_chain_nm4_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <jac_chain_nm4_name_in+0x2b>
jmp    111a <jac_chain_nm4_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <jac_chain_nm4_name_in+0x3b>
jmp    114b <jac_chain_nm4_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jac_chain_nm4_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jac_chain_nm4_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm4_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @jac_chain_nm4_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @jac_chain_nm4_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
int unarg() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @unarg() {
ret i32 0
}
int ub_dirty_limits(unsigned long *pbackground, long *pdirty,
                    struct user_beancounter *ub) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.user_beancounter = type opaque
define i32 @ub_dirty_limits(i64* nocapture readnone %0, i64* nocapture readnone %1, %struct.user_beancounter* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t cpuid_extended() {
  uint32_t out;
  asm("mov $0x80000000, %%eax\n\t"
      "cpuid"
      : "=a"(out));
  return out;
}


x86 assembly (clang, -O0):
<cpuid_extended>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000000,%eax
cpuid
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_extended>:
mov    $0x80000000,%eax
cpuid
ret

LLVM IR (-O0):
define i8* @cpuid_extended() {
%1 = alloca i8*
%2 = call i8* asm "mov $$0x80000000, %eax\0A\09cpuid", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @cpuid_extended() {
%1 = tail call i8* asm "mov $$0x80000000, %eax\0A\09cpuid", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
int fun726() { return 726; }


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

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

LLVM IR (-O0):
define i32 @fun726() {
ret i32 726
}

LLVM IR (-O2):
define i32 @fun726() {
ret i32 726
}
void g(int malloc) { int calloc = 1; }


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

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

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

LLVM IR (-O2):
define void @g(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ rec(int *, int /*<<< orphan*/, int, int, int);
void combina(int n, int k) {
  int *s;
  s = (int *)malloc((n + 1) * sizeof(int));
  rec(s, 0, 1, k, n);
  free(s);
}


x86 assembly (clang, -O0):
<combina>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r8d
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <rec@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combina>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x4(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
call   1050 <rec@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @combina(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 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %5
%13 = load i32*, i32** %5
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = call i32 @rec(i32* %13, i32 0, i32 1, i32 %14, i32 %15)
%17 = load i32*, i32** %5
%18 = call i32 @free(i32* %17)
ret void
}

LLVM IR (-O2):
define void @combina(i32 %0, i32 %1) {
%3 = shl i32 %0, 2
%4 = add i32 %3, 4
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @rec(i32* %6, i32 0, i32 1, i32 %1, i32 %0)
%8 = tail call i32 @free(i32* %6)
ret void
}
void *thread_function(void *arg) {
  asm("    .global "
      "set_point1"
      "\n"
      "set_point1"
      ":\n"
      "    call "
      "func"
      "\n");
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)

x86 assembly (clang, -O2):
<thread_function>:
call   1030 <func@plt>
ret

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

LLVM IR (-O2):
define i8* @thread_function(i8* nocapture readnone %0) {
tail call void asm sideeffect " .global set_point1\0Aset_point1:\0A call func\0A", "~{dirflag},~{fpsr},~{flags}"()
ret i8* undef
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ free(char *);
char *omb_utils_read(char const *);
int omb_utils_read_int(const char *key) {
  char *tmp = omb_utils_read(key);
  if (tmp) {
    int ret = atoi(tmp);
    free(tmp);
    return ret;
  }
  return 0;
}


x86 assembly (clang, -O0):
<omb_utils_read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <omb_utils_read@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1174 <omb_utils_read_int+0x44>
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <omb_utils_read_int+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omb_utils_read_int>:
push   %rbp
push   %rbx
push   %rax
call   1040 <omb_utils_read@plt>
test   %rax,%rax
je     1156 <omb_utils_read_int+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    1158 <omb_utils_read_int+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @omb_utils_read_int(i8* %0) {
%2 = tail call i8* @omb_utils_read(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printName(char *name, int len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("%c", name[i]);
  }
}


x86 assembly (clang, -O0):
<printName>:
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    1158 <printName+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printName+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printName>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <printName+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printName+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @printName(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %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 i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %15)
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
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printName(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_simdate(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void fgmvwrite_simdate_(char simdate[]) {
  char name[10];
  strncpy(name, simdate, 8);
  *(name + 8) = '\0';
  gmvwrite_simdate(name);
}


x86 assembly (clang, -O0):
<fgmvwrite_simdate_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0xa(%rbp)
lea    -0x12(%rbp),%rdi
call   1040 <gmvwrite_simdate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_simdate_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xe(%rsp)
mov    %rbx,%rdi
call   1040 <gmvwrite_simdate@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fgmvwrite_simdate_(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 8)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds i8, i8* %7, i64 8
store i8 0, i8* %8
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @gmvwrite_simdate(i8* %9)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_simdate_(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 8)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 8
store i8 0, i8* %5
%6 = call i32 @gmvwrite_simdate(i8* %3)
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=401 REPO_URL=heads/master "
         "REVISION=r4p0-00rel0-v0.90-6-ge76cdd8 "
         "CHANGED_REVISION=v0.90-6-ge76cdd8 CHANGE_DATE=2014-01-08 17:23:04 "
         "+0800 BUILD_DATE=2014年 01月 13日 星期一 15:56:14 CST BUILD=release "
         "TARGET_PLATFORM= MALI_PLATFORM=mali450 KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [450 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/master REVISION=r4p0-00rel0-v0.90-6-ge76cdd8 CHANGED_REVISION=v0.90-6-ge76cdd8 CHANGE_DATE=2014-01-08 17:23:04 +0800 BUILD_DATE=2014\E5\B9\B4 01\E6\9C\88 13\E6\97\A5 \E6\98\9F\E6\9C\9F\E4\B8\80 15:56:14 CST BUILD=release TARGET_PLATFORM= MALI_PLATFORM=mali450 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([450 x i8], [450 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [450 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/master REVISION=r4p0-00rel0-v0.90-6-ge76cdd8 CHANGED_REVISION=v0.90-6-ge76cdd8 CHANGE_DATE=2014-01-08 17:23:04 +0800 BUILD_DATE=2014\E5\B9\B4 01\E6\9C\88 13\E6\97\A5 \E6\98\9F\E6\9C\9F\E4\B8\80 15:56:14 CST BUILD=release TARGET_PLATFORM= MALI_PLATFORM=mali450 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([450 x i8], [450 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test82_ArrayReturnErr_foo__E();
void test82_TestProg_pollen__run__E() {
  test82_ArrayReturnErr_foo__E();
  exit(0);
}


x86 assembly (clang, -O0):
<test82_TestProg_pollen__run__E>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test82_ArrayReturnErr_foo__E@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<test82_TestProg_pollen__run__E>:
push   %rax
xor    %eax,%eax
call   1030 <test82_ArrayReturnErr_foo__E@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @test82_TestProg_pollen__run__E() {
%1 = call i32 (...) @test82_ArrayReturnErr_foo__E()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @test82_TestProg_pollen__run__E() {
%1 = tail call i32 (...) @test82_ArrayReturnErr_foo__E()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
size_t memmgr_usage();
size_t malloc_usage(void) { return memmgr_usage(); }


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

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

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

LLVM IR (-O2):
define i64 @malloc_usage() {
%1 = tail call i64 (...) @memmgr_usage()
ret i64 %1
}
void ctl_panning(int channel, int val) {}


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

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

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

LLVM IR (-O2):
define void @ctl_panning(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_set_profile_space(uint8_t *p, uint8_t val) {
  p[1] &= ~0xc0;
  p[1] |= val << 6;
}


x86 assembly (clang, -O0):
<h265hvcc_set_profile_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
and    $0xffffff3f,%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
or     0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_set_profile_space>:
mov    $0xffffff3f,%eax
and    0x4(%rdi),%eax
shl    $0x6,%esi
or     %eax,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_profile_space(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 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = and i32 %7, -193
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 6
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_profile_space(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = and i32 %4, -193
%6 = shl i32 %1, 6
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  printf("Hello, world!\n");
  return 0;
}


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)
lea    0xed3(%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>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\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 = load i8**, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lcd_set_type_command();
int /*<<< orphan*/ lcd_write_byte(int);
void nklcd_on() {
  lcd_set_type_command();
  lcd_write_byte(0x08 | 0x04);
}


x86 assembly (clang, -O0):
<nklcd_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lcd_set_type_command@plt>
mov    $0xc,%edi
call   1040 <lcd_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nklcd_on>:
push   %rax
xor    %eax,%eax
call   1030 <lcd_set_type_command@plt>
mov    $0xc,%edi
pop    %rax
jmp    1040 <lcd_write_byte@plt>

LLVM IR (-O0):
define void @nklcd_on() {
%1 = call i32 (...) @lcd_set_type_command()
%2 = call i32 @lcd_write_byte(i32 12)
ret void
}

LLVM IR (-O2):
define void @nklcd_on() {
%1 = tail call i32 (...) @lcd_set_type_command()
%2 = tail call i32 @lcd_write_byte(i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ksft_test_result_error(char *);
scalar_t__ setns(int, int);
int switch_ns(int fd) {
  if (setns(fd, 0x00000080)) {
    ({
      ksft_test_result_error("setns()"
                             ": %m"
                             "\n");
      -1;
    });
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<switch_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x80,%esi
call   1030 <setns@plt>
cmp    $0x0,%rax
je     1161 <switch_ns+0x41>
lea    0xeb7(%rip),%rdi
call   1040 <ksft_test_result_error@plt>
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <switch_ns+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_ns>:
push   %rax
mov    $0x80,%esi
call   1030 <setns@plt>
test   %rax,%rax
je     1143 <switch_ns+0x23>
lea    0xec9(%rip),%rdi
call   1040 <ksft_test_result_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"setns(): %m\0A\00"
define i32 @switch_ns(i32 %0) {
%2 = tail call i64 @setns(i32 %0, i32 128)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @ksft_test_result_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}