xunge/DecIR huggingface dataset:
int func2(int i) {
  printf("%s\n", __func__);
  i++;
  return func1(i);
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <func1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%ebx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <func1@plt>

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

LLVM IR (-O2):
@__func__.func2 = [6 x i8] c"func2\00"
define i32 @func2(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.func2, i64 0, i64 0))
%3 = add nsw i32 %0, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @func1 to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ calc();
int /*<<< orphan*/ reply();
int main() {
  reply();
  calc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @reply()
%2 = tail call i32 (...) @calc()
ret i32 0
}
int bitops_isset(unsigned char *val, int bit) {
  int pos = bit / 8;
  int idx = bit % 8;
  return ((val[pos] & (1 << idx)) != 0);
}


x86 assembly (clang, -O0):
<bitops_isset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitops_isset>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bitops_isset(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 8
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = srem i32 %9, 8
store i32 %10, i32* %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 = zext i8 %15 to i32
%17 = load i32, i32* %6
%18 = shl i32 1, %17
%19 = and i32 %16, %18
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @bitops_isset(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("%15.15f\n", 0.05 + 0.01);
  printf("%15.15f\n", 1.0 - 0.42);
  printf("%15.15f\n", 4.015 * 100);
  printf("%15.15f\n", 123.3 / 100);
  printf("%15.15f\n", 2.4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf02(%rip),%rdi
movsd  0xef2(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
movsd  0xed6(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
movsd  0xeba(%rip),%xmm0
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
movsd  0xe82(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf10(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xec8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xec0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%15.15f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x3FAEB851EB851EB9)
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x3FE28F5C28F5C290)
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x407917FFFFFFFFFF)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x3FF3BA5E353F7CED)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 2.400000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%15.15f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x3FAEB851EB851EB9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x3FE28F5C28F5C290)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x407917FFFFFFFFFF)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x3FF3BA5E353F7CED)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 2.400000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  printf("hi %d\n");
  printf("hi %d %s\n", 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hi %d\0A\00"
@.str.1 = [10 x i8] c"hi %d %s\0A\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hi %d\0A\00"
@.str.1 = [10 x i8] c"hi %d %s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}
int convert_code(char *s) {
  return (((s[0] - '0') * 1000) + ((s[1] - '0') * 100) + ((s[2] - '0') * 10) +
          ((s[3] - '0')));
}


x86 assembly (clang, -O0):
<convert_code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0x3e8,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
imul   $0x64,%ecx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
sub    $0x30,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_code>:
movsbl (%rdi),%eax
imul   $0x3e8,%eax,%eax
movsbl 0x1(%rdi),%ecx
imul   $0x64,%ecx,%ecx
add    %eax,%ecx
movsbl 0x2(%rdi),%eax
lea    (%rax,%rax,4),%eax
movsbl 0x3(%rdi),%edx
lea    (%rcx,%rax,2),%eax
add    %edx,%eax
add    $0xffff2fb0,%eax
ret

LLVM IR (-O0):
define i32 @convert_code(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 48
%8 = mul nsw i32 %7, 1000
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = mul nsw i32 %13, 100
%15 = add nsw i32 %8, %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 48
%21 = mul nsw i32 %20, 10
%22 = add nsw i32 %15, %21
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 48
%28 = add nsw i32 %22, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @convert_code(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = mul nsw i32 %7, 100
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = mul nsw i32 %11, 10
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = add nsw i32 %4, -53328
%17 = add nsw i32 %16, %8
%18 = add nsw i32 %17, %12
%19 = add nsw i32 %18, %15
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void endwait() { exit(0); }


x86 assembly (clang, -O0):
<endwait>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

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

LLVM IR (-O2):
define void @endwait() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
const char *strnull(const char *s) { return s ? s : "(null)"; }


x86 assembly (clang, -O0):
<strnull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <strnull+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <strnull+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <strnull+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnull>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define i8* @strnull(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
scalar_t__ malloc(int);
void main() {
  char *p = (char *)malloc(100);
  int i;
  for (i = 10; i < 100; i++)
    p[i] = 0;
  int *jp = (int *)p;
  jp[2] = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1151 <main+0x41>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <malloc@plt>
xorps  %xmm0,%xmm0
movups %xmm0,0xa(%rax)
movups %xmm0,0x1a(%rax)
movups %xmm0,0x2a(%rax)
movups %xmm0,0x3a(%rax)
movups %xmm0,0x4a(%rax)
movups %xmm0,0x54(%rax)
movl   $0x0,0x8(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 @malloc(i32 100)
%2 = inttoptr i64 %1 to i8*
%3 = getelementptr i8, i8* %2, i64 10
%4 = inttoptr i64 %1 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 2
store i32 0, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t multiply_accumulate_32x32_rshift32_rounded(int32_t sum, int32_t a,
                                                   int32_t b) {}


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

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

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

LLVM IR (-O2):
define i32 @multiply_accumulate_32x32_rshift32_rounded(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
int dummy_detect(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dummy_detect() {
ret i32 0
}
int eg_value(int s) {
  return (int)((unsigned)s & 0x7fffu) - (int)((unsigned)s & 0x8000u);
}


x86 assembly (clang, -O0):
<eg_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fff,%eax
mov    -0x4(%rbp),%ecx
and    $0x8000,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eg_value>:
mov    %edi,%eax
and    $0x7fff,%eax
and    $0x8000,%edi
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @eg_value(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32767
%5 = load i32, i32* %2
%6 = and i32 %5, 32768
%7 = sub nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @eg_value(i32 %0) {
%2 = and i32 %0, 32767
%3 = and i32 %0, 32768
%4 = sub nsw i32 %2, %3
ret i32 %4
}
int func() { return 4; }


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

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

LLVM IR (-O0):
define i32 @func() {
ret i32 4
}

LLVM IR (-O2):
define i32 @func() {
ret i32 4
}
/* Type definitions */
struct nlattr {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
scalar_t__ nla_data(struct nlattr const *);
__u8 nla_get_u8(const struct nlattr *nla) { return *(__u8 *)nla_data(nla); }


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

x86 assembly (clang, -O2):
<nla_get_u8>:
push   %rax
call   1030 <nla_data@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_get_u8(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = call i64 @nla_data(%struct.nlattr* %3)
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_get_u8(%struct.nlattr* %0) {
%2 = tail call i64 @nla_data(%struct.nlattr* %0)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
void dgram_adjust_rcv_timeout(BIO *b) {}


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

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

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

LLVM IR (-O2):
define void @dgram_adjust_rcv_timeout(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int32_t mulRL(int left, uint32_t inRL, uint32_t vRL) {
  if (left) {
    return (int16_t)(inRL & 0xFFFF) * (int16_t)(vRL & 0xFFFF);
  } else {
    return (int16_t)(inRL >> 16) * (int16_t)(vRL >> 16);
  }
}


x86 assembly (clang, -O0):
<mulRL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1133 <mulRL+0x33>
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
mov    -0x10(%rbp),%ecx
and    $0xffff,%ecx
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <mulRL+0x45>
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulRL>:
mov    %edx,%eax
test   %edi,%edi
je     1110 <mulRL+0x10>
movzwl %si,%ecx
movzwl %ax,%eax
imul   %ecx,%eax
ret
sar    $0x10,%esi
sar    $0x10,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @mulRL(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %6
%12 = and i32 %11, 65535
%13 = load i32, i32* %7
%14 = and i32 %13, 65535
%15 = mul nsw i32 %12, %14
store i32 %15, i32* %4
br label %22
16: ; preds = %3
%17 = load i32, i32* %6
%18 = ashr i32 %17, 16
%19 = load i32, i32* %7
%20 = ashr i32 %19, 16
%21 = mul nsw i32 %18, %20
store i32 %21, i32* %4
br label %22
22: ; preds = %16, %10
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @mulRL(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = and i32 %1, 65535
%7 = and i32 %2, 65535
%8 = mul nuw nsw i32 %7, %6
br label %13
9: ; preds = %3
%10 = ashr i32 %1, 16
%11 = ashr i32 %2, 16
%12 = mul nsw i32 %11, %10
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
ret i32 %14
}
long hashmap_hash_cstring(void *in_context, void *in_key) {
  unsigned long hash = 5381;
  int c;
  while ((c = *((unsigned char *)in_key++))) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hashmap_hash_cstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     114e <hashmap_hash_cstring+0x4e>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <hashmap_hash_cstring+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmap_hash_cstring>:
mov    (%rsi),%cl
test   %cl,%cl
je     112c <hashmap_hash_cstring+0x2c>
add    $0x1,%rsi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <hashmap_hash_cstring+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hashmap_hash_cstring(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i64 [ %12, %5 ], [ 5381, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i64 %8, 33
%11 = zext i8 %6 to i64
%12 = add i64 %10, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 5381, %2 ], [ %12, %5 ]
ret i64 %16
}
int test_imm_4Buint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x4B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Buint64_highword_reg>:
movabs $0x4b00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Buint64_highword_reg(i64 %0) {
%2 = and i64 %0, 322122547200
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void *a_cas_p(volatile void *p, void *t, void *s) {
  __asm__("lock ; .byte 0x67\n\tcmpxchg %3, %1"
          : "=a"(t), "=m"(*(long *)p)
          : "a"(t), "r"(s)
          : "memory");
  return t;
}


x86 assembly (clang, -O0):
<a_cas_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%ecx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas_p>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%edi)
ret

LLVM IR (-O0):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i64*
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i8* asm "lock ; .byte 0x67\0A\09cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %8, i8* %9, i8* %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %0 to i64*
%5 = tail call i8* asm "lock ; .byte 0x67\0A\09cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %4, i8* %1, i8* %2)
ret i8* %5
}
/* Variables and functions */
int strcmp(char const *, char const *);
int line_cmp(const void *arg1, const void *arg2) {
  return strcmp(*(const char **)arg1, *(const char **)arg2);
}


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

x86 assembly (clang, -O2):
<line_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @line_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @line_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void caller_1_1_2_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_2_2_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int MPI_Irecv(void *buf, int count, int datatype, int source, int tag, int comm,
              int *request) {
  static int callcount = 0;
  if (callcount == 0) {
    printf("MPI Stub WARNING: Should not recv message from self\n");
    ++callcount;
  }
  return 0;
}


x86 assembly (clang, -O0):
<MPI_Irecv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x0,0x2ef4(%rip)
jne    1159 <MPI_Irecv+0x49>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2edc(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed3(%rip)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Irecv>:
push   %rax
cmpl   $0x0,0x2f14(%rip)
jne    112d <MPI_Irecv+0x1d>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
addl   $0x1,0x2eff(%rip)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@MPI_Irecv.callcount = internal global i32 0
@.str = [53 x i8] c"MPI Stub WARNING: Should not recv message from self\0A\00"
define i32 @MPI_Irecv(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32* %6, i32** %14
%15 = load i32, i32* @MPI_Irecv.callcount
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %7
%18 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @MPI_Irecv.callcount
%20 = add nsw i32 %19, 1
store i32 %20, i32* @MPI_Irecv.callcount
br label %21
21: ; preds = %17, %7
ret i32 0
}

LLVM IR (-O2):
@MPI_Irecv.callcount = internal unnamed_addr global i32 0
@str = [52 x i8] c"MPI Stub WARNING: Should not recv message from self\00"
define i32 @MPI_Irecv(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* nocapture readnone %6) {
%8 = load i32, i32* @MPI_Irecv.callcount
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* @MPI_Irecv.callcount
%13 = add nsw i32 %12, 1
store i32 %13, i32* @MPI_Irecv.callcount
br label %14
14: ; preds = %10, %7
ret i32 0
}
/* Variables and functions */
int inportb(int);
int /*<<< orphan*/ outportb(int, int);
void fd_sendbyte(int count) {
  for (int tmo = 0; tmo < 128; tmo++) {
    int msr = inportb((0x3f4));
    if ((msr & 0xc0) == 0x80) {
      outportb((0x3f5), count);
      return;
    }
    inportb(0x80);
  }
}


x86 assembly (clang, -O0):
<fd_sendbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1189 <fd_sendbyte+0x69>
mov    $0x3f4,%edi
call   1030 <inportb@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1171 <fd_sendbyte+0x51>
mov    -0x4(%rbp),%esi
mov    $0x3f5,%edi
call   1040 <outportb@plt>
jmp    1189 <fd_sendbyte+0x69>
mov    $0x80,%edi
call   1030 <inportb@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <fd_sendbyte+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_sendbyte>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x80,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x3f4,%edi
call   1030 <inportb@plt>
and    $0xc0,%eax
cmp    $0x80,%eax
je     115c <fd_sendbyte+0x3c>
mov    $0x80,%edi
call   1030 <inportb@plt>
add    $0xffffffff,%ebp
jne    1130 <fd_sendbyte+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x3f5,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <outportb@plt>

LLVM IR (-O0):
define void @fd_sendbyte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 128
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = call i32 @inportb(i32 1012)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = and i32 %10, 192
%12 = icmp eq i32 %11, 128
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* %2
%15 = call i32 @outportb(i32 1013, i32 %14)
br label %21
16: ; preds = %8
%17 = call i32 @inportb(i32 128)
br label %18
18: ; preds = %16
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %13, %5
ret void
}

LLVM IR (-O2):
define void @fd_sendbyte(i32 %0) {
br label %2
2: ; preds = %1, %9
%3 = phi i32 [ 0, %1 ], [ %11, %9 ]
%4 = tail call i32 @inportb(i32 1012)
%5 = and i32 %4, 192
%6 = icmp eq i32 %5, 128
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @outportb(i32 1013, i32 %0)
br label %13
9: ; preds = %2
%10 = tail call i32 @inportb(i32 128)
%11 = add nuw nsw i32 %3, 1
%12 = icmp eq i32 %11, 128
br i1 %12, label %13, label %2
13: ; preds = %9, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ putchar(int /*<<< orphan*/);
void get_name(void) {
  char nume[20];
  printf("What's your name? %c ", 16);
  gets(nume);
  char *n = nume;
  while (putchar(*n++))
    ;
}


x86 assembly (clang, -O0):
<get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
mov    $0x10,%esi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
cmp    $0x0,%rax
je     1180 <get_name+0x50>
jmp    115a <get_name+0x2a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_name>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
lea    0xec1(%rip),%rdi
mov    $0x10,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
add    $0x1,%rbx
call   1030 <putchar@plt>
test   %rax,%rax
jne    1160 <get_name+0x30>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"What's your name? %c \00"
define void @get_name() {
%1 = alloca [20 x i8]
%2 = alloca i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 16)
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
store i8* %6, i8** %2
br label %7
7: ; preds = %14, %0
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i64 @putchar(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %7
br label %7
15: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"What's your name? %c \00"
define void @get_name() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 16)
%4 = call i32 @gets(i8* %2)
br label %5
5: ; preds = %5, %0
%6 = phi i8* [ %2, %0 ], [ %7, %5 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = call i64 @putchar(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ canvas_xy(char *);
int /*<<< orphan*/ clr_scrn();
int /*<<< orphan*/ make_rot(double, double);
int /*<<< orphan*/ set_linestyle(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, double, double);
void redraw_cube_pt(double theta, double phi) {
  char bob[50];
  set_linestyle(0);
  make_rot(theta, phi);
  clr_scrn();
  sprintf(bob, "theta=%g phi=%g", theta, phi);
  canvas_xy(bob);
}


x86 assembly (clang, -O0):
<redraw_cube_pt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xor    %edi,%edi
call   1030 <set_linestyle@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <make_rot@plt>
mov    $0x0,%al
call   1040 <clr_scrn@plt>
lea    -0x50(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe6c(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1060 <canvas_xy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw_cube_pt>:
push   %rbx
sub    $0x50,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
xor    %edi,%edi
call   1030 <set_linestyle@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1050 <make_rot@plt>
xor    %eax,%eax
call   1040 <clr_scrn@plt>
lea    0xe7b(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1060 <canvas_xy@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"theta=%g phi=%g\00"
define void @redraw_cube_pt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca [50 x i8]
store double %0, double* %3
store double %1, double* %4
%6 = call i32 @set_linestyle(i32 0)
%7 = load double, double* %3
%8 = load double, double* %4
%9 = call i32 @make_rot(double %7, double %8)
%10 = call i32 (...) @clr_scrn()
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %12, double %13)
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%16 = call i32 @canvas_xy(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"theta=%g phi=%g\00"
define void @redraw_cube_pt(double %0, double %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @set_linestyle(i32 0)
%6 = tail call i32 @make_rot(double %0, double %1)
%7 = tail call i32 (...) @clr_scrn()
%8 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %0, double %1)
%9 = call i32 @canvas_xy(i8* %4)
ret void
}
/* Variables and functions */
int f375(int *);
int f376(int *p) { return f375(p); }


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

x86 assembly (clang, -O2):
<f376>:
jmp    1030 <f375@plt>

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

LLVM IR (-O2):
define i32 @f376(i32* %0) {
%2 = tail call i32 @f375(i32* %0)
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
scalar_t__ write(int, char *, int);
int qSocketPuts(char *str, int sockfd) {
  if (write(sockfd, str, strlen(str)) < 0)
    return 0;
  if (write(sockfd, "\r\n", 2) < 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<qSocketPuts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    116a <qSocketPuts+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    119b <qSocketPuts+0x7b>
mov    -0x14(%rbp),%edi
lea    0xe8c(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1194 <qSocketPuts+0x74>
movl   $0x0,-0x4(%rbp)
jmp    119b <qSocketPuts+0x7b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qSocketPuts>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %rax,%rax
js     115a <qSocketPuts+0x3a>
lea    0xebb(%rip),%rsi
mov    %ebp,%edi
mov    $0x2,%edx
call   1030 <write@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
jmp    115c <qSocketPuts+0x3c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @qSocketPuts(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @write(i32 %1, i8* %0, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i64 @write(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%8 = lshr i64 %7, 63
%9 = trunc i64 %8 to i32
%10 = xor i32 %9, 1
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void input_path() { printf("input_path\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"input_path\00"
define void @input_path() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(float, float, int /*<<< orphan*/, int);
void glWindowPos2f(float x, float y) { glWindowPos4f(x, y, 0, 1); }


x86 assembly (clang, -O0):
<glWindowPos2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos2f>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos2f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 @glWindowPos4f(float %5, float %6, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @glWindowPos2f(float %0, float %1) {
%3 = tail call i32 @glWindowPos4f(float %0, float %1, i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
void init() {
  glEnable(GL_DEPTH_TEST);
  glClearColor(0.0, 0.5, 0.0, 0.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
xorps  %xmm3,%xmm3
movsd  0xea3(%rip),%xmm1
movaps %xmm3,%xmm0
movaps %xmm3,%xmm2
call   1060 <glClearColor@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1070 <glLoadIdentity@plt>
xorps  %xmm2,%xmm2
movsd  0xe68(%rip),%xmm5
movsd  0xe68(%rip),%xmm4
movaps %xmm2,%xmm0
movaps %xmm5,%xmm1
movaps %xmm5,%xmm3
call   1050 <glOrtho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
movsd  0xe99(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1060 <glClearColor@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1070 <glLoadIdentity@plt>
movsd  0xe76(%rip),%xmm4
movsd  0xe76(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm3
movaps %xmm1,%xmm5
pop    %rax
jmp    1050 <glOrtho@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_PROJECTION = global i32 0
define void @init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = call i32 @glEnable(i32 %1)
%3 = call i32 @glClearColor(double 0.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00)
%4 = load i32, i32* @GL_PROJECTION
%5 = call i32 @glMatrixMode(i32 %4)
%6 = call i32 (...) @glLoadIdentity()
%7 = call i32 @glOrtho(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_PROJECTION = global i32 0
define void @init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = tail call i32 @glEnable(i32 %1)
%3 = tail call i32 @glClearColor(double 0.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @glOrtho(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int c) {
  return isdigit(c) || (((c) <= (0x46)) && ((c) >= (0x41))) ||
         (((c) <= (0x66)) && ((c) >= (0x61)));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <isxdigit+0x5d>
cmpl   $0x46,-0x4(%rbp)
jg     114e <isxdigit+0x3e>
mov    $0x1,%al
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    116d <isxdigit+0x5d>
xor    %eax,%eax
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jg     1167 <isxdigit+0x57>
cmpl   $0x61,-0x4(%rbp)
setge  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 70
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sge i32 %10, 65
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 102
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sge i32 %16, 97
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
m() { test(10); }


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

x86 assembly (clang, -O2):
<m>:
mov    $0xa,%edi
jmp    1030 <test@plt>

LLVM IR (-O0):
define i32 @m() {
%1 = alloca i32
%2 = call i32 @test(i32 10)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @m() {
%1 = tail call i32 @test(i32 10)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char const);
main() {
  char *pk;
  const char *p;
  const char c = 'a';
  char c1 = 'b';
  p = &c1;
  pk = &c;
  printf("%c %c", *pk, *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0x61,-0x11(%rbp)
movb   $0x62,-0x12(%rbp)
lea    -0x12(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x11(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xebf(%rip),%rdi
movsbl %cl,%esi
movsbl (%rax),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x61,%esi
mov    $0x62,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%c %c\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8 97, i8* %3
store i8 98, i8* %4
store i8* %4, i8** %2
store i8* %3, i8** %1
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c %c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 97, i8 signext 98)
ret i32 0
}