xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ft_free(void *a) {
  free(a);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @ft_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
char Swap_Bits(char data) {
  char result = 0;
  char finalresult = 0;
  for (char i = 0; i <= 7; ++i) {
    if (data & 1 << i)
      result += (256 >> (i + 1));
  }
  finalresult = 0x0F & (result >> 4);
  finalresult += (0xF0 & (result << 4));
  return finalresult;
}


x86 assembly (clang, -O0):
<Swap_Bits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
movb   $0x0,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
cmp    $0x7,%eax
jg     116a <Swap_Bits+0x6a>
movsbl -0x1(%rbp),%eax
movsbl -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1158 <Swap_Bits+0x58>
movsbl -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    $0x100,%eax
sar    %cl,%eax
mov    %eax,%ecx
movsbl -0x2(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x2(%rbp)
jmp    115d <Swap_Bits+0x5d>
mov    -0x4(%rbp),%al
add    $0x1,%al
mov    %al,-0x4(%rbp)
jmp    1116 <Swap_Bits+0x16>
movsbl -0x2(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%ecx
shl    $0x4,%ecx
and    $0xf0,%ecx
movsbl -0x3(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap_Bits>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
rol    $0x4,%al
ret

LLVM IR (-O0):
define signext i8 @Swap_Bits(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
store i8 0, i8* %4
store i8 0, i8* %5
br label %6
6: ; preds = %28, %1
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 7
br i1 %9, label %10, label %31
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = shl i32 1, %14
%16 = and i32 %12, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %10
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = add nsw i32 %20, 1
%22 = ashr i32 256, %21
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = add nsw i32 %24, %22
%26 = trunc i32 %25 to i8
store i8 %26, i8* %3
br label %27
27: ; preds = %18, %10
br label %28
28: ; preds = %27
%29 = load i8, i8* %5
%30 = add i8 %29, 1
store i8 %30, i8* %5
br label %6
31: ; preds = %6
%32 = load i8, i8* %3
%33 = sext i8 %32 to i32
%34 = ashr i32 %33, 4
%35 = and i32 15, %34
%36 = trunc i32 %35 to i8
store i8 %36, i8* %4
%37 = load i8, i8* %3
%38 = sext i8 %37 to i32
%39 = shl i32 %38, 4
%40 = and i32 240, %39
%41 = load i8, i8* %4
%42 = sext i8 %41 to i32
%43 = add nsw i32 %42, %40
%44 = trunc i32 %43 to i8
store i8 %44, i8* %4
%45 = load i8, i8* %4
ret i8 %45
}

LLVM IR (-O2):
define signext i8 @Swap_Bits(i8 signext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 4)
ret i8 %3
}
void outw(unsigned short port, unsigned short value) {
  asm volatile("outw %%ax,%%dx" ::"d"(port), "a"(value));
}


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

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

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

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw %ax,%dx", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, unsigned long);
void *xmalloc(size_t size) {
  void *r = malloc(size);
  if (r == NULL) {
    printf("[ERR] Not enough memory to xmalloc %lu\n", (unsigned long)size);
    exit(0);
  }
  return r;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <xmalloc+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"[ERR] Not enough memory to xmalloc %lu\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [40 x i8] c"[ERR] Not enough memory to xmalloc %lu\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ctrl_inw(int);
void delay(void) { ctrl_inw(0xa0000000); }


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

x86 assembly (clang, -O2):
<delay>:
mov    $0xa0000000,%edi
jmp    1030 <ctrl_inw@plt>

LLVM IR (-O0):
define void @delay() {
%1 = call i32 @ctrl_inw(i32 -1610612736)
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = tail call i32 @ctrl_inw(i32 -1610612736)
ret void
}
/* Variables and functions */
void *cpu_cpy(void *, void const *, size_t);
void *mmx_cpy(void *dest, const void *src, size_t n) {
  return cpu_cpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<mmx_cpy>:
jmp    1030 <cpu_cpy@plt>

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

LLVM IR (-O2):
define i8* @mmx_cpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @cpu_cpy(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
void script_mouse_end() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ARGBMirrorRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __syscall(int, int);
void syncfs(int fd) { __syscall(373, fd); }


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

x86 assembly (clang, -O2):
<syncfs>:
mov    %edi,%esi
mov    $0x175,%edi
jmp    1030 <__syscall@plt>

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

LLVM IR (-O2):
define void @syncfs(i32 %0) {
%2 = tail call i32 @__syscall(i32 373, i32 %0)
ret void
}
int main(void) {
  int x = 5;
  *((int **)&x);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void tty_erase_char(void) {
  printf("\b \b");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<tty_erase_char>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_erase_char>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\08 \08\00"
@stdout = global i32 0
define void @tty_erase_char() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\08 \08\00"
@stdout = global i32 0
define void @tty_erase_char() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
bool nrf51_errata_22(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_22() {
ret i32 0
}
/* Variables and functions */
int isblank(char c) { return (' ' == c || '\t' == c); }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0x20,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1131 <isblank+0x31>
movsbl -0x1(%rbp),%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isblank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 32, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 9, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isblank(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int prof_score(const unsigned char *aa1p, int n0, int *pwaa_s) {
  int sum = 0;
  while (*aa1p) {
    sum += pwaa_s[(*aa1p++) * n0];
    pwaa_s++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<prof_score>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <prof_score+0x5a>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
imul   -0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <prof_score+0x16>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prof_score>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <prof_score+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   %esi,%ecx
movslq %ecx,%rcx
add    (%rdx,%rcx,4),%eax
add    $0x4,%rdx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <prof_score+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @prof_score(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %21, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %19, %6 ], [ %4, %3 ]
%8 = phi i32 [ %17, %6 ], [ 0, %3 ]
%9 = phi i32* [ %18, %6 ], [ %2, %3 ]
%10 = phi i8* [ %11, %6 ], [ %0, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = zext i8 %7 to i32
%13 = mul nsw i32 %12, %1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %9, i64 %14
%16 = load i32, i32* %15
%17 = add nsw i32 %16, %8
%18 = getelementptr inbounds i32, i32* %9, i64 1
%19 = load i8, i8* %11
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %6
21: ; preds = %6, %3
%22 = phi i32 [ 0, %3 ], [ %17, %6 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *print_message1() { printf("Hello from Thread1\n"); }


x86 assembly (clang, -O0):
<print_message1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from Thread1\0A\00"
define i8* @print_message1() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello from Thread1\00"
define noalias i8* @print_message1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
int f4_get_int() {
  int r = 44;
  return r;
}


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

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

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

LLVM IR (-O2):
define i32 @f4_get_int() {
ret i32 44
}
const char *bar2() { return "abcdefghijklmnopqrstuvwxyz0123456789"; }


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

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

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

LLVM IR (-O2):
@.str = [37 x i8] c"abcdefghijklmnopqrstuvwxyz0123456789\00"
define i8* @bar2() {
ret i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i = 1, n, sum = 0;
  scanf("%d", &n);
  while (i <= n)
    sum += i++;
  printf("%d", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116f <main+0x4f>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114d <main+0x2d>
mov    -0x10(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    114f <main+0x2f>
lea    -0x1(%rax),%ecx
lea    -0x2(%rax),%edx
imul   %rcx,%rdx
shr    %rdx
lea    (%rdx,%rax,2),%esi
add    $0xffffffff,%esi
jmp    1151 <main+0x31>
xor    %esi,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %17, label %6
6: ; preds = %0
%7 = shl nuw i32 %4, 1
%8 = add nsw i32 %4, -1
%9 = zext i32 %8 to i33
%10 = add nsw i32 %4, -2
%11 = zext i32 %10 to i33
%12 = mul i33 %9, %11
%13 = lshr i33 %12, 1
%14 = trunc i33 %13 to i32
%15 = add i32 %7, %14
%16 = add i32 %15, -1
br label %17
17: ; preds = %6, %0
%18 = phi i32 [ 0, %0 ], [ %16, %6 ]
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}
/* Variables and functions */
int intcmp(const void *a, const void *b) {
  return *(const int *)a - *(const int *)b;
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intcmp(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int SIGINT;
int SIGQUIT;
int /*<<< orphan*/ printf(char *);
void do_nothing(int sig) {
  if (sig == SIGINT)
    printf("catch SIGINT!\n");
  if (sig == SIGQUIT)
    printf("catch SIGQUIT!\n");
}


x86 assembly (clang, -O0):
<do_nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <do_nothing+0x29>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%eax
jne    1157 <do_nothing+0x47>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_nothing>:
push   %rbx
mov    %edi,%ebx
mov    0x2ece(%rip),%rax
cmp    %edi,(%rax)
jne    112a <do_nothing+0x1a>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eaf(%rip),%rax
cmp    %ebx,(%rax)
jne    1142 <do_nothing+0x32>
lea    0xec4(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@str = [15 x i8] c"catch SIGQUIT!\00"
@str.2 = [14 x i8] c"catch SIGINT!\00"
define void @do_nothing(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = load i32, i32* @SIGQUIT
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}
int ec_terminate_alarm() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ec_terminate_alarm() {
ret i32 0
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
scalar_t__ stat(char const *, struct stat *);
size_t filesize(const char *file) {
  struct stat sb;
  memset(&sb, 0, sizeof(struct stat));
  if (stat(file, &sb) < 0) {
    return -1;
  }
  return sb.st_size;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    1160 <filesize+0x40>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1168 <filesize+0x48>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffffffffffff,%rax
test   %rcx,%rcx
js     1157 <filesize+0x37>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @filesize(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = call i32 @memset(%struct.stat* %4, i32 0, i32 8)
%6 = load i8*, i8** %3
%7 = call i64 @stat(i8* %6, %struct.stat* %4)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i64 -1, i64* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i64, i64* %11
store i64 %12, i64* %2
br label %13
13: ; preds = %10, %9
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @filesize(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @memset(%struct.stat* %2, i32 0, i32 8)
%5 = call i64 @stat(i8* %0, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = icmp sgt i64 %5, -1
%9 = select i1 %8, i64 %7, i64 -1
ret i64 %9
}
/* Variables and functions */
int check_number(char const *, char const *);
scalar_t__ errno;
scalar_t__ strtod(char const *, char **);
bool parse_double(const char **string, double *result) {
  errno = 0;
  const char *start = *string;
  char *end;
  *result = (double)strtod(start, &end);
  *string = end;
  return check_number(start, *string);
}


x86 assembly (clang, -O0):
<parse_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
cvtsi2sd %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
call   1040 <check_number@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_double>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2eaa(%rip),%rax
movq   $0x0,(%rax)
mov    (%rdi),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strtod@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%r14)
mov    0x8(%rsp),%rsi
mov    %rsi,(%r15)
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <check_number@plt>

LLVM IR (-O0):
@errno = global i64 0
define i32 @parse_double(i8** %0, double* %1) {
%3 = alloca i8**
%4 = alloca double*
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %3
store double* %1, double** %4
store i64 0, i64* @errno
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i64 @strtod(i8* %9, i8** %6)
%11 = sitofp i64 %10 to double
%12 = load double*, double** %4
store double %11, double* %12
%13 = load i8*, i8** %6
%14 = load i8**, i8*** %3
store i8* %13, i8** %14
%15 = load i8*, i8** %5
%16 = load i8**, i8*** %3
%17 = load i8*, i8** %16
%18 = call i32 @check_number(i8* %15, i8* %17)
ret i32 %18
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @parse_double(i8** nocapture %0, double* nocapture writeonly %1) {
%3 = alloca i8*
store i64 0, i64* @errno
%4 = load i8*, i8** %0
%5 = bitcast i8** %3 to i8*
%6 = call i64 @strtod(i8* %4, i8** %3)
%7 = sitofp i64 %6 to double
store double %7, double* %1
%8 = load i8*, i8** %3
store i8* %8, i8** %0
%9 = tail call i32 @check_number(i8* %4, i8* %8)
ret i32 %9
}
int dropit(int c) {
  switch (c) {
  case ((('_') - ' ') & 0177):
  case (((';') - ' ') & 0177):
  case (((',') - ' ') & 0177):
  case ((('g') - ' ') & 0177):
  case ((('j') - ' ') & 0177):
  case ((('p') - ' ') & 0177):
  case ((('q') - ' ') & 0177):
  case ((('y') - ' ') & 0177):
    return (3);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<dropit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffff4,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4d,%eax
ja     113c <dropit+0x3c>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    1143 <dropit+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropit>:
add    $0xfffffff4,%edi
cmp    $0x4d,%edi
ja     111e <dropit+0x1e>
mov    $0x3,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dropit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 63, label %5
i32 27, label %5
i32 12, label %5
i32 71, label %5
i32 74, label %5
i32 80, label %5
i32 81, label %5
i32 89, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 3, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @dropit(i32 %0) {
switch i32 %0, label %2 [
i32 63, label %3
i32 27, label %3
i32 12, label %3
i32 71, label %3
i32 74, label %3
i32 80, label %3
i32 81, label %3
i32 89, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 3, %1 ], [ 3, %1 ], [ 3, %1 ], [ 3, %1 ], [ 3, %1 ], [ 3, %1 ], [ 3, %1 ], [ 3, %1 ]
ret i32 %4
}
fs(signed short data) { return data; }


x86 assembly (clang, -O0):
<fs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fs(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @fs(i16 signext %0) {
%2 = sext i16 %0 to i32
ret i32 %2
}
double absoluteValue(double input) {
  if (input < 0.0) {
    return -1.0 * input;
  } else {
    return input;
  }
}


x86 assembly (clang, -O0):
<absoluteValue>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <absoluteValue+0x2e>
movsd  0xee1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1138 <absoluteValue+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absoluteValue>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @absoluteValue(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double -1.000000e+00, %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @absoluteValue(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
struct XbusParser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct XbusParser *);
void XbusParser_destroy(struct XbusParser *parser) { free(parser); }


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

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

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

LLVM IR (-O2):
%struct.XbusParser = type { i32 }
define void @XbusParser_destroy(%struct.XbusParser* nocapture %0) {
%2 = tail call i32 @free(%struct.XbusParser* %0)
ret void
}
int lp_ptt(int fd, int onoff) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @lp_ptt(i32 %0, i32 %1) {
ret i32 0
}
void braille_set_options(struct console_cmdline *c, char *brl_options) {}


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

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

LLVM IR (-O0):
%struct.console_cmdline = type opaque
define void @braille_set_options(%struct.console_cmdline* %0, i8* %1) {
%3 = alloca %struct.console_cmdline*
%4 = alloca i8*
store %struct.console_cmdline* %0, %struct.console_cmdline** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.console_cmdline = type opaque
define void @braille_set_options(%struct.console_cmdline* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ nrx_printbuf(int /*<<< orphan*/ const *, size_t, char *);
int /*<<< orphan*/ printf(char *);
int hexdump(const uint8_t *buf, size_t len) {
  printf("\n");
  nrx_printbuf(buf, len, "  ");
  return 0;
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xeb7(%rip),%rdx
call   1040 <nrx_printbuf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec5(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <nrx_printbuf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c" \00"
define i32 @hexdump(i32* %0, i64 %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @nrx_printbuf(i32* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef double GLdouble;

/* Variables and functions */
double length3(double *);
int /*<<< orphan*/ printf(char *, double, double, double, double);
void print3(GLdouble v[3]) {
  GLdouble len;
  len = length3(v);
  printf("(%g %g %g); len: %g\n", v[0], v[1], v[2], len);
}


x86 assembly (clang, -O0):
<print3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <length3@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
movsd  -0x10(%rbp),%xmm3
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print3>:
push   %rbx
mov    %rdi,%rbx
call   1030 <length3@plt>
movaps %xmm0,%xmm3
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
movsd  0x10(%rbx),%xmm2
lea    0xebf(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"(%g %g %g); len: %g\0A\00"
define void @print3(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = call double @length3(double* %4)
store double %5, double* %3
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = load double, double* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %8, double %11, double %14, double %15)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"(%g %g %g); len: %g\0A\00"
define void @print3(double* %0) {
%2 = tail call double @length3(double* %0)
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %3, double %5, double %7, double %2)
ret void
}
/* Variables and functions */
unsigned int get_cpu_utilisation();
unsigned int get_kb_bl_level(unsigned int);
int /*<<< orphan*/ set_kb_bl_level(unsigned int);
void update_keyboard_backlight(void) {
  unsigned per256 = get_cpu_utilisation();
  unsigned level = get_kb_bl_level(per256);
  set_kb_bl_level(level);
}


x86 assembly (clang, -O0):
<update_keyboard_backlight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get_cpu_utilisation@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_kb_bl_level@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <set_kb_bl_level@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_keyboard_backlight>:
push   %rax
xor    %eax,%eax
call   1050 <get_cpu_utilisation@plt>
mov    %eax,%edi
call   1030 <get_kb_bl_level@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <set_kb_bl_level@plt>

LLVM IR (-O0):
define void @update_keyboard_backlight() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @get_cpu_utilisation()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @get_kb_bl_level(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @set_kb_bl_level(i32 %6)
ret void
}

LLVM IR (-O2):
define void @update_keyboard_backlight() {
%1 = tail call i32 (...) @get_cpu_utilisation()
%2 = tail call i32 @get_kb_bl_level(i32 %1)
%3 = tail call i32 @set_kb_bl_level(i32 %2)
ret void
}
int is_dma32(struct zone *zone) { return 0; }


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

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

LLVM IR (-O0):
%struct.zone = type opaque
define i32 @is_dma32(%struct.zone* %0) {
%2 = alloca %struct.zone*
store %struct.zone* %0, %struct.zone** %2
ret i32 0
}

LLVM IR (-O2):
%struct.zone = type opaque
define i32 @is_dma32(%struct.zone* nocapture readnone %0) {
ret i32 0
}
void gtk_layout_get_vadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_layout_get_vadjustment() {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ pfd();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ syscall(int, int);
int close_pipe() {
  char s[16];
  int fd;
  pfd();
  printf("enter fd to close : ");
  gets(s);
  fd = atoi(s);
  syscall(33, fd);
}


x86 assembly (clang, -O0):
<close_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1060 <pfd@plt>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x20(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
mov    $0x21,%edi
call   1040 <syscall@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_pipe>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <pfd@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1070 <atoi@plt>
mov    $0x21,%edi
mov    %eax,%esi
call   1040 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"enter fd to close : \00"
define i32 @close_pipe() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i32
%4 = call i32 (...) @pfd()
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @syscall(i32 33, i32 %10)
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [21 x i8] c"enter fd to close : \00"
define i32 @close_pipe() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @pfd()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @gets(i8* %2)
%6 = call i32 @atoi(i8* %2)
%7 = call i32 @syscall(i32 33, i32 %6)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void MJC_putc(char c) { printf("%c", c); }


x86 assembly (clang, -O0):
<MJC_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MJC_putc>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @MJC_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @MJC_putc(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
int add(const int a, const int b) { return a + b; }


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

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

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ prebuilt_func_C();
int /*<<< orphan*/ static_func_C();
void C() {
  static_func_C();
  prebuilt_func_C();
}


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

x86 assembly (clang, -O2):
<C>:
push   %rax
xor    %eax,%eax
call   1030 <static_func_C@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <prebuilt_func_C@plt>

LLVM IR (-O0):
define void @C() {
%1 = call i32 (...) @static_func_C()
%2 = call i32 (...) @prebuilt_func_C()
ret void
}

LLVM IR (-O2):
define void @C() {
%1 = tail call i32 (...) @static_func_C()
%2 = tail call i32 (...) @prebuilt_func_C()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_drive(int, int /*<<< orphan*/);
int /*<<< orphan*/ create_drive_direct(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ msleep(int);
void turnLeft(int degrees) {
  int rad = 0.5 * 3.1415926;
  create_drive(50, 0);
  msleep(rad * 4000 * degrees / 90);
  create_drive_direct(0, 0);
}


x86 assembly (clang, -O0):
<turnLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x32,%edi
xor    %esi,%esi
call   1030 <create_drive@plt>
imul   $0xfa0,-0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x5a,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <msleep@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <create_drive_direct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnLeft>:
push   %rbx
mov    %edi,%ebx
mov    $0x32,%edi
xor    %esi,%esi
call   1030 <create_drive@plt>
imul   $0xfa0,%ebx,%eax
movslq %eax,%rdi
imul   $0xffffffffb60b60b7,%rdi,%rax
shr    $0x20,%rax
add    %eax,%edi
mov    %edi,%eax
shr    $0x1f,%eax
sar    $0x6,%edi
add    %eax,%edi
call   1040 <msleep@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rbx
jmp    1050 <create_drive_direct@plt>

LLVM IR (-O0):
define void @turnLeft(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = call i32 @create_drive(i32 50, i32 0)
%5 = load i32, i32* %3
%6 = mul nsw i32 %5, 4000
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = sdiv i32 %8, 90
%10 = call i32 @msleep(i32 %9)
%11 = call i32 @create_drive_direct(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @turnLeft(i32 %0) {
%2 = tail call i32 @create_drive(i32 50, i32 0)
%3 = mul nsw i32 %0, 4000
%4 = sdiv i32 %3, 90
%5 = tail call i32 @msleep(i32 %4)
%6 = tail call i32 @create_drive_direct(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int _fcntl(int fd, int cmd, ...) {
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<_fcntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
mov    %edi,-0xc(%rbp)
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_fcntl(i32 %0, i32 %1, ...) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @_fcntl(i32 %0, i32 %1, ...) {
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
void ff_hevc_put_hevc_qpel_v8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v8_12_sse4() {
ret void
}
char c(int a, int b) {
  if (a > b)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    111f <c+0x1f>
movb   $0x1,-0x1(%rbp)
jmp    1123 <c+0x23>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
cmp    %esi,%edi
setg   %al
add    %al,%al
add    $0xff,%al
ret

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

LLVM IR (-O2):
define signext i8 @c(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i8 1, i8 -1
ret i8 %4
}