xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ hanoi(int /*<<< orphan*/, int, int, int);
int main() {
  hanoi(0, 2, 1, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <hanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @hanoi(i32 0, i32 2, i32 1, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ distance_squared_sf(double const, double const, double const,
                                       double const);
double sqrt(int /*<<< orphan*/);
double __attribute__((__always___, __gnu___, __flatten__, __const__,
                      __artificial__))
distance_sf(const double vx, const double vy, const double wx,
            const double wy) {
  return sqrt(distance_squared_sf(vx, vy, wx, wy));
}


x86 assembly (clang, -O0):
<distance_sf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <distance_squared_sf@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_sf>:
push   %rax
call   1030 <distance_squared_sf@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @distance_sf(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call i32 @distance_squared_sf(double %9, double %10, double %11, double %12)
%14 = call double @sqrt(i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @distance_sf(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @distance_squared_sf(double %0, double %1, double %2, double %3)
%6 = tail call double @sqrt(i32 %5)
ret double %6
}
char *BKKCrypt(char *pswd) { return pswd; }


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

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

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

LLVM IR (-O2):
define i8* @BKKCrypt(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) { puts("Hallo Welt?"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hallo Welt?\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hallo Welt?\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int sumSquaredDigits(int n) {
  int value = 0;
  while (n > 0) {
    value += (n % 10) * (n % 10);
    n /= 10;
  }
  return value;
}


x86 assembly (clang, -O0):
<sumSquaredDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1150 <sumSquaredDigits+0x50>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
imul   %edx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <sumSquaredDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumSquaredDigits>:
xor    %eax,%eax
test   %edi,%edi
jle    1130 <sumSquaredDigits+0x30>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
imul   %ecx,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <sumSquaredDigits+0x10>
ret

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

LLVM IR (-O2):
define i32 @sumSquaredDigits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = mul nuw nsw i32 %6, %6
%8 = add nuw nsw i32 %7, %4
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int max_width;
};
typedef TYPE_1__ XIconSize;

/* Variables and functions */
void set_XIconSize_max_width(void *_p, int _v) {
  ((XIconSize *)_p)->max_width = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XIconSize_max_width>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XIconSize_max_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
void *malloc(size_t);
int strlen(void *);
void *memory(size_t size, void *data) {
  if (size == 0) {
    size_t len = strlen(data) + 1;
    return malloc(len);
  } else {
    return malloc(size);
  }
}


x86 assembly (clang, -O0):
<memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <memory+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    116c <memory+0x4c>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory>:
test   %rdi,%rdi
je     112a <memory+0xa>
jmp    1040 <malloc@plt>
push   %rax
mov    %rsi,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rdi
add    $0x8,%rsp
jmp    1040 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @memory(i64 %0, i8* %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %1)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
br label %8
8: ; preds = %2, %4
%9 = phi i64 [ %7, %4 ], [ %0, %2 ]
%10 = tail call i8* @malloc(i64 %9)
ret i8* %10
}
/* Variables and functions */
int convertNumber(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, const char *argv[]) {
  char number[100];
  printf("Please input number: ");
  scanf("%s", number);
  printf("Number is %d\n", convertNumber(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1040 <convertNumber@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <convertNumber@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Please input number: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [14 x i8] c"Number is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%11 = call i32 @convertNumber(i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Please input number: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [14 x i8] c"Number is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @convertNumber(i8* %4)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
int ft_isspace(char c) {
  if (c == '\n' || c == '\t' || c == '\v' || c == '\f' || c == '\r' ||
      c == ' ') {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xb,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xc,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1164 <ft_isspace+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <ft_isspace+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%cl
jae    110e <ft_isspace+0xe>
ret
cmp    $0x20,%dil
je     110d <ft_isspace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 12, label %3
i8 11, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int tga_decode_888(unsigned char *input_bytes, unsigned char *output_bytes) {
  output_bytes[0] = (input_bytes[2]);
  output_bytes[1] = (input_bytes[1]);
  output_bytes[2] = (input_bytes[0]);
  return 3;
}


x86 assembly (clang, -O0):
<tga_decode_888>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tga_decode_888>:
mov    0x2(%rdi),%al
mov    %al,(%rsi)
mov    0x1(%rdi),%al
mov    %al,0x1(%rsi)
mov    (%rdi),%al
mov    %al,0x2(%rsi)
mov    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @tga_decode_888(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = load i8, i8* %3
store i8 %4, i8* %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = load i8, i8* %0
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
ret i32 3
}
int sysfs_create_group(struct kobject *x, struct attribute_group *y) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
%struct.attribute_group = type opaque
define i32 @sysfs_create_group(%struct.kobject* %0, %struct.attribute_group* %1) {
%3 = alloca %struct.kobject*
%4 = alloca %struct.attribute_group*
%5 = alloca i32
store %struct.kobject* %0, %struct.kobject** %3
store %struct.attribute_group* %1, %struct.attribute_group** %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute_group = type opaque
define i32 @sysfs_create_group(%struct.kobject* nocapture readnone %0, %struct.attribute_group* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ doupdate();
int /*<<< orphan*/ update_panels();
void mydoupdate() {
  update_panels();
  doupdate();
}


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

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

LLVM IR (-O0):
define void @mydoupdate() {
%1 = call i32 (...) @update_panels()
%2 = call i32 (...) @doupdate()
ret void
}

LLVM IR (-O2):
define void @mydoupdate() {
%1 = tail call i32 (...) @update_panels()
%2 = tail call i32 (...) @doupdate()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_endian();
int main(int argc, char **argv) {
  get_endian();
  return 0;
}


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

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

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 = call i32 (...) @get_endian()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get_endian()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ TimerBaseValid(unsigned long);
void TimerIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(TimerBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000018))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<TimerIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <TimerBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x18(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <TimerBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
or     %r14,0x18(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @TimerIntEnable(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 = call i32 @TimerBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = add i64 %9, 24
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @TimerIntEnable(i64 %0, i64 %1) {
%3 = tail call i32 @TimerBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 24
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, %1
store volatile i64 %8, i64* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, char *);
int zomp_readChar(void *file, char *val) {
  return fscanf((FILE *)file, "%c", val);
}


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

x86 assembly (clang, -O2):
<zomp_readChar>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fscanf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @zomp_readChar(i8* nocapture %0, i8* %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %4
}
/* Variables and functions */
int strcmp(void const *, void const *);
int hash_comp_default(const void *key1, const void *key2) {
  return strcmp(key1, key2);
}


x86 assembly (clang, -O0):
<hash_comp_default>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_comp_default>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @hash_comp_default(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int, int, int);
void print_size(const char *label, uint32_t val) {
  printf("%s cache size: %#10x %10dB %10dK\n", label, val, val, val / 1024);
}


x86 assembly (clang, -O0):
<print_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%eax
mov    $0x400,%edi
cltd
idiv   %edi
mov    -0x10(%rbp),%edx
mov    %eax,%r8d
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_size>:
mov    %esi,%ecx
mov    %rdi,%rsi
lea    0x3ff(%rcx),%r8d
test   %ecx,%ecx
cmovns %ecx,%r8d
sar    $0xa,%r8d
lea    0xed3(%rip),%rdi
mov    %ecx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"%s cache size: %x %10dB %10dK\0A\00"
define void @print_size(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 1024
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6, i32 %7, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"%s cache size: %x %10dB %10dK\0A\00"
define void @print_size(i8* %0, i32 %1) {
%3 = sdiv i32 %1, 1024
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blah();
void arf() {
  if (""[0] == 0)
    blah();
}


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

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

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

LLVM IR (-O2):
define void @arf() {
%1 = tail call i32 (...) @blah()
ret void
}
/* Variables and functions */
int snprintf(char *, size_t, char *, char const *, int, int);
int sys_print_domain_info_to_file(char *output_buf, size_t output_buf_size,
                                  const char *na, int ttl, int type) {
  return snprintf(output_buf, output_buf_size, "%s\t%d\t%d\t", na, ttl, type);
}


x86 assembly (clang, -O0):
<sys_print_domain_info_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_print_domain_info_to_file>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %rdx,%rcx
lea    0xee0(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s\09%d\09%d\09\00"
define i32 @sys_print_domain_info_to_file(i8* %0, i64 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @snprintf(i8* %11, i64 %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s\09%d\09%d\09\00"
define i32 @sys_print_domain_info_to_file(i8* %0, i64 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int gmx_genion(int, char **);
int main(int argc, char *argv[]) { return gmx_genion(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_genion@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <gmx_genion@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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_genion(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_genion(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void getStringCallByRef(char *reference) {
  strcat(reference, "bla");
  strcat(reference, "/");
  strcat(reference, "blub");
  printf("string : '%s'\n", reference);
}


x86 assembly (clang, -O0):
<getStringCallByRef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStringCallByRef>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcat@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"bla\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [5 x i8] c"blub\00"
@.str.3 = [15 x i8] c"string : '%s'\0A\00"
define void @getStringCallByRef(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"bla\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [5 x i8] c"blub\00"
@.str.3 = [15 x i8] c"string : '%s'\0A\00"
define void @getStringCallByRef(i8* %0) {
%2 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %0)
ret void
}
void foo_1_1_2_1_2_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_2_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void FlashEndSaveControl(void) {
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<FlashEndSaveControl>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashEndSaveControl>:
push   %rax
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rax
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @FlashEndSaveControl() {
%1 = call i32 @SendChar(i32 255)
%2 = call i32 @SendChar(i32 252)
%3 = call i32 @SendChar(i32 255)
%4 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @FlashEndSaveControl() {
%1 = tail call i32 @SendChar(i32 255)
%2 = tail call i32 @SendChar(i32 252)
%3 = tail call i32 @SendChar(i32 255)
%4 = tail call i32 @SendChar(i32 255)
ret void
}
int test_imm_00uint16_mem(unsigned short *val) {
  return ((*val) & (0x00 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_00uint16_mem(i16* nocapture readnone %0) {
ret i32 -40
}
/* Type definitions */
struct rtattr {
  int dummy;
};
typedef int /*<<< orphan*/ __be16;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ rta_getattr_u16(struct rtattr const *);
__be16 rta_getattr_be16(const struct rtattr *rta) {
  return ntohs(rta_getattr_u16(rta));
}


x86 assembly (clang, -O0):
<rta_getattr_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rta_getattr_u16@plt>
mov    %eax,%edi
call   1040 <ntohs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rta_getattr_be16>:
push   %rax
call   1030 <rta_getattr_u16@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ntohs@plt>

LLVM IR (-O0):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_be16(%struct.rtattr* %0) {
%2 = alloca %struct.rtattr*
store %struct.rtattr* %0, %struct.rtattr** %2
%3 = load %struct.rtattr*, %struct.rtattr** %2
%4 = call i32 @rta_getattr_u16(%struct.rtattr* %3)
%5 = call i32 @ntohs(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_be16(%struct.rtattr* %0) {
%2 = tail call i32 @rta_getattr_u16(%struct.rtattr* %0)
%3 = tail call i32 @ntohs(i32 %2)
ret i32 %3
}
int round_up_power_2(int num) {
  num--;
  num |= num >> 1;
  num |= num >> 2;
  num |= num >> 4;
  num |= num >> 8;
  num |= num >> 16;
  num++;
  return num;
}


x86 assembly (clang, -O0):
<round_up_power_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up_power_2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @round_up_power_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @round_up_power_2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
int FloatToInt16(float x) {
  int y;
  if (x < 0.f) {
    if (x <= -32768.0f)
      y = -32768;
    else
      y = (int)(x - 0.5f);
  } else {
    if (x >= 32767.0f)
      y = 32767;
    else
      y = (int)(x + 0.5f);
  }
  return y;
}


x86 assembly (clang, -O0):
<FloatToInt16>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1151 <FloatToInt16+0x51>
movss  0xeea(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jb     1134 <FloatToInt16+0x34>
movl   $0xffff8000,-0x8(%rbp)
jmp    114c <FloatToInt16+0x4c>
movss  -0x4(%rbp),%xmm0
movss  0xec3(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    118c <FloatToInt16+0x8c>
movss  -0x4(%rbp),%xmm0
movss  0xea2(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1173 <FloatToInt16+0x73>
movl   $0x7fff,-0x8(%rbp)
jmp    1187 <FloatToInt16+0x87>
movss  0xe89(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    118c <FloatToInt16+0x8c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FloatToInt16>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1124 <FloatToInt16+0x24>
mov    $0xffff8000,%eax
movss  0xef3(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    113e <FloatToInt16+0x3e>
addss  0xeea(%rip),%xmm0
jmp    113a <FloatToInt16+0x3a>
mov    $0x7fff,%eax
ucomiss 0xed0(%rip),%xmm0
jae    113e <FloatToInt16+0x3e>
addss  0xeca(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @FloatToInt16(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load float, float* %2
%8 = fcmp ole float %7, -3.276800e+04
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 -32768, i32* %3
br label %14
10: ; preds = %6
%11 = load float, float* %2
%12 = fsub float %11, 5.000000e-01
%13 = fptosi float %12 to i32
store i32 %13, i32* %3
br label %14
14: ; preds = %10, %9
br label %24
15: ; preds = %1
%16 = load float, float* %2
%17 = fcmp oge float %16, 3.276700e+04
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 32767, i32* %3
br label %23
19: ; preds = %15
%20 = load float, float* %2
%21 = fadd float %20, 5.000000e-01
%22 = fptosi float %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %19, %18
br label %24
24: ; preds = %23, %14
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @FloatToInt16(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fcmp ugt float %0, -3.276800e+04
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = fadd float %0, -5.000000e-01
%7 = fptosi float %6 to i32
br label %13
8: ; preds = %1
%9 = fcmp ult float %0, 3.276700e+04
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = fadd float %0, 5.000000e-01
%12 = fptosi float %11 to i32
br label %13
13: ; preds = %8, %3, %10, %5
%14 = phi i32 [ %7, %5 ], [ %12, %10 ], [ -32768, %3 ], [ 32767, %8 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wcrtomb(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int wctomb(char *s, wchar_t wc) {
  if (!s)
    return 0;
  return wcrtomb(s, wc, 0);
}


x86 assembly (clang, -O0):
<wctomb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <wctomb+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1147 <wctomb+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1030 <wcrtomb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctomb>:
test   %rdi,%rdi
je     111c <wctomb+0xc>
xor    %edx,%edx
jmp    1030 <wcrtomb@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @wctomb(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @wcrtomb(i8* %0, i32 %1, i32 0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int ntohl(int);
int unpack_int(const void **pp) {
  int i = ntohl(*((int *)(*pp)));
  *pp += sizeof(int);
  return i;
}


x86 assembly (clang, -O0):
<unpack_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <ntohl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_int>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    (%rbx),%edi
call   1030 <ntohl@plt>
add    $0x4,%rbx
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @unpack_int(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @ntohl(i32 %7)
store i32 %8, i32* %3
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = getelementptr i8, i8* %10, i64 4
store i8* %11, i8** %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @unpack_int(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @ntohl(i32 %4)
%6 = getelementptr i8, i8* %2, i64 4
store i8* %6, i8** %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error_print(char *);
int send(int, char const *, int, int /*<<< orphan*/);
int common_write(int fd, const char *buffer, int buflen) {
  int write_size = send(fd, buffer, buflen, 0);
  if (write_size < 0)
    error_print("write error\n");
  return write_size;
}


x86 assembly (clang, -O0):
<common_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115c <common_write+0x3c>
lea    0xea9(%rip),%rdi
call   1040 <error_print@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<common_write>:
push   %rbx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    113a <common_write+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error_print@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"write error\0A\00"
define i32 @common_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error_print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void perror_exit(const char *info) {
  perror(info);
  exit(0);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
define void @perror_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
unsigned xrop3_180_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_180_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_180_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    %eax,%ecx
or     %edi,%eax
and    %ecx,%eax
not    %edi
and    %esi,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_180_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = or i32 %33, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = and i32 %42, %43
%45 = or i32 %38, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_180_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = xor i32 %7, %4
%9 = and i32 %8, %5
%10 = xor i32 %3, -1
%11 = and i32 %10, %6
%12 = or i32 %9, %11
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void QEIFilterEnable(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x4002C000) || (ui32Base == 0x4002D000));
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) |= 0x00002000;
}


x86 assembly (clang, -O0):
<QEIFilterEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x4002c000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <QEIFilterEnable+0x2a>
cmpl   $0x4002d000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
or     $0x2000,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIFilterEnable>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x4002c000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
orl    $0x2000,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @QEIFilterEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073922048
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073926144
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 0
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, 8192
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @QEIFilterEnable(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073922048
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = sext i32 %0 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, 8192
store volatile i32 %9, i32* %7
ret void
}