xunge/DecIR huggingface dataset:
char *flyFeaturesDir() { return "C:/biodata/fly/features/"; }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"C:/biodata/fly/features/\00"
define i8* @flyFeaturesDir() {
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [25 x i8] c"C:/biodata/fly/features/\00"
define i8* @flyFeaturesDir() {
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
int main(void) {
  char arr[4] = {0x0A, 0x0B, 0x0C, 0x0D};
  if (((uint32_t *)arr)[0] == 0x0D0C0B0A)
    printf("little\n");
  else if (((uint32_t *)arr)[0] == 0x0A0B0C0D)
    printf("big\n");
  else {
    printf("Error: machine is neither little nor big endian!\n");
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xd0c0b0a,-0x8(%rbp)
jne    1156 <main+0x36>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
jmp    118c <main+0x6c>
cmpl   $0xa0b0c0d,-0x8(%rbp)
jne    1174 <main+0x54>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
jmp    1187 <main+0x67>
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    118c <main+0x6c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [4 x i8] c"\0A\0B\0C\0D"
@.str = [8 x i8] c"little\0A\00"
@.str.1 = [5 x i8] c"big\0A\00"
@.str.2 = [50 x i8] c"Error: machine is neither little nor big endian!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = bitcast [4 x i8]* %2 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 218893066
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %23
11: ; preds = %0
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%13 = bitcast i8* %12 to i32*
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 168496141
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %22
19: ; preds = %11
%20 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %17
br label %23
23: ; preds = %22, %9
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"little\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void HalfFloatPlane() {}


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

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

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

LLVM IR (-O2):
define void @HalfFloatPlane() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  double flotante = 3.14151612;
  printf("Flotante sin formato: %f\n", flotante);
  printf("Flotante con formato: %-8.4fx\n", flotante);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
movsd  0xecc(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Flotante sin formato: %f\0A\00"
@.str.1 = [31 x i8] c"Flotante con formato: %-8.4fx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0x400921D3341A0DF3, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %3)
%5 = load double, double* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Flotante sin formato: %f\0A\00"
@.str.1 = [31 x i8] c"Flotante con formato: %-8.4fx\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double 0x400921D3341A0DF3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double 0x400921D3341A0DF3)
ret i32 0
}
void free_memory(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++)
    free(argv[i]);
  free(argv);
}


x86 assembly (clang, -O0):
<free_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <free_memory+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <free_memory+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_memory>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <free_memory+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_memory+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_memory(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
int check2(int a) { return (a == 201); }


x86 assembly (clang, -O0):
<check2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xc9,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @check2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 201
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @check2(i32 %0) {
%2 = icmp eq i32 %0, 201
%3 = zext i1 %2 to i32
ret i32 %3
}
int getColorCode(int n) {
  int pow = 1;
  while (n > 1) {
    pow++;
    n /= 2;
  }
  if (pow > 12)
    return 14;
  return pow;
}


x86 assembly (clang, -O0):
<getColorCode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1134 <getColorCode+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    110e <getColorCode+0xe>
cmpl   $0xc,-0xc(%rbp)
jle    114a <getColorCode+0x4a>
movl   $0xe,-0x4(%rbp)
jmp    1150 <getColorCode+0x50>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getColorCode>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     112a <getColorCode+0x2a>
xor    %eax,%eax
mov    %edi,%ecx
xchg   %ax,%ax
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <getColorCode+0x10>
lea    0x1(%rax),%ecx
cmp    $0xc,%eax
mov    $0xe,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getColorCode(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = icmp ugt i32 %4, 11
%11 = select i1 %10, i32 14, i32 %6
br label %12
12: ; preds = %9, %1
%13 = phi i32 [ 1, %1 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t n) { return realloc(p, n); }


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

x86 assembly (clang, -O2):
<xrealloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
void f4() { int x = 15 % 2; }


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

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

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

LLVM IR (-O2):
define void @f4() {
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char const *, int);
int strlen(char const *);
int cmp1_android(const char *s1, int n, const char *s2) {
  if (strlen(s2) != n)
    return 0;
  return memcmp(s1, s2, n) == 0;
}


x86 assembly (clang, -O0):
<cmp1_android>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
cmp    -0x14(%rbp),%eax
je     1151 <cmp1_android+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1170 <cmp1_android+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp1_android>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebx
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
jne    1155 <cmp1_android+0x35>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @cmp1_android(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = icmp eq i32 %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @memcmp(i8* %0, i8* %2, i32 %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ %9, %6 ], [ 0, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t div_u64(uint64_t dividend, uint32_t divisor) {
  return dividend / divisor;
}


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

x86 assembly (clang, -O2):
<div_u64>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @div_u64(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
double Double_abs(double x) { return x > 0.0 ? x : -x; }


x86 assembly (clang, -O0):
<Double_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <Double_abs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <Double_abs+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @Double_abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @Double_abs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
int test_imm_BBint8_reg(signed char val) {
  return ((val) & (0xBB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BBint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xbb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BBint8_reg>:
test   $0xbb,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BBint8_reg(i8 signext %0) {
%2 = and i8 %0, -69
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cs2sncb(void *);
void cs2sncb_(void *cbfn) { cs2sncb(cbfn); }


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

x86 assembly (clang, -O2):
<cs2sncb_>:
jmp    1030 <cs2sncb@plt>

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

LLVM IR (-O2):
define void @cs2sncb_(i8* %0) {
%2 = tail call i32 @cs2sncb(i8* %0)
ret void
}
int Operand_mr3_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0x3) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_mr3_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffffc,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_mr3_encode>:
xor    %eax,%eax
cmpl   $0x4,(%rdi)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @Operand_mr3_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ parse_inputstream(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  parse_inputstream(stdin);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <parse_inputstream@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <parse_inputstream@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @parse_inputstream(i32 %3)
%5 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ indent(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void maybe_verbose(int verbose, uint32_t in, const char *base) {
  if (verbose) {
    indent(in);
    printf("%s: %s\n", base, strerror(errno));
  }
}


x86 assembly (clang, -O0):
<maybe_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     117d <maybe_verbose+0x4d>
mov    -0x8(%rbp),%edi
call   1040 <indent@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maybe_verbose>:
test   %edi,%edi
je     1160 <maybe_verbose+0x30>
push   %rbx
mov    %rdx,%rbx
mov    %esi,%edi
call   1040 <indent@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @maybe_verbose(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @indent(i32 %1)
%7 = load i32, i32* @errno
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %8)
br label %10
10: ; preds = %5, %3
ret void
}
long long r17(void *x) { return *(long long *)(x + 32751); }


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

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

LLVM IR (-O0):
define i64 @r17(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32751
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r17(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32751
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
void foo093(int p) {}


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

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

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

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

/* Variables and functions */
bool dummy_select(uint8_t b) {
  (void)b;
  return true;
}


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

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

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

LLVM IR (-O2):
define i32 @dummy_select(i32 %0) {
ret i32 1
}
int GifIMin(int l, int r) { return l < r ? l : r; }


x86 assembly (clang, -O0):
<GifIMin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <GifIMin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <GifIMin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GifIMin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @GifIMin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @GifIMin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void gtk_fixed_set_has_window() {}


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

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

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

LLVM IR (-O2):
define void @gtk_fixed_set_has_window() {
ret void
}
div4(signed short x, signed short y) { return x / y; }


x86 assembly (clang, -O0):
<div4>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<div4>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @div4(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = sdiv i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @div4(i16 signext %0, i16 signext %1) {
%3 = sext i16 %0 to i32
%4 = sext i16 %1 to i32
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ arp_show(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char **argv) { exit(arp_show(argv[1])); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <arp_show@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <arp_show@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @arp_show(i8* %8)
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @arp_show(i8* %4)
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void show_usage(int rv) {
  FILE *fp = rv ? stderr : stdout;
  fprintf(fp, "Usage:\n"
              "suselog command [args]\n"
              "Currently supported commands:\n"
              "  merge     merge another log file into the specified one\n"
              "  help      show this help message\n");
  exit(rv);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1148 <show_usage+0x28>
mov    0x2ea4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1156 <show_usage+0x36>
mov    0x2e89(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1130 <show_usage+0x10>
mov    0x2eaa(%rip),%rax
jmp    1137 <show_usage+0x17>
mov    0x2ea9(%rip),%rax
mov    (%rax),%rcx
lea    0xebf(%rip),%rdi
mov    $0x99,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@stdout = global i32* null
@.str = [154 x i8] c"Usage:\0Asuselog command [args]\0ACurrently supported commands:\0A merge merge another log file into the specified one\0A help show this help message\0A\00"
define void @show_usage(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32*, i32** @stderr
br label %10
8: ; preds = %1
%9 = load i32*, i32** @stdout
br label %10
10: ; preds = %8, %6
%11 = phi i32* [ %7, %6 ], [ %9, %8 ]
store i32* %11, i32** %3
%12 = load i32*, i32** %3
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %2
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@stdout = global i32* null
@.str = [154 x i8] c"Usage:\0Asuselog command [args]\0ACurrently supported commands:\0A merge merge another log file into the specified one\0A help show this help message\0A\00"
define void @show_usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32*, i32** @stderr
%4 = load i32*, i32** @stdout
%5 = select i1 %2, i32* %4, i32* %3
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i64 153, i64 1, i32* %5)
%7 = tail call i32 @exit(i32 %0)
unreachable
}
int cam_interrupt_test(const int c) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @cam_interrupt_test(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void p1() { printf("p1\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"p1\00"
define void @p1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t bench_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((uint64_t)tv.tv_sec * 1000000 + tv.tv_usec) * 1000;
}


x86 assembly (clang, -O0):
<bench_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
imul   $0x3e8,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
imul   $0x3e8,%eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @bench_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = mul nsw i32 %9, 1000
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @bench_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
%11 = mul nsw i32 %10, 1000
ret i32 %11
}
long svd_imin(long a, long b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<svd_imin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <svd_imin+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <svd_imin+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<svd_imin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @svd_imin(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @svd_imin(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t get_int32(const char *buff) { return (*(int32_t *)buff); }


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

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

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

LLVM IR (-O2):
define i32 @get_int32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void SSMR3ValidateFile(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3ValidateFile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OS_TaskRegister();
void task_0(void) {
  OS_TaskRegister();
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<task_0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OS_TaskRegister@plt>
jmp    111b <task_0+0xb>

x86 assembly (clang, -O2):
<task_0>:
push   %rax
xor    %eax,%eax
call   1030 <OS_TaskRegister@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <task_0+0x10>

LLVM IR (-O0):
define void @task_0() {
%1 = call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_0() {
%1 = tail call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t MakeHuffmanTableEntry(int value, int length) {
  return (length << 12) | value;
}


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

x86 assembly (clang, -O2):
<MakeHuffmanTableEntry>:
mov    %esi,%eax
shl    $0xc,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @MakeHuffmanTableEntry(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 12
%7 = load i32, i32* %3
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @MakeHuffmanTableEntry(i32 %0, i32 %1) {
%3 = shl i32 %1, 12
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int func() { system("/bin/sh"); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @func() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @func() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int sprntf(int c, int _sptr) {
  char **sptr = (char **)_sptr;
  char *s = *sptr;
  *s++ = c;
  *sptr = s;
  return (unsigned char)c;
}


x86 assembly (clang, -O0):
<sprntf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprntf>:
movslq %esi,%rax
mov    (%rax),%rcx
mov    %dil,(%rcx)
add    $0x1,%rcx
mov    %rcx,(%rax)
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @sprntf(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8**
store i8** %9, i8*** %5
%10 = load i8**, i8*** %5
%11 = load i8*, i8** %10
store i8* %11, i8** %6
%12 = load i32, i32* %3
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %6
store i8 %13, i8* %14
%16 = load i8*, i8** %6
%17 = load i8**, i8*** %5
store i8* %16, i8** %17
%18 = load i32, i32* %3
%19 = trunc i32 %18 to i8
%20 = zext i8 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @sprntf(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = inttoptr i64 %3 to i8**
%5 = load i8*, i8** %4
%6 = trunc i32 %0 to i8
%7 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
store i8* %7, i8** %4
%8 = and i32 %0, 255
ret i32 %8
}
/* Variables and functions */
int median(int, int);
int handle(int n, int hex) {
  int m, r = n;
  while (n != 0) {
    m = median(n, hex);
    r += n % hex * m;
    n = (n - (n % hex)) / hex;
  }
  return r;
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116d <handle+0x5d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <median@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x14(%rbp),%eax
sub    %edx,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1124 <handle+0x14>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     113f <handle+0x2f>
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edi,%ebx
nop
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <median@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %r14d
imul   %ecx,%edx
add    %edx,%ebp
mov    %eax,%ebx
test   %eax,%eax
jne    1120 <handle+0x10>
jmp    1141 <handle+0x31>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @handle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
store i32 %7, i32* %6
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @median(i32 %12, i32 %13)
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = load i32, i32* %5
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %6
%21 = add nsw i32 %20, %19
store i32 %21, i32* %6
%22 = load i32, i32* %3
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = srem i32 %23, %24
%26 = sub nsw i32 %22, %25
%27 = load i32, i32* %4
%28 = sdiv i32 %26, %27
store i32 %28, i32* %3
br label %8
29: ; preds = %8
%30 = load i32, i32* %6
ret i32 %30
}

LLVM IR (-O2):
define i32 @handle(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %0, %2 ]
%6 = phi i32 [ %11, %4 ], [ %0, %2 ]
%7 = tail call i32 @median(i32 %6, i32 %1)
%8 = srem i32 %6, %1
%9 = mul nsw i32 %8, %7
%10 = add nsw i32 %9, %5
%11 = sdiv i32 %6, %1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %14
}
void GPIODebounceTimeConfig(unsigned int baseAdd, unsigned int debounceTime) {
  (*((volatile unsigned int *)(baseAdd + (0x154)))) =
      (debounceTime & (0x000000FFu));
}


x86 assembly (clang, -O0):
<GPIODebounceTimeConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
mov    -0x4(%rbp),%eax
add    $0x154,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIODebounceTimeConfig>:
movzbl %sil,%eax
add    $0x154,%edi
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @GPIODebounceTimeConfig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = load i32, i32* %3
%8 = add i32 %7, 340
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %6, i32* %10
ret void
}

LLVM IR (-O2):
define void @GPIODebounceTimeConfig(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = add i32 %0, 340
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %3, i32* %6
ret void
}
void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos) {}


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

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

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

LLVM IR (-O2):
%struct.rq_qos = type opaque
define void @blk_mq_debugfs_unregister_rqos(%struct.rq_qos* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void leVet(int vet[], int tam) {
  int i;
  printf("Digite %d numeros : ", tam);
  for (i = 0; i < tam; i++)
    scanf("%d", &vet[i]);
}


x86 assembly (clang, -O0):
<leVet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117a <leVet+0x5a>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeae(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <leVet+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leVet>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
test   %ebp,%ebp
jle    1165 <leVet+0x45>
mov    %ebp,%ebp
lea    0xed3(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%rbp
jne    1150 <leVet+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Digite %d numeros : \00"
@.str.1 = [3 x i8] c"%d\00"
define void @leVet(i32* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret void
}
short strleng(char *word) {
  int i = 0;
  for (; word[i] != '\0'; i++)
    ;
  return i;
}


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

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

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

LLVM IR (-O2):
define signext i16 @strleng(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i16
ret i16 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ AT_SYMLINK_NOFOLLOW;
int fchmodat(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
             int /*<<< orphan*/);
int lchmod(const char *path, mode_t mode) {
  return fchmodat(AT_FDCWD, path, mode, AT_SYMLINK_NOFOLLOW);
}


x86 assembly (clang, -O0):
<lchmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
call   1030 <fchmodat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lchmod>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <fchmodat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lchmod(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @AT_FDCWD
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%9 = call i32 @fchmodat(i32 %5, i8* %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lchmod(i8* %0, i32 %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%5 = tail call i32 @fchmodat(i32 %3, i8* %0, i32 %1, i32 %4)
ret i32 %5
}