xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned short pxa2xx_ac97_read(int, unsigned short);
int /*<<< orphan*/ pxa2xx_ac97_write(int, unsigned short, unsigned short);
void pxa2xx_ac97_modify_register(int num, unsigned short reg,
                                 unsigned short clear, unsigned short set) {
  unsigned short val;
  val = pxa2xx_ac97_read(num, reg);
  val &= ~clear;
  val |= set;
  pxa2xx_ac97_write(num, reg, val);
}


x86 assembly (clang, -O0):
<pxa2xx_ac97_modify_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %edi,-0x4(%rbp)
mov    %dx,-0x6(%rbp)
mov    %cx,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%edi
movzwl -0x6(%rbp),%esi
call   1040 <pxa2xx_ac97_read@plt>
mov    %ax,-0xc(%rbp)
movzwl -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
movzwl -0xc(%rbp),%eax
and    %ecx,%eax
mov    %ax,-0xc(%rbp)
movzwl -0xa(%rbp),%ecx
movzwl -0xc(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x6(%rbp),%ax
movzwl %ax,%esi
movzwl -0xc(%rbp),%edx
call   1030 <pxa2xx_ac97_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pxa2xx_ac97_modify_register>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%ebx
call   1040 <pxa2xx_ac97_read@plt>
not    %ebp
and    %eax,%ebp
or     %r14d,%ebp
movzwl %bp,%edx
mov    %ebx,%edi
mov    %r15d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <pxa2xx_ac97_write@plt>

LLVM IR (-O0):
define void @pxa2xx_ac97_modify_register(i32 %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i32
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
store i32 %0, i32* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%10 = load i32, i32* %5
%11 = load i16, i16* %6
%12 = call zeroext i16 @pxa2xx_ac97_read(i32 %10, i16 zeroext %11)
store i16 %12, i16* %9
%13 = load i16, i16* %7
%14 = zext i16 %13 to i32
%15 = xor i32 %14, -1
%16 = load i16, i16* %9
%17 = zext i16 %16 to i32
%18 = and i32 %17, %15
%19 = trunc i32 %18 to i16
store i16 %19, i16* %9
%20 = load i16, i16* %8
%21 = zext i16 %20 to i32
%22 = load i16, i16* %9
%23 = zext i16 %22 to i32
%24 = or i32 %23, %21
%25 = trunc i32 %24 to i16
store i16 %25, i16* %9
%26 = load i32, i32* %5
%27 = load i16, i16* %6
%28 = load i16, i16* %9
%29 = call i32 @pxa2xx_ac97_write(i32 %26, i16 zeroext %27, i16 zeroext %28)
ret void
}

LLVM IR (-O2):
define void @pxa2xx_ac97_modify_register(i32 %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = tail call zeroext i16 @pxa2xx_ac97_read(i32 %0, i16 zeroext %1)
%6 = xor i16 %2, -1
%7 = and i16 %5, %6
%8 = or i16 %7, %3
%9 = tail call i32 @pxa2xx_ac97_write(i32 %0, i16 zeroext %1, i16 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "USAGE: %s [-hv] "
          "[-m MODNAME | MODALIAS_PATTERN ...]\n",
          name);
  exit(EX_USAGE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"USAGE: %s [-hv] [-m MODNAME | MODALIAS_PATTERN ...]\0A\00"
@EX_USAGE = 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 ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EX_USAGE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"USAGE: %s [-hv] [-m MODNAME | MODALIAS_PATTERN ...]\0A\00"
@EX_USAGE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EX_USAGE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
__attribute__((gnu_)) __attribute__((always_)) int func2(int x) {
  return x * 17;
}


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

x86 assembly (clang, -O2):
<func2>:
mov    %edi,%eax
shl    $0x4,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @func2(i32 %0) {
%2 = mul nsw i32 %0, 17
ret i32 %2
}
/* Variables and functions */
double P1_y(double, double, double, double);
double P2_x(double sign, double xi, double et, double qq) {
  return P1_y(sign, xi, et, qq);
}


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

x86 assembly (clang, -O2):
<P2_x>:
jmp    1030 <P1_y@plt>

LLVM IR (-O0):
define double @P2_x(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 double @P1_y(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @P2_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @P1_y(double %0, double %1, double %2, double %3)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int read_value(void) {
  int value = 0;
  printf("Choose one:\n");
  printf("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: ");
  scanf("%i", &value);
  return value;
}


x86 assembly (clang, -O0):
<read_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_value>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [34 x i8] c"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: \00"
@.str.2 = [3 x i8] c"%i\00"
@str = [12 x i8] c"Choose one:\00"
define i32 @read_value() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
ret i32 %6
}
__attribute__((always_)) unsigned int inl_local(int port) {
  unsigned int value;
  __asm__ __volatile__("in"
                       "l"
                       " %w1, %"
                       ""
                       "0"
                       : "=a"(value)
                       : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inl_local>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl_local>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i32 @inl_local(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "inl ${1:w}, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @inl_local(i32 %0) {
%2 = tail call i32 asm sideeffect "inl ${1:w}, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
void pthread_rwlock_trywrlock() {}


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

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

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

LLVM IR (-O2):
define void @pthread_rwlock_trywrlock() {
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostent();
int /*<<< orphan*/ printhostent(struct hostent *);
int main(int argc, char **argv) {
  struct hostent *hp;
  while ((hp = gethostent())) {
    printhostent(hp);
  }
  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)
mov    $0x0,%al
call   1030 <gethostent@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1159 <main+0x39>
mov    -0x18(%rbp),%rdi
call   1040 <printhostent@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gethostent@plt>
test   %rax,%rax
je     1146 <main+0x26>
mov    %rax,%rdi
call   1040 <printhostent@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.hostent = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.hostent* (...) @gethostent()
%4 = icmp eq %struct.hostent* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi %struct.hostent* [ %8, %5 ], [ %3, %2 ]
%7 = tail call i32 @printhostent(%struct.hostent* %6)
%8 = tail call %struct.hostent* (...) @gethostent()
%9 = icmp eq %struct.hostent* %8, null
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fatalerror(int, char *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *safeopen(char *path, char *mode) {
  FILE *sofp;
  sofp = fopen(path, mode);
  if (!(sofp))
    fatalerror(1, path);
  return sofp;
}


x86 assembly (clang, -O0):
<safeopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <safeopen+0x3a>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1040 <fatalerror@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeopen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <safeopen+0x21>
mov    $0x1,%edi
mov    %r14,%rsi
call   1040 <fatalerror@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i32* @safeopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatalerror(i32 1, i8* %0)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
int isleap(int year) {
  if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <isleap+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <isleap+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <isleap+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isleap+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
test   $0x3,%dil
jne    1143 <isleap+0x43>
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1,%eax
cmp    $0x28f5c28,%ecx
ja     1145 <isleap+0x45>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
je     1145 <isleap+0x45>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ 0, %10 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __ISB();
unsigned int __get_SCTLR();
int /*<<< orphan*/ __set_SCTLR(unsigned int);
void L1C_EnableCaches(void) {
  __set_SCTLR(__get_SCTLR() | (1U << 12U) | (1U << 2U));
  __ISB();
}


x86 assembly (clang, -O0):
<L1C_EnableCaches>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__get_SCTLR@plt>
mov    %eax,%edi
or     $0x1000,%edi
or     $0x4,%edi
call   1050 <__set_SCTLR@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L1C_EnableCaches>:
push   %rax
xor    %eax,%eax
call   1040 <__get_SCTLR@plt>
or     $0x1004,%eax
mov    %eax,%edi
call   1050 <__set_SCTLR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @L1C_EnableCaches() {
%1 = call i32 (...) @__get_SCTLR()
%2 = or i32 %1, 4096
%3 = or i32 %2, 4
%4 = call i32 @__set_SCTLR(i32 %3)
%5 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @L1C_EnableCaches() {
%1 = tail call i32 (...) @__get_SCTLR()
%2 = or i32 %1, 4100
%3 = tail call i32 @__set_SCTLR(i32 %2)
%4 = tail call i32 (...) @__ISB()
ret void
}
void fatInitDefault(void) {}


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

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

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

LLVM IR (-O2):
define void @fatInitDefault() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _ACC_fatal(char *);
void _ACC_unexpected_error(void) { _ACC_fatal("unexpected error in runtime"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"unexpected error in runtime\00"
define void @_ACC_unexpected_error() {
%1 = call i32 @_ACC_fatal(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"unexpected error in runtime\00"
define void @_ACC_unexpected_error() {
%1 = tail call i32 @_ACC_fatal(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
int do_419() { return 419; }


x86 assembly (clang, -O0):
<do_419>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_419() {
ret i32 419
}

LLVM IR (-O2):
define i32 @do_419() {
ret i32 419
}
int _tcp_check_len_arg(int len) {
  int err = 0;
  if (len < 0) {
    err = -17;
  }
  return err;
}


x86 assembly (clang, -O0):
<_tcp_check_len_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <_tcp_check_len_arg+0x1f>
movl   $0xffffffef,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tcp_check_len_arg>:
mov    %edi,%eax
sar    $0x1f,%eax
and    $0xffffffef,%eax
ret

LLVM IR (-O0):
define i32 @_tcp_check_len_arg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -17, i32* %3
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @_tcp_check_len_arg(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 -17, i32 0
ret i32 %3
}
/* Variables and functions */
scalar_t__ cos(float);
float COS(float var) { return (float)cos(var); }


x86 assembly (clang, -O0):
<COS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cos@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COS>:
push   %rax
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @COS(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @cos(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @COS(float %0) {
%2 = tail call i64 @cos(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ gmx_fio_close(int);
void close_trj(int status) { gmx_fio_close(status); }


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

x86 assembly (clang, -O2):
<close_trj>:
jmp    1030 <gmx_fio_close@plt>

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

LLVM IR (-O2):
define void @close_trj(i32 %0) {
%2 = tail call i32 @gmx_fio_close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isPrime(int);
int hashTableCalculateOptimalSize(int numberOfElements) {
  int M = numberOfElements * 2;
  while (!isPrime(M))
    M++;
  return M;
}


x86 assembly (clang, -O0):
<hashTableCalculateOptimalSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isPrime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1141 <hashTableCalculateOptimalSize+0x31>
jmp    114f <hashTableCalculateOptimalSize+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <hashTableCalculateOptimalSize+0x14>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashTableCalculateOptimalSize>:
push   %rbx
mov    %edi,%ebx
add    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <isPrime@plt>
add    $0x1,%ebx
test   %eax,%eax
je     1120 <hashTableCalculateOptimalSize+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @hashTableCalculateOptimalSize(i32 %0) {
%2 = shl nsw i32 %0, 1
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ %2, %1 ], [ %7, %3 ]
%5 = tail call i32 @isPrime(i32 %4)
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int O_NDELAY;
int O_RDONLY;
int open(char const *, int);
int open_read(const char *fn) { return open(fn, O_RDONLY | O_NDELAY); }


x86 assembly (clang, -O0):
<open_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_read>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_NDELAY = global i32 0
define i32 @open_read(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDONLY
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = call i32 @open(i8* %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_NDELAY = global i32 0
define i32 @open_read(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = load i32, i32* @O_NDELAY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GLCD_InitializePorts();
int /*<<< orphan*/ GLCD_WriteCommand(int, unsigned char);
void GLCD_Initialize(void) {
  unsigned char i;
  GLCD_InitializePorts();
  for (i = 0; i < 3; i++)
    GLCD_WriteCommand((0x3E | 0x01), i);
}


x86 assembly (clang, -O0):
<GLCD_Initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <GLCD_InitializePorts@plt>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x3,%eax
jge    115b <GLCD_Initialize+0x3b>
mov    $0x3f,%edi
movzbl -0x1(%rbp),%esi
call   1040 <GLCD_WriteCommand@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1133 <GLCD_Initialize+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLCD_Initialize>:
push   %rax
xor    %eax,%eax
call   1030 <GLCD_InitializePorts@plt>
mov    $0x3f,%edi
xor    %esi,%esi
call   1040 <GLCD_WriteCommand@plt>
mov    $0x3f,%edi
mov    $0x1,%esi
call   1040 <GLCD_WriteCommand@plt>
mov    $0x3f,%edi
mov    $0x2,%esi
pop    %rax
jmp    1040 <GLCD_WriteCommand@plt>

LLVM IR (-O0):
define void @GLCD_Initialize() {
%1 = alloca i8
%2 = call i32 (...) @GLCD_InitializePorts()
store i8 0, i8* %1
br label %3
3: ; preds = %10, %0
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8, i8* %1
%9 = call i32 @GLCD_WriteCommand(i32 63, i8 zeroext %8)
br label %10
10: ; preds = %7
%11 = load i8, i8* %1
%12 = add i8 %11, 1
store i8 %12, i8* %1
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @GLCD_Initialize() {
%1 = tail call i32 (...) @GLCD_InitializePorts()
%2 = tail call i32 @GLCD_WriteCommand(i32 63, i8 zeroext 0)
%3 = tail call i32 @GLCD_WriteCommand(i32 63, i8 zeroext 1)
%4 = tail call i32 @GLCD_WriteCommand(i32 63, i8 zeroext 2)
ret void
}
float z1(void) { return 5; }


x86 assembly (clang, -O0):
<z1>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<z1>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @z1() {
ret float 5.000000e+00
}

LLVM IR (-O2):
define float @z1() {
ret float 5.000000e+00
}
int test_imm_7Euint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x7E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Euint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 126
%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_7Euint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8257536
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void BIO_s_socket(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_s_socket() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_ContentDirectory_UpdateObject(void *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void UPnPContentDirectory_UpdateObject(void *upnptoken, char *ObjectID,
                                       char *CurrentTagValue,
                                       char *NewTagValue) {
  printf("Invoke: UPnPContentDirectory_UpdateObject(%s,%s,%s);\r\n", ObjectID,
         CurrentTagValue, NewTagValue);
  UPnPResponse_ContentDirectory_UpdateObject(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPContentDirectory_UpdateObject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_ContentDirectory_UpdateObject@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPContentDirectory_UpdateObject>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_ContentDirectory_UpdateObject@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Invoke: UPnPContentDirectory_UpdateObject(%s,%s,%s);\0D\0A\00"
define void @UPnPContentDirectory_UpdateObject(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @UPnPResponse_ContentDirectory_UpdateObject(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"Invoke: UPnPContentDirectory_UpdateObject(%s,%s,%s);\0D\0A\00"
define void @UPnPContentDirectory_UpdateObject(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%6 = tail call i32 @UPnPResponse_ContentDirectory_UpdateObject(i8* %0)
ret void
}
__attribute__((no, noclone)) void f5(int *p) { volatile int i = p[20]; }


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

x86 assembly (clang, -O2):
<f5>:
mov    0x50(%rdi),%eax
mov    %eax,-0x4(%rsp)
ret

LLVM IR (-O0):
define void @f5(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 20
%6 = load i32, i32* %5
store volatile i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
define void @f5(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i32, i32* %0, i64 20
%5 = load i32, i32* %4
store volatile i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ watchdog_refresh();
void yield() { watchdog_refresh(); }


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

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

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

LLVM IR (-O2):
define void @yield() {
%1 = tail call i32 (...) @watchdog_refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find();
int /*<<< orphan*/ find2();
int main() {
  find();
  find2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @find()
%2 = tail call i32 (...) @find2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_usage(const char *program) {
  fprintf(stderr,
          "Usage: %s interface\n"
          "\tshows link speed.\n",
          program);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s interface\0A\09shows link speed.\0A\00"
define void @print_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 ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s interface\0A\09shows link speed.\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct entry_list_link {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_link_next(struct genlist_link const *);
struct entry_list_link *
entry_list_link_next(const struct entry_list_link *plink) {
  return ((struct entry_list_link *)genlist_link_next(
      (const struct genlist_link *)plink));
}


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

x86 assembly (clang, -O2):
<entry_list_link_next>:
jmp    1030 <genlist_link_next@plt>

LLVM IR (-O0):
%struct.entry_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.entry_list_link* @entry_list_link_next(%struct.entry_list_link* %0) {
%2 = alloca %struct.entry_list_link*
store %struct.entry_list_link* %0, %struct.entry_list_link** %2
%3 = load %struct.entry_list_link*, %struct.entry_list_link** %2
%4 = bitcast %struct.entry_list_link* %3 to %struct.genlist_link*
%5 = call i64 @genlist_link_next(%struct.genlist_link* %4)
%6 = inttoptr i64 %5 to %struct.entry_list_link*
ret %struct.entry_list_link* %6
}

LLVM IR (-O2):
%struct.entry_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.entry_list_link* @entry_list_link_next(%struct.entry_list_link* %0) {
%2 = bitcast %struct.entry_list_link* %0 to %struct.genlist_link*
%3 = tail call i64 @genlist_link_next(%struct.genlist_link* %2)
%4 = inttoptr i64 %3 to %struct.entry_list_link*
ret %struct.entry_list_link* %4
}
void bar(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
void measurement_backup_close(FILE *insert_pipe) {
  if (insert_pipe)
    pclose(insert_pipe);
}


x86 assembly (clang, -O0):
<measurement_backup_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <measurement_backup_close+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <pclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measurement_backup_close>:
test   %rdi,%rdi
je     111a <measurement_backup_close+0xa>
jmp    1030 <pclose@plt>
ret

LLVM IR (-O0):
define void @measurement_backup_close(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @pclose(i32* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @measurement_backup_close(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @pclose(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int convert_piece(int san_piece) {
  switch (san_piece) {
  case 5:
    return 10;
  case 4:
    return 8;
  case 3:
    return 6;
  case 1:
    return 2;
  case 2:
    return 4;
  case 0:
    return 0;
  }
  assert(0);
}


x86 assembly (clang, -O0):
<convert_piece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x5,%rax
ja     1188 <convert_piece+0x78>
mov    -0x10(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xa,-0x4(%rbp)
jmp    118f <convert_piece+0x7f>
movl   $0x8,-0x4(%rbp)
jmp    118f <convert_piece+0x7f>
movl   $0x6,-0x4(%rbp)
jmp    118f <convert_piece+0x7f>
movl   $0x2,-0x4(%rbp)
jmp    118f <convert_piece+0x7f>
movl   $0x4,-0x4(%rbp)
jmp    118f <convert_piece+0x7f>
movl   $0x0,-0x4(%rbp)
jmp    118f <convert_piece+0x7f>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_piece>:
cmp    $0x6,%edi
jae    111a <convert_piece+0xa>
mov    %edi,%eax
add    %edi,%eax
ret
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @convert_piece(i32 %0) {
%2 = icmp ult i32 %0, 6
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @assert(i32 0)
br label %7
5: ; preds = %1
%6 = shl i32 %0, 1
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ undef, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
bool whitespace(char c) {
  if (c == '\0')
    return false;
  else
    return strchr(" \t", c) != 0;
}


x86 assembly (clang, -O0):
<whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1137 <whitespace+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1156 <whitespace+0x46>
lea    0xec2(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whitespace>:
test   %dil,%dil
je     1136 <whitespace+0x26>
push   %rax
movsbl %dil,%esi
lea    0xedf(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
define i32 @whitespace(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, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %13
8: ; preds = %1
%9 = load i8, i8* %3
%10 = call i64 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define i32 @whitespace(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
int test3(int a, int b) {
  int sum = 0;
  while (a > 0) {
    sum += b;
    a--;
  }
  return sum;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1132 <test3+0x32>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <test3+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
imul   %edi,%esi
xor    %eax,%eax
test   %edi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @test3(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = mul i32 %1, %0
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
int isLittleEndian() {
  int a = 0x05;
  char *p = (char *)&a;
  if (*p == 0x05) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isLittleEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5,%eax
jne    112f <isLittleEndian+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <isLittleEndian+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isLittleEndian() {
ret i32 1
}
unsigned long long read_tsc_counter(void) {
  unsigned long long tmp;
  asm volatile("rdtsc\n\t" : "=A"(tmp) : : "%ebx", "%ecx", "memory");
  return tmp;
}


x86 assembly (clang, -O0):
<read_tsc_counter>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
rdtsc
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_tsc_counter>:
push   %rbx
rdtsc
pop    %rbx
ret

LLVM IR (-O0):
define i64 @read_tsc_counter() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc\0A\09", "=A,~{ebx},~{ecx},~{memory},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @read_tsc_counter() {
%1 = tail call i64 asm sideeffect "rdtsc\0A\09", "=A,~{ebx},~{ecx},~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
int max_of_four(int x, int z, int y, int w) {
  int max1 = x > z ? x : z;
  int max2 = y > w ? y : w;
  return max1 > max2 ? max1 : max2;
}


x86 assembly (clang, -O0):
<max_of_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1127 <max_of_four+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <max_of_four+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    114a <max_of_four+0x4a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1150 <max_of_four+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    116d <max_of_four+0x6d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1173 <max_of_four+0x73>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_of_four>:
cmp    %esi,%edi
cmovg  %edi,%esi
mov    %ecx,%eax
cmp    %ecx,%edx
cmovg  %edx,%eax
cmp    %eax,%esi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max_of_four(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = load i32, i32* %5
br label %18
16: ; preds = %4
%17 = load i32, i32* %6
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
store i32 %19, i32* %9
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i32, i32* %7
br label %27
25: ; preds = %18
%26 = load i32, i32* %8
br label %27
27: ; preds = %25, %23
%28 = phi i32 [ %24, %23 ], [ %26, %25 ]
store i32 %28, i32* %10
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = load i32, i32* %9
br label %36
34: ; preds = %27
%35 = load i32, i32* %10
br label %36
36: ; preds = %34, %32
%37 = phi i32 [ %33, %32 ], [ %35, %34 ]
ret i32 %37
}

LLVM IR (-O2):
define i32 @max_of_four(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, %1
%6 = select i1 %5, i32 %0, i32 %1
%7 = icmp sgt i32 %2, %3
%8 = select i1 %7, i32 %2, i32 %3
%9 = icmp sgt i32 %6, %8
%10 = select i1 %9, i32 %6, i32 %8
ret i32 %10
}
main() {
  struct {
    int m : 5;
  } a;
  a.m = 99999;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%al
and    $0xe0,%al
or     $0x1f,%al
mov    %al,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i8, [3 x i8] }
define i32 @main() {
%1 = alloca %struct.anon
%2 = bitcast %struct.anon* %1 to i8*
%3 = load i8, i8* %2
%4 = and i8 %3, -32
%5 = or i8 %4, 31
store i8 %5, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
__attribute__((no)) int g(int i, int j) {
  if (j != 0)
    return 0;
  return i;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1120 <g+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1126 <g+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
test   %esi,%esi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 %0, i32 0
ret i32 %4
}
int sub(const int a, const int b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}