xunge/DecIR huggingface dataset:
double berechne_durchschnittsverbrauch_l_pro_100km(double strecke,
                                                   double verbrauch) {
  double durchschnittsverbrauch = verbrauch / (strecke / 100);
  return durchschnittsverbrauch;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
divsd  0xef8(%rip),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @berechne_durchschnittsverbrauch_l_pro_100km(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double %7, 1.000000e+02
%9 = fdiv double %6, %8
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @berechne_durchschnittsverbrauch_l_pro_100km(double %0, double %1) {
%3 = fdiv double %0, 1.000000e+02
%4 = fdiv double %1, %3
ret double %4
}
int params__sign_value(char c) {
  if (c == '+') {
    return 1;
  } else if (c == '-') {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<params__sign_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
jne    1123 <params__sign_value+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1143 <params__sign_value+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    113c <params__sign_value+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <params__sign_value+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<params__sign_value>:
xor    %ecx,%ecx
cmp    $0x2d,%dil
sete   %cl
neg    %ecx
cmp    $0x2b,%dil
mov    $0x1,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @params__sign_value(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, 43
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 45
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @params__sign_value(i8 signext %0) {
%2 = icmp eq i8 %0, 45
%3 = sext i1 %2 to i32
%4 = icmp eq i8 %0, 43
%5 = select i1 %4, i32 1, i32 %3
ret i32 %5
}
int square(int file, int rank) { return 8 * rank + file; }


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

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

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

LLVM IR (-O2):
define i32 @square(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 3
%4 = add nsw i32 %3, %0
ret i32 %4
}
unsigned int red(unsigned int x) { return (x >> 24) & 0xff; }


x86 assembly (clang, -O0):
<red>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<red>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @red(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @red(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
/* Variables and functions */
unsigned long file_new_internal(unsigned long, int, unsigned long *,
                                int /*<<< orphan*/);
unsigned long int file_open_thunk(unsigned long int self, int argc,
                                  unsigned long int *argv) {
  return file_new_internal(self, argc, argv, 0);
}


x86 assembly (clang, -O0):
<file_open_thunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <file_new_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_open_thunk>:
xor    %ecx,%ecx
jmp    1030 <file_new_internal@plt>

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

LLVM IR (-O2):
define i64 @file_open_thunk(i64 %0, i32 %1, i64* %2) {
%4 = tail call i64 @file_new_internal(i64 %0, i32 %1, i64* %2, i32 0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void print_revision(const char *progname, const char *revision) {
  printf("Program: %s %s\n", progname, revision);
}


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

x86 assembly (clang, -O2):
<print_revision>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Program: %s %s\0A\00"
define void @print_revision(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 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Program: %s %s\0A\00"
define void @print_revision(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void tear_down() {}


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

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

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

LLVM IR (-O2):
define void @tear_down() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *arg) {
  fprintf(stderr, "usage: %s [PID|-help]\n", arg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"usage: %s [PID|-help]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: %s [PID|-help]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void avio_put_str() {}


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

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

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

LLVM IR (-O2):
define void @avio_put_str() {
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, unsigned long, int, int, int);
int date_string(unsigned long date, int offset, char *buf, int len) {
  int sign = '+';
  if (offset < 0) {
    offset = -offset;
    sign = '-';
  }
  return snprintf(buf, len, "%lu %c%02d%02d", date, sign, offset / 60,
                  offset % 60);
}


x86 assembly (clang, -O0):
<date_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x2b,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1146 <date_string+0x36>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x2d,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x8(%rbp),%rcx
mov    -0x20(%rbp),%r8d
mov    -0xc(%rbp),%eax
mov    $0x3c,%r9d
cltd
idiv   %r9d
mov    %eax,%r9d
mov    -0xc(%rbp),%eax
mov    $0x3c,%r10d
cltd
idiv   %r10d
mov    %edx,%eax
lea    0xe85(%rip),%rdx
mov    %eax,(%rsp)
call   1030 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_string>:
push   %rax
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
mov    %rdx,%r11
mov    %rdi,%r10
shr    $0x1f,%esi
lea    (%rsi,%rsi,1),%r8d
add    $0x2b,%r8d
mov    $0x88888889,%r9d
imul   %rax,%r9
shr    $0x25,%r9
imul   $0x3c,%r9d,%edx
sub    %edx,%eax
mov    %eax,(%rsp)
lea    0xeb9(%rip),%rdx
mov    %r11,%rdi
mov    %ecx,%esi
mov    %r10,%rcx
call   1030 <snprintf@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%lu %c%02d%02d\00"
define i32 @date_string(i64 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i64 %0, i64* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
store i32 43, i32* %9
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %6
%14 = sub nsw i32 0, %13
store i32 %14, i32* %6
store i32 45, i32* %9
br label %15
15: ; preds = %12, %4
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = load i64, i64* %5
%19 = load i32, i32* %9
%20 = load i32, i32* %6
%21 = sdiv i32 %20, 60
%22 = load i32, i32* %6
%23 = srem i32 %22, 60
%24 = call i32 @snprintf(i8* %16, i32 %17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %18, i32 %19, i32 %21, i32 %23)
ret i32 %24
}

LLVM IR (-O2):
@.str = [15 x i8] c"%lu %c%02d%02d\00"
define i32 @date_string(i64 %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp slt i32 %1, 0
%6 = sub nsw i32 0, %1
%7 = select i1 %5, i32 %6, i32 %1
%8 = select i1 %5, i32 45, i32 43
%9 = udiv i32 %7, 60
%10 = urem i32 %7, 60
%11 = tail call i32 @snprintf(i8* %2, i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %8, i32 %9, i32 %10)
ret i32 %11
}
/* Variables and functions */
char *strchr(char *s, char c) {
  while (*s)
    if (*s == c)
      return s;
  return (char *)0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strchr+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    113b <strchr+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <strchr+0x48>
jmp    110e <strchr+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%al
test   %al,%al
je     1112 <strchr+0x12>
cmp    %sil,%al
je     1112 <strchr+0x12>
nopl   0x0(%rax,%rax,1)
jmp    1110 <strchr+0x10>
xor    %ecx,%ecx
test   %al,%al
cmove  %rcx,%rdi
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = icmp eq i8 %3, %1
%6 = or i1 %4, %5
br i1 %6, label %8, label %7
7: ; preds = %2, %7
br label %7
8: ; preds = %2
%9 = select i1 %4, i8* null, i8* %0
ret i8* %9
}
/* Variables and functions */
int scanw(char *, short *);
int i2_scanw(char *fmt, short *i) { return (scanw(fmt, i)); }


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

x86 assembly (clang, -O2):
<i2_scanw>:
jmp    1030 <scanw@plt>

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

LLVM IR (-O2):
define i32 @i2_scanw(i8* %0, i16* %1) {
%3 = tail call i32 @scanw(i8* %0, i16* %1)
ret i32 %3
}
void inst_lowercase(char *inst_name, char *ret) {
  int i;
  for (i = 0; i != 3; i++)
    ret[i] = inst_name[i] + 32;
  ret[3] = '\0';
  return;
}


x86 assembly (clang, -O0):
<inst_lowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
je     1147 <inst_lowercase+0x47>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x20,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <inst_lowercase+0x13>
mov    -0x10(%rbp),%rax
movb   $0x0,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inst_lowercase>:
mov    (%rdi),%al
add    $0x20,%al
mov    %al,(%rsi)
mov    0x1(%rdi),%al
add    $0x20,%al
mov    %al,0x1(%rsi)
mov    0x2(%rdi),%al
add    $0x20,%al
mov    %al,0x2(%rsi)
movb   $0x0,0x3(%rsi)
ret

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

LLVM IR (-O2):
define void @inst_lowercase(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 32
store i8 %4, i8* %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = add i8 %6, 32
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = add i8 %10, 32
%12 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %1, i64 3
store i8 0, i8* %13
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
const char *drbd_buildtag(void) {
  if (strcmp("", "") == 0) {
    return "";
  } else {
    return ""
           " GIT-hash: "
           ""
           " build by "
           ""
           "@"
           ""
           ", "
           "Sun Jan 23 03:24:08 2022";
  }
}


x86 assembly (clang, -O0):
<drbd_buildtag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xf11(%rip),%rsi
mov    %rsi,%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1141 <drbd_buildtag+0x31>
lea    0xef8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <drbd_buildtag+0x3c>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drbd_buildtag>:
push   %rbx
lea    0xf18(%rip),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
lea    0xed3(%rip),%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [49 x i8] c" GIT-hash: build by @, Sun Jan 23 03:24:08 2022\00"
define i8* @drbd_buildtag() {
%1 = alloca i8*
%2 = call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
br label %6
5: ; preds = %0
store i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %4
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [49 x i8] c" GIT-hash: build by @, Sun Jan 23 03:24:08 2022\00"
define i8* @drbd_buildtag() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(int argc, char **argv) {
  fprintf(stderr, "Usage: %s [up|down|print]\n", argv[0]);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s [up|down|print]\0A\00"
define void @print_usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s [up|down|print]\0A\00"
define void @print_usage(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
struct lba_info {
  int dummy;
};

/* Variables and functions */
int write_lba_attribute(struct lba_info *, char *, char *);
int hplba_start(struct lba_info *lba) {
  return write_lba_attribute(lba, "utilization", "start");
}


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

x86 assembly (clang, -O2):
<hplba_start>:
lea    0xee9(%rip),%rsi
lea    0xeee(%rip),%rdx
jmp    1030 <write_lba_attribute@plt>

LLVM IR (-O0):
%struct.lba_info = type { i32 }
@.str = [12 x i8] c"utilization\00"
@.str.1 = [6 x i8] c"start\00"
define i32 @hplba_start(%struct.lba_info* %0) {
%2 = alloca %struct.lba_info*
store %struct.lba_info* %0, %struct.lba_info** %2
%3 = load %struct.lba_info*, %struct.lba_info** %2
%4 = call i32 @write_lba_attribute(%struct.lba_info* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
%struct.lba_info = type { i32 }
@.str = [12 x i8] c"utilization\00"
@.str.1 = [6 x i8] c"start\00"
define i32 @hplba_start(%struct.lba_info* %0) {
%2 = tail call i32 @write_lba_attribute(%struct.lba_info* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}
long env_djb2_hash(char *s) {
  long hash = 5381;
  int c;
  while (c = *s++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<env_djb2_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <env_djb2_hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <env_djb2_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_djb2_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <env_djb2_hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <env_djb2_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @env_djb2_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add nsw i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ xwayd_accept(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int pid;
  if (argc != 2) {
    printf("Usage : %s <server port>\n", argv[0]);
    return -1;
  }
  xwayd_accept(atoi(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <xwayd_accept@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    114a <main+0x1a>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <xwayd_accept@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Usage : %s <server port>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 -1, i32* %3
br label %20
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = call i32 @xwayd_accept(i32 %18)
store i32 0, i32* %3
br label %20
20: ; preds = %14, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage : %s <server port>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @xwayd_accept(i32 %10)
br label %12
12: ; preds = %7, %4
%13 = phi i32 [ -1, %4 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
int close(int);
int closeBus(int busHandle) { return close(busHandle); }


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

x86 assembly (clang, -O2):
<closeBus>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @closeBus(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ C_bad_argc_2(int, int, long);
void C_bad_argc(int c, int n) {
  C_bad_argc_2(c, n, ((long)(0x00000006 | 0x00000000)));
}


x86 assembly (clang, -O0):
<C_bad_argc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x6,%edx
call   1030 <C_bad_argc_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_bad_argc>:
mov    $0x6,%edx
jmp    1030 <C_bad_argc_2@plt>

LLVM IR (-O0):
define void @C_bad_argc(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 = call i32 @C_bad_argc_2(i32 %5, i32 %6, i64 6)
ret void
}

LLVM IR (-O2):
define void @C_bad_argc(i32 %0, i32 %1) {
%3 = tail call i32 @C_bad_argc_2(i32 %0, i32 %1, i64 6)
ret void
}
int drm_rmdraw(struct inode *inode, struct file *filp, unsigned int cmd,
               unsigned long arg) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @drm_rmdraw(%struct.inode* %0, %struct.file* %1, i32 %2, i64 %3) {
%5 = alloca %struct.inode*
%6 = alloca %struct.file*
%7 = alloca i32
%8 = alloca i64
store %struct.inode* %0, %struct.inode** %5
store %struct.file* %1, %struct.file** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @drm_rmdraw(%struct.inode* nocapture readnone %0, %struct.file* nocapture readnone %1, i32 %2, i64 %3) {
ret i32 0
}
char f_int_4(char x) { return x; }


x86 assembly (clang, -O0):
<f_int_4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @f_int_4(i8 returned signext %0) {
ret i8 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ EDIPARTYNAME;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ EDIPARTYNAME_it;
int i2d_EDIPARTYNAME(EDIPARTYNAME *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &EDIPARTYNAME_it);
}


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

x86 assembly (clang, -O2):
<i2d_EDIPARTYNAME>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@EDIPARTYNAME_it = global i32 0
define i32 @i2d_EDIPARTYNAME(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @EDIPARTYNAME_it)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ cgiBooleanShadowPrefix();
int cgiVarExists(char *);
int /*<<< orphan*/ safef(char *, int, char *, int /*<<< orphan*/, char *);
int cgiBooleanDefined(char *name) {
  char buf[256];
  safef(buf, sizeof(buf), "%s%s", cgiBooleanShadowPrefix(), name);
  return cgiVarExists(buf);
}


x86 assembly (clang, -O0):
<cgiBooleanDefined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    $0x0,%al
call   1040 <cgiBooleanShadowPrefix@plt>
mov    -0x118(%rbp),%rdi
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
mov    $0x100,%esi
lea    0xe93(%rip),%rdx
call   1050 <safef@plt>
lea    -0x110(%rbp),%rdi
call   1030 <cgiVarExists@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiBooleanDefined>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <cgiBooleanShadowPrefix@plt>
lea    0xeb5(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
mov    %eax,%ecx
mov    %rbx,%r8
call   1050 <safef@plt>
mov    %r14,%rdi
call   1030 <cgiVarExists@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i32 @cgiBooleanDefined(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 (...) @cgiBooleanShadowPrefix()
%6 = load i8*, i8** %2
%7 = call i32 @safef(i8* %4, i32 256, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i32 @cgiVarExists(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i32 @cgiBooleanDefined(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (...) @cgiBooleanShadowPrefix()
%5 = call i32 @safef(i8* %3, i32 256, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %0)
%6 = call i32 @cgiVarExists(i8* %3)
ret i32 %6
}
int dwc3_exynos_id_event(struct device *dev, int state) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @dwc3_exynos_id_event(%struct.device* %0, i32 %1) {
%3 = alloca %struct.device*
%4 = alloca i32
store %struct.device* %0, %struct.device** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @dwc3_exynos_id_event(%struct.device* nocapture readnone %0, i32 %1) {
ret i32 0
}
int equal_default(void *a, void *b) { return a == b; }


x86 assembly (clang, -O0):
<equal_default>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_default>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @equal_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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @equal_default(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void little_field_gather(_Complex double *w) { return; }


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

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

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

LLVM IR (-O2):
define void @little_field_gather({ double, double }* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int check = 0x12345678;
  char *ptr = (char *)&check;
  if (*ptr == 0x12)
    printf("The machine is Big-endian\n");
  else
    printf("The machine is Little-endian\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x12345678,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x12,%eax
jne    1156 <main+0x46>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1162 <main+0x52>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%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):
@.str = [27 x i8] c"The machine is Big-endian\0A\00"
@.str.1 = [30 x i8] c"The machine is Little-endian\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 305419896, i32* %6
%8 = bitcast i32* %6 to i8*
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 18
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"The machine is Little-endian\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ finalPrint();
int /*<<< orphan*/ getchar();
int main() {
  finalPrint();
  getchar();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @finalPrint()
%2 = tail call i32 (...) @getchar()
ret i32 0
}
int test_imm_CEint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xCE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CEint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xce,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CEint64_midword_mem>:
testb  $0xce,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CEint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 206
%7 = icmp ne i64 %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_CEint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13500416
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void INT_Excep_RSPI2_SPTI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSPI2_SPTI2() {
ret void
}
/* Variables and functions */
int smp_kill(int, int);
int smp_sig_send2allproc(int sig) { return smp_kill(-1, sig); }


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

x86 assembly (clang, -O2):
<smp_sig_send2allproc>:
mov    %edi,%esi
mov    $0xffffffff,%edi
jmp    1030 <smp_kill@plt>

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

LLVM IR (-O2):
define i32 @smp_sig_send2allproc(i32 %0) {
%2 = tail call i32 @smp_kill(i32 -1, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ asm_runcommand(char const *);
void runcommand(const char *cmd) { asm_runcommand(cmd); }


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

x86 assembly (clang, -O2):
<runcommand>:
jmp    1030 <asm_runcommand@plt>

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

LLVM IR (-O2):
define void @runcommand(i8* %0) {
%2 = tail call i32 @asm_runcommand(i8* %0)
ret void
}
void vat(int i, int a[i]) {}


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

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

LLVM IR (-O0):
define void @vat(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 = zext i32 %5 to i64
ret void
}

LLVM IR (-O2):
define void @vat(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void NumberOperate(char *p) { printf("%c", *p); }


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

x86 assembly (clang, -O2):
<NumberOperate>:
movsbl (%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @NumberOperate(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret void
}
void __DELETE_java_net_InetAddress(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_net_InetAddress(i8* nocapture %0, i8* nocapture %1) {
ret void
}
const char *drbd_buildtag(void) {
  return "GIT-hash: 0de839cee13a4160eed6037c4bddd066645e23c5"
         " build by phil@fat-tyre, 2011-06-29 11:37:11";
}


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

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

LLVM IR (-O0):
@.str = [95 x i8] c"GIT-hash: 0de839cee13a4160eed6037c4bddd066645e23c5 build by phil@fat-tyre, 2011-06-29 11:37:11\00"
define i8* @drbd_buildtag() {
ret i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [95 x i8] c"GIT-hash: 0de839cee13a4160eed6037c4bddd066645e23c5 build by phil@fat-tyre, 2011-06-29 11:37:11\00"
define i8* @drbd_buildtag() {
ret i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void jle_rj(unsigned char saut) {
  put8(0x7E);
  put8(saut);
}


x86 assembly (clang, -O0):
<jle_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7e,%edi
call   1030 <put8@plt>
movzbl -0x1(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jle_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0x7e,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @jle_rj(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @put8(i8 zeroext 126)
%4 = load i8, i8* %2
%5 = call i32 @put8(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @jle_rj(i8 zeroext %0) {
%2 = tail call i32 @put8(i8 zeroext 126)
%3 = tail call i32 @put8(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
char *resttime(int sec) {
  static char buf[10];
  sprintf(buf, "%02d:%02d:%02d", sec / 3600, (sec / 60) % 60, sec % 60);
  return buf;
}


x86 assembly (clang, -O0):
<resttime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x4(%rbp),%eax
mov    $0x3c,%esi
cltd
idiv   %esi
mov    %edx,%r8d
mov    -0x8(%rbp),%edx
lea    0x2ed3(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ec0(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resttime>:
push   %rbx
movslq %edi,%r8
imul   $0xffffffff91a2b3c5,%r8,%rdx
shr    $0x20,%rdx
add    %r8d,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0xb,%edx
add    %eax,%edx
imul   $0xffffffff88888889,%r8,%rax
shr    $0x20,%rax
add    %r8d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%esi
shr    $0x1f,%esi
sar    $0x5,%eax
add    %esi,%eax
imul   $0x3c,%eax,%eax
imul   $0x3c,%ecx,%esi
sub    %eax,%ecx
sub    %esi,%r8d
lea    0x2eb9(%rip),%rbx
lea    0xe89(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@resttime.buf = internal global [10 x i8] zeroinitializer
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define i8* @resttime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 3600
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 60
%7 = srem i32 %6, 60
%8 = load i32, i32* %2
%9 = srem i32 %8, 60
%10 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @resttime.buf, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %9)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @resttime.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@resttime.buf = internal global [10 x i8] zeroinitializer
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define i8* @resttime(i32 %0) {
%2 = sdiv i32 %0, 3600
%3 = sdiv i32 %0, 60
%4 = srem i32 %3, 60
%5 = srem i32 %0, 60
%6 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @resttime.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %5)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @resttime.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ CopyMem(void *, char *, size_t);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(size_t);
void Swap(void *a, void *b, size_t length) {
  char *tmp = (char *)malloc(length * sizeof(*tmp));
  CopyMem(tmp, a, length);
  CopyMem(a, b, length);
  CopyMem(b, tmp, length);
  free(tmp);
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <CopyMem@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <CopyMem@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <CopyMem@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <CopyMem@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <CopyMem@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <CopyMem@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @Swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = mul i64 %8, 1
%10 = call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = load i64, i64* %6
%15 = call i32 @CopyMem(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %4
%17 = load i8*, i8** %5
%18 = load i64, i64* %6
%19 = call i32 @CopyMem(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %5
%21 = load i8*, i8** %7
%22 = load i64, i64* %6
%23 = call i32 @CopyMem(i8* %20, i8* %21, i64 %22)
%24 = load i8*, i8** %7
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
define void @Swap(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @malloc(i64 %2)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @CopyMem(i8* %5, i8* %0, i64 %2)
%7 = tail call i32 @CopyMem(i8* %0, i8* %1, i64 %2)
%8 = tail call i32 @CopyMem(i8* %1, i8* %5, i64 %2)
%9 = tail call i32 @free(i8* %5)
ret void
}