xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ exp(double);
double pow(scalar_t__, int);
double derive_htan(double x) {
  if (x > 84.0 || x < -84.0)
    return 0.0;
  return 4.0 * pow(exp(x) + exp(-x), -2);
}


x86 assembly (clang, -O0):
<derive_htan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1157 <derive_htan+0x37>
movsd  0xebc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1164 <derive_htan+0x44>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b8 <derive_htan+0x98>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
mov    $0xfffffffe,%esi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe61(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derive_htan>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm2
ucomisd 0xecf(%rip),%xmm0
xorpd  %xmm0,%xmm0
ja     1180 <derive_htan+0x60>
movsd  0xec9(%rip),%xmm1
ucomisd %xmm2,%xmm1
ja     1180 <derive_htan+0x60>
movapd %xmm2,%xmm0
movapd %xmm2,(%rsp)
call   1030 <exp@plt>
mov    %rax,%rbx
movapd (%rsp),%xmm0
xorpd  0xebd(%rip),%xmm0
call   1030 <exp@plt>
add    %rax,%rbx
mov    %rbx,%rdi
mov    $0xfffffffe,%esi
call   1040 <pow@plt>
mulsd  0xe90(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @derive_htan(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 8.400000e+01
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp olt double %7, -8.400000e+01
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store double 0.000000e+00, double* %2
br label %19
10: ; preds = %6
%11 = load double, double* %3
%12 = call i64 @exp(double %11)
%13 = load double, double* %3
%14 = fneg double %13
%15 = call i64 @exp(double %14)
%16 = add nsw i64 %12, %15
%17 = call double @pow(i64 %16, i32 -2)
%18 = fmul double 4.000000e+00, %17
store double %18, double* %2
br label %19
19: ; preds = %10, %9
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @derive_htan(double %0) {
%2 = fcmp ogt double %0, 8.400000e+01
%3 = fcmp olt double %0, -8.400000e+01
%4 = or i1 %2, %3
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = tail call i64 @exp(double %0)
%7 = fneg double %0
%8 = tail call i64 @exp(double %7)
%9 = add nsw i64 %8, %6
%10 = tail call double @pow(i64 %9, i32 -2)
%11 = fmul double %10, 4.000000e+00
br label %12
12: ; preds = %1, %5
%13 = phi double [ %11, %5 ], [ 0.000000e+00, %1 ]
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int pthread_self();
void *t_print() { printf("Nova thread criada. TID = %d!\n", pthread_self()); }


x86 assembly (clang, -O0):
<t_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_print>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Nova thread criada. TID = %d!\0A\00"
define i8* @t_print() {
%1 = alloca i8*
%2 = call i32 (...) @pthread_self()
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i8*, i8** %1
ret i8* %4
}

LLVM IR (-O2):
@.str = [31 x i8] c"Nova thread criada. TID = %d!\0A\00"
define noalias i8* @t_print() {
%1 = tail call i32 (...) @pthread_self()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* undef
}
/* Variables and functions */
char **malloc(int);
int my_count_words(char *);
char **alloc_first_dim(char *str) {
  char **tab;
  int length;
  length = my_count_words(str);
  tab = malloc((length + 1) * sizeof(*tab));
  return (tab);
}


x86 assembly (clang, -O0):
<alloc_first_dim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <my_count_words@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_first_dim>:
push   %rax
call   1040 <my_count_words@plt>
lea    0x8(,%rax,8),%edi
pop    %rax
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8** @alloc_first_dim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @my_count_words(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 8
%11 = trunc i64 %10 to i32
%12 = call i8** @malloc(i32 %11)
store i8** %12, i8*** %3
%13 = load i8**, i8*** %3
ret i8** %13
}

LLVM IR (-O2):
define noalias i8** @alloc_first_dim(i8* %0) {
%2 = tail call i32 @my_count_words(i8* %0)
%3 = shl i32 %2, 3
%4 = add i32 %3, 8
%5 = tail call i8** @malloc(i32 %4)
ret i8** %5
}
long siracusa(long num) {
  long secuencia = 0;
  do {
    if (num % 2 == 0) {
      num /= 2;
    } else {
      num = num * 3 + 1;
    }
    secuencia++;
  } while (num > 1);
  return secuencia;
}


x86 assembly (clang, -O0):
<siracusa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    113f <siracusa+0x3f>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    114c <siracusa+0x4c>
imul   $0x3,-0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x1,-0x8(%rbp)
jg     1110 <siracusa+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<siracusa>:
xor    %eax,%eax
jmp    1122 <siracusa+0x22>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rdi,%rdi,2),%rdi
add    $0x1,%rdi
add    $0x1,%rax
cmp    $0x1,%rdi
jle    113a <siracusa+0x3a>
test   $0x1,%dil
jne    1110 <siracusa+0x10>
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
sar    %rcx
mov    %rcx,%rdi
jmp    1118 <siracusa+0x18>
ret

LLVM IR (-O0):
define i64 @siracusa(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %18, %1
%5 = load i64, i64* %2
%6 = srem i64 %5, 2
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i64, i64* %2
%10 = sdiv i64 %9, 2
store i64 %10, i64* %2
br label %15
11: ; preds = %4
%12 = load i64, i64* %2
%13 = mul nsw i64 %12, 3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %2
br label %15
15: ; preds = %11, %8
%16 = load i64, i64* %3
%17 = add nsw i64 %16, 1
store i64 %17, i64* %3
br label %18
18: ; preds = %15
%19 = load i64, i64* %2
%20 = icmp sgt i64 %19, 1
br i1 %20, label %4, label %21
21: ; preds = %18
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @siracusa(i64 %0) {
br label %2
2: ; preds = %12, %1
%3 = phi i64 [ %0, %1 ], [ %13, %12 ]
%4 = phi i64 [ 0, %1 ], [ %14, %12 ]
%5 = and i64 %3, 1
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = sdiv i64 %3, 2
br label %12
9: ; preds = %2
%10 = mul nsw i64 %3, 3
%11 = add nsw i64 %10, 1
br label %12
12: ; preds = %9, %7
%13 = phi i64 [ %8, %7 ], [ %11, %9 ]
%14 = add nuw nsw i64 %4, 1
%15 = icmp sgt i64 %13, 1
br i1 %15, label %2, label %16
16: ; preds = %12
ret i64 %14
}
void kunmap_skb_frag(void *vaddr) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<kunmap_skb_frag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <kunmap_skb_frag+0xd>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @kunmap_skb_frag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @kunmap_skb_frag(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void fputlong(long v, FILE *fp) {
  fputc((char)((v >> 0) & 0xff), fp);
  fputc((char)((v >> 8) & 0xff), fp);
  fputc((char)((v >> 16) & 0xff), fp);
  fputc((char)((v >> 24) & 0xff), fp);
}


x86 assembly (clang, -O0):
<fputlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x0,%rax
and    $0xff,%rax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rax
sar    $0x18,%rax
and    $0xff,%rax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputlong>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl %bl,%edi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x8,%eax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
sar    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @fputlong(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = ashr i64 %5, 0
%7 = and i64 %6, 255
%8 = trunc i64 %7 to i8
%9 = load i32*, i32** %4
%10 = call i32 @fputc(i8 signext %8, i32* %9)
%11 = load i64, i64* %3
%12 = ashr i64 %11, 8
%13 = and i64 %12, 255
%14 = trunc i64 %13 to i8
%15 = load i32*, i32** %4
%16 = call i32 @fputc(i8 signext %14, i32* %15)
%17 = load i64, i64* %3
%18 = ashr i64 %17, 16
%19 = and i64 %18, 255
%20 = trunc i64 %19 to i8
%21 = load i32*, i32** %4
%22 = call i32 @fputc(i8 signext %20, i32* %21)
%23 = load i64, i64* %3
%24 = ashr i64 %23, 24
%25 = and i64 %24, 255
%26 = trunc i64 %25 to i8
%27 = load i32*, i32** %4
%28 = call i32 @fputc(i8 signext %26, i32* %27)
ret void
}

LLVM IR (-O2):
define void @fputlong(i64 %0, i32* nocapture %1) {
%3 = trunc i64 %0 to i8
%4 = tail call i32 @fputc(i8 signext %3, i32* %1)
%5 = lshr i64 %0, 8
%6 = trunc i64 %5 to i8
%7 = tail call i32 @fputc(i8 signext %6, i32* %1)
%8 = lshr i64 %0, 16
%9 = trunc i64 %8 to i8
%10 = tail call i32 @fputc(i8 signext %9, i32* %1)
%11 = lshr i64 %0, 24
%12 = trunc i64 %11 to i8
%13 = tail call i32 @fputc(i8 signext %12, i32* %1)
ret void
}
void TimerRTCDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) &= ~(0x00000010);
}


x86 assembly (clang, -O0):
<TimerRTCDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    $0xffffffffffffffef,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerRTCDisable>:
andq   $0xffffffffffffffef,0xc(%rdi)
ret

LLVM IR (-O0):
define void @TimerRTCDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -17
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @TimerRTCDisable(i64 %0) {
%2 = add i64 %0, 12
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -17
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int atoi(char *);
int dealwithargs(int argc, char *argv[]) {
  int level;
  if (argc > 1)
    level = atoi(argv[1]);
  else
    level = 10000;
  return level;
}


x86 assembly (clang, -O0):
<dealwithargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    113e <dealwithargs+0x2e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1145 <dealwithargs+0x35>
movl   $0x2710,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealwithargs>:
cmp    $0x2,%edi
jl     111e <dealwithargs+0xe>
mov    0x8(%rsi),%rdi
jmp    1030 <atoi@plt>
mov    $0x2710,%eax
ret

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

LLVM IR (-O2):
define i32 @dealwithargs(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 10000, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ sorter_grail_common_sort(int /*<<< orphan*/ *, size_t,
                                            int /*<<< orphan*/,
                                            int /*<<< orphan*/);
void sorter_grail_sort(int64_t *arr, size_t Len) {
  sorter_grail_common_sort(arr, Len, 0, 0);
}


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

x86 assembly (clang, -O2):
<sorter_grail_sort>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <sorter_grail_common_sort@plt>

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

LLVM IR (-O2):
define void @sorter_grail_sort(i32* %0, i64 %1) {
%3 = tail call i32 @sorter_grail_common_sort(i32* %0, i64 %1, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void analyze_32(FILE *fp) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ m68k_read_memory_32(int /*<<< orphan*/);
void m68k_read_to_32(uint32_t address, uint32_t *dest) {
  *dest = m68k_read_memory_32(address);
}


x86 assembly (clang, -O0):
<m68k_read_to_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m68k_read_memory_32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_read_to_32>:
push   %rbx
mov    %rsi,%rbx
call   1030 <m68k_read_memory_32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @m68k_read_to_32(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 = call i32 @m68k_read_memory_32(i32 %5)
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @m68k_read_to_32(i32 %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @m68k_read_memory_32(i32 %0)
store i32 %3, i32* %1
ret void
}
int test_dma() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_dma() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
long fgeth(register FILE *f) {
  register long h;
  h = getc(f);
  h |= getc(f) << 8;
  h |= (long)getc(f) << 16;
  return h | (long)getc(f) << 24;
}


x86 assembly (clang, -O0):
<fgeth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
cltq
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
cltq
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x18,%rcx
or     %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgeth>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     %ebp,%eax
movslq %eax,%r14
mov    %rbx,%rdi
call   1030 <getc@plt>
movslq %eax,%rbp
shl    $0x10,%rbp
mov    %rbx,%rdi
call   1030 <getc@plt>
cltq
shl    $0x18,%rax
or     %rbp,%rax
or     %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @fgeth(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
%6 = sext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = call i32 @getc(i32* %7)
%9 = shl i32 %8, 8
%10 = sext i32 %9 to i64
%11 = load i64, i64* %3
%12 = or i64 %11, %10
store i64 %12, i64* %3
%13 = load i32*, i32** %2
%14 = call i32 @getc(i32* %13)
%15 = sext i32 %14 to i64
%16 = shl i64 %15, 16
%17 = load i64, i64* %3
%18 = or i64 %17, %16
store i64 %18, i64* %3
%19 = load i64, i64* %3
%20 = load i32*, i32** %2
%21 = call i32 @getc(i32* %20)
%22 = sext i32 %21 to i64
%23 = shl i64 %22, 24
%24 = or i64 %19, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @fgeth(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = sext i32 %5 to i64
%7 = tail call i32 @getc(i32* %0)
%8 = sext i32 %7 to i64
%9 = shl nsw i64 %8, 16
%10 = or i64 %9, %6
%11 = tail call i32 @getc(i32* %0)
%12 = sext i32 %11 to i64
%13 = shl nsw i64 %12, 24
%14 = or i64 %10, %13
ret i64 %14
}
/* Variables and functions */
int __BNF_trans_string(char *);
int fluid_verb(void) {
  int state;
  do {
    state = __BNF_trans_string("water");
    if (!state)
      break;
    state = __BNF_trans_string("oil");
  } while (0);
  return state;
}


x86 assembly (clang, -O0):
<fluid_verb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <fluid_verb+0x26>
jmp    1145 <fluid_verb+0x35>
lea    0xec9(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fluid_verb>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     112e <fluid_verb+0x1e>
lea    0xede(%rip),%rdi
pop    %rax
jmp    1030 <__BNF_trans_string@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"water\00"
@.str.1 = [4 x i8] c"oil\00"
define i32 @fluid_verb() {
%1 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  unsigned int x = 10;
  while (x >= 10) {
    x += 2;
  }
  __VERIFIER_assert(!(x % 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jb     113e <main+0x2e>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp uge i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add i32 %7, 2
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = urem i32 %10, 2
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = call i32 @__VERIFIER_assert(i32 %14)
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gdt_install();
int /*<<< orphan*/ idt_install();
int /*<<< orphan*/ irq_install();
int /*<<< orphan*/ kb_install();
int /*<<< orphan*/ pmode();
int /*<<< orphan*/ syscll_install();
int /*<<< orphan*/ timer_install();
void all_install() {
  gdt_install();
  idt_install();
  timer_install();
  kb_install();
  syscll_install();
  irq_install();
  pmode();
}


x86 assembly (clang, -O0):
<all_install>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <gdt_install@plt>
mov    $0x0,%al
call   1070 <idt_install@plt>
mov    $0x0,%al
call   1030 <timer_install@plt>
mov    $0x0,%al
call   1050 <kb_install@plt>
mov    $0x0,%al
call   1080 <syscll_install@plt>
mov    $0x0,%al
call   1040 <irq_install@plt>
mov    $0x0,%al
call   1090 <pmode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_install>:
push   %rax
xor    %eax,%eax
call   1060 <gdt_install@plt>
xor    %eax,%eax
call   1070 <idt_install@plt>
xor    %eax,%eax
call   1030 <timer_install@plt>
xor    %eax,%eax
call   1050 <kb_install@plt>
xor    %eax,%eax
call   1080 <syscll_install@plt>
xor    %eax,%eax
call   1040 <irq_install@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <pmode@plt>

LLVM IR (-O0):
define void @all_install() {
%1 = call i32 (...) @gdt_install()
%2 = call i32 (...) @idt_install()
%3 = call i32 (...) @timer_install()
%4 = call i32 (...) @kb_install()
%5 = call i32 (...) @syscll_install()
%6 = call i32 (...) @irq_install()
%7 = call i32 (...) @pmode()
ret void
}

LLVM IR (-O2):
define void @all_install() {
%1 = tail call i32 (...) @gdt_install()
%2 = tail call i32 (...) @idt_install()
%3 = tail call i32 (...) @timer_install()
%4 = tail call i32 (...) @kb_install()
%5 = tail call i32 (...) @syscll_install()
%6 = tail call i32 (...) @irq_install()
%7 = tail call i32 (...) @pmode()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ puts(char const *);
void fatal(const char *message) {
  puts(message);
  abort();
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ neug_fini();
void random_fini(void) { neug_fini(); }


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

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

LLVM IR (-O0):
define void @random_fini() {
%1 = call i32 (...) @neug_fini()
ret void
}

LLVM IR (-O2):
define void @random_fini() {
%1 = tail call i32 (...) @neug_fini()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
void prtdVersion() {
  puts(
      "@"
      "(#)"
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/dispfram.c"
      " "
      "Sat Jan 22 08:19:10 2022"
      " compiled: "
      "Mar 15 2022"
      " "
      "22:28:38");
  fflush(NULL);
}


x86 assembly (clang, -O0):
<prtdVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [197 x i8] c"@(#)/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/dispfram.c Sat Jan 22 08:19:10 2022 compiled: Mar 15 2022 22:28:38\00"
define void @prtdVersion() {
%1 = call i32 @puts(i8* getelementptr inbounds ([197 x i8], [197 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @fflush(i32* null)
ret void
}

LLVM IR (-O2):
@.str = [197 x i8] c"@(#)/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/dispfram.c Sat Jan 22 08:19:10 2022 compiled: Mar 15 2022 22:28:38\00"
define void @prtdVersion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([197 x i8], [197 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @fflush(i32* null)
ret void
}
void Dummy_Handler(void) {
  while (1) {
  };
}


x86 assembly (clang, -O0):
<Dummy_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Dummy_Handler+0x9>
jmp    1109 <Dummy_Handler+0x9>

x86 assembly (clang, -O2):
<Dummy_Handler>:
jmp    1100 <Dummy_Handler>

LLVM IR (-O0):
define void @Dummy_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Dummy_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void dontComplain() {}


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

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

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

LLVM IR (-O2):
define void @dontComplain() {
ret void
}
int main() {
  int x;
  x = 0;
  do
    x = x + 1;
  while (x < 10);
  do {
    x = x + 1;
  } while (x < 20);
  return x - 20;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1112 <main+0x12>
jmp    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jl     112a <main+0x2a>
mov    -0x8(%rbp),%eax
sub    $0x14,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xvisibility_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xvisibility.window;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xvisibility_window>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xvisibility_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xvisibility_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void FAPI_function1(void) {
  printf(">> [FAPI] "
         "calling another fake API 1 call.\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c">> [FAPI] calling another fake API 1 call.\0A\00"
define void @FAPI_function1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c">> [FAPI] calling another fake API 1 call.\00"
define void @FAPI_function1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int f36(unsigned int x, int y __attribute__((unused))) {
  return (x >> ((-1) & (8 * 4 - 1))) | (x << 1);
}


x86 assembly (clang, -O0):
<f36>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f36(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 = lshr i32 %5, 31
%7 = load i32, i32* %3
%8 = shl i32 %7, 1
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f36(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ writeC(char *, int);
int putchar(char c) {
  char *msg = malloc(1);
  *msg = c;
  writeC(msg, 1);
  return 0;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <writeC@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %bl,(%rax)
mov    %rax,%rdi
mov    $0x1,%esi
call   1030 <writeC@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @putchar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = call i8* @malloc(i32 1)
store i8* %4, i8** %3
%5 = load i8, i8* %2
%6 = load i8*, i8** %3
store i8 %5, i8* %6
%7 = load i8*, i8** %3
%8 = call i32 @writeC(i8* %7, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @putchar(i8 signext %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
store i8 %0, i8* %2
%3 = tail call i32 @writeC(i8* %2, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printUsage(void) {
  fprintf(stderr,
          "Usage: xdriinfo [-display <dpy>] [-version] [command]\n"
          "Commands:\n"
          "  nscreens               print the number of screens on display\n"
          "  driver screen          print the DRI driver name of screen\n"
          "  options screen|driver  print configuration information about "
          "screen or driver\n"
          "If no command is given then the DRI drivers for all screens are "
          "listed.\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [342 x i8] c"Usage: xdriinfo [-display <dpy>] [-version] [command]\0ACommands:\0A nscreens print the number of screens on display\0A driver screen print the DRI driver name of screen\0A options screen|driver print configuration information about screen or driver\0AIf no command is given then the DRI drivers for all screens are listed.\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([342 x i8], [342 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [342 x i8] c"Usage: xdriinfo [-display <dpy>] [-version] [command]\0ACommands:\0A nscreens print the number of screens on display\0A driver screen print the DRI driver name of screen\0A options screen|driver print configuration information about screen or driver\0AIf no command is given then the DRI drivers for all screens are listed.\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([342 x i8], [342 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RobotStateInit();
extern void RobotStateReset(void) { RobotStateInit(); }


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

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

LLVM IR (-O0):
define void @RobotStateReset() {
%1 = call i32 (...) @RobotStateInit()
ret void
}

LLVM IR (-O2):
define void @RobotStateReset() {
%1 = tail call i32 (...) @RobotStateInit()
ret void
}
/* Type definitions */
typedef void node;

/* Variables and functions */
void *remove(void **, void const *, int (*)(void const *, void const *),
             void *);
void *tdelete(const void *restrict key, void **restrict rootp,
              int (*compar)(const void *, const void *)) {
  struct node *n = *rootp;
  struct node *ret;
  ret = remove(&n, key, compar, n);
  *rootp = n;
  return ret;
}


x86 assembly (clang, -O0):
<tdelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <remove@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdelete>:
push   %rax
mov    %rdi,%rax
mov    (%rsi),%rcx
mov    %rcx,(%rsp)
mov    %rsp,%rdi
mov    %rax,%rsi
call   1030 <remove@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.node = type opaque
define i8* @tdelete(i8* noalias %0, i8** noalias %1, i32 (i8*, i8*)* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32 (i8*, i8*)*
%7 = alloca %struct.node*
%8 = alloca %struct.node*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 (i8*, i8*)* %2, i32 (i8*, i8*)** %6
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = bitcast i8* %10 to %struct.node*
store %struct.node* %11, %struct.node** %7
%12 = bitcast %struct.node** %7 to i8**
%13 = load i8*, i8** %4
%14 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %6
%15 = load %struct.node*, %struct.node** %7
%16 = bitcast %struct.node* %15 to i8*
%17 = call i8* @remove(i8** %12, i8* %13, i32 (i8*, i8*)* %14, i8* %16)
%18 = bitcast i8* %17 to %struct.node*
store %struct.node* %18, %struct.node** %8
%19 = load %struct.node*, %struct.node** %7
%20 = bitcast %struct.node* %19 to i8*
%21 = load i8**, i8*** %5
store i8* %20, i8** %21
%22 = load %struct.node*, %struct.node** %8
%23 = bitcast %struct.node* %22 to i8*
ret i8* %23
}

LLVM IR (-O2):
%struct.node = type opaque
define i8* @tdelete(i8* noalias %0, i8** noalias nocapture %1, i32 (i8*, i8*)* %2) {
%4 = alloca %struct.node*
%5 = bitcast %struct.node** %4 to i8*
%6 = load i8*, i8** %1
%7 = bitcast %struct.node** %4 to i8**
store i8* %6, i8** %7
%8 = call i8* @remove(i8** %7, i8* %0, i32 (i8*, i8*)* %2, i8* %6)
ret i8* %8
}
void f1ia_p(int *p __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @f1ia_p(i32* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ length;
};
typedef TYPE_1__ XHostAddress;

/* Variables and functions */
int get_XHostAddress_length(void *_p) {
  return (int)((XHostAddress *)_p)->length;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XHostAddress_length(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int bswap_32(int);
uint32_t revbit32(uint32_t u) {
  u = ((u >> 1) & 0x55555555) | ((u & 0x55555555) << 1);
  u = ((u >> 2) & 0x33333333) | ((u & 0x33333333) << 2);
  u = ((u >> 4) & 0x0F0F0F0F) | ((u & 0x0F0F0F0F) << 4);
  return bswap_32(u);
}


x86 assembly (clang, -O0):
<revbit32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
and    $0x55555555,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
and    $0x33333333,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf0f0f0f,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f0f0f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bswap_32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revbit32>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
and    $0xd5555555,%edi
lea    (%rax,%rdi,2),%eax
mov    %eax,%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
and    $0xf3333333,%eax
lea    (%rcx,%rax,4),%edi
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%edi
and    $0xf0f0f0f0,%edi
or     %eax,%edi
jmp    1030 <bswap_32@plt>

LLVM IR (-O0):
define i32 @revbit32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = and i32 %6, 1431655765
%8 = shl i32 %7, 1
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = load i32, i32* %2
%14 = and i32 %13, 858993459
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 4
%19 = and i32 %18, 252645135
%20 = load i32, i32* %2
%21 = and i32 %20, 252645135
%22 = shl i32 %21, 4
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = call i32 @bswap_32(i32 %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @revbit32(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = shl i32 %0, 1
%5 = and i32 %4, -1431655766
%6 = or i32 %3, %5
%7 = lshr i32 %6, 2
%8 = and i32 %7, 858993459
%9 = shl i32 %6, 2
%10 = and i32 %9, -858993460
%11 = or i32 %8, %10
%12 = lshr i32 %11, 4
%13 = and i32 %12, 252645135
%14 = shl i32 %11, 4
%15 = and i32 %14, -252645136
%16 = or i32 %13, %15
%17 = tail call i32 @bswap_32(i32 %16)
ret i32 %17
}
/* Type definitions */
struct sysentry {
  int dummy;
};

/* Variables and functions */
void get_name(char *, char *);
void get_partition_name(struct sysentry *se, char *buf) {
  return get_name("/proc/device-tree/ibm,partition-name", buf);
}


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

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

LLVM IR (-O0):
%struct.sysentry = type { i32 }
@.str = [37 x i8] c"/proc/device-tree/ibm,partition-name\00"
define void @get_partition_name(%struct.sysentry* %0, i8* %1) {
%3 = alloca %struct.sysentry*
%4 = alloca i8*
store %struct.sysentry* %0, %struct.sysentry** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
%struct.sysentry = type { i32 }
@.str = [37 x i8] c"/proc/device-tree/ibm,partition-name\00"
define void @get_partition_name(%struct.sysentry* nocapture readnone %0, i8* %1) {
tail call void @get_name(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IF_NAMESIZE;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BINDTODEVICE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char const *,
                      int /*<<< orphan*/);
void bind_to_device(int sock, const char *interface) {
  if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, interface, IF_NAMESIZE) <
      0) {
    perror("setsockopt(SO_BINDTODEVICE) failed");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<bind_to_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    0x2e81(%rip),%rax
mov    (%rax),%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
jge    1187 <bind_to_device+0x57>
lea    0xe88(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_to_device>:
push   %rax
mov    %rsi,%rcx
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    0x2e93(%rip),%rax
mov    (%rax),%r8d
call   1030 <setsockopt@plt>
test   %rax,%rax
js     115c <bind_to_device+0x2c>
pop    %rax
ret
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_BINDTODEVICE = global i32 0
@IF_NAMESIZE = global i32 0
@.str = [35 x i8] c"setsockopt(SO_BINDTODEVICE) failed\00"
define void @bind_to_device(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_BINDTODEVICE
%8 = load i8*, i8** %4
%9 = load i32, i32* @IF_NAMESIZE
%10 = call i64 @setsockopt(i32 %5, i32 %6, i32 %7, i8* %8, i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_BINDTODEVICE = global i32 0
@IF_NAMESIZE = global i32 0
@.str = [35 x i8] c"setsockopt(SO_BINDTODEVICE) failed\00"
define void @bind_to_device(i32 %0, i8* %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = load i32, i32* @SO_BINDTODEVICE
%5 = load i32, i32* @IF_NAMESIZE
%6 = tail call i64 @setsockopt(i32 %0, i32 %3, i32 %4, i8* %1, i32 %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}
int(f)(int n) { return n + 1; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
timestamp(char *str) {
  time_t t;
  time(&t);
  printf("The time %s is %s\n", str, ctime(&t));
}


x86 assembly (clang, -O0):
<timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <time@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <ctime@plt>
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <time@plt>
mov    %r14,%rdi
call   1030 <ctime@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"The time %s is %s\0A\00"
define i32 @timestamp(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call i8* @ctime(i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
ret i32 undef
}