xunge/DecIR huggingface dataset:
int decode_descriptor(unsigned char *d, int desclen) {
  switch (d[1]) {
  case 0x04:
    if (d[5] == 1)
      return 1;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<decode_descriptor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
sub    $0x4,%al
jne    1141 <decode_descriptor+0x41>
jmp    111f <decode_descriptor+0x1f>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
cmp    $0x1,%eax
jne    113c <decode_descriptor+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1148 <decode_descriptor+0x48>
jmp    1141 <decode_descriptor+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_descriptor>:
cmpb   $0x4,0x1(%rdi)
jne    1111 <decode_descriptor+0x11>
mov    $0x1,%eax
cmpb   $0x1,0x5(%rdi)
je     1113 <decode_descriptor+0x13>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @decode_descriptor(i8* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 5
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 1
br i1 %9, label %11, label %10
10: ; preds = %6, %2
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ 0, %10 ], [ 1, %6 ]
ret i32 %12
}
void gtk_calendar_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_calendar_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello Git World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Hello Git World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Hello Git World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a, b, c, *p;
  if (c)
    p = &a;
  else
    p = &b;
  *p = 3;
  assert(b == 3 || a == 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1136 <main+0x26>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    113e <main+0x2e>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    $0x1,%al
cmpl   $0x3,-0xc(%rbp)
mov    %al,-0x19(%rbp)
je     1161 <main+0x51>
cmpl   $0x3,-0x8(%rbp)
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int write(int, char const *, int /*<<< orphan*/);
__attribute__((always_)) int print_error(const char *string) {
  return write(2, string, strlen(string));
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @print_error(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret i32 %3
}
void register_handlers() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ cfsetispeed(struct termios *, unsigned int);
int /*<<< orphan*/ cfsetospeed(struct termios *, unsigned int);
void set_baudrate(struct termios *opt, unsigned int baudrate) {
  cfsetispeed(opt, baudrate);
  cfsetospeed(opt, baudrate);
}


x86 assembly (clang, -O0):
<set_baudrate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <cfsetispeed@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <cfsetospeed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_baudrate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <cfsetispeed@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <cfsetospeed@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
define void @set_baudrate(%struct.termios* %0, i32 %1) {
%3 = alloca %struct.termios*
%4 = alloca i32
store %struct.termios* %0, %struct.termios** %3
store i32 %1, i32* %4
%5 = load %struct.termios*, %struct.termios** %3
%6 = load i32, i32* %4
%7 = call i32 @cfsetispeed(%struct.termios* %5, i32 %6)
%8 = load %struct.termios*, %struct.termios** %3
%9 = load i32, i32* %4
%10 = call i32 @cfsetospeed(%struct.termios* %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define void @set_baudrate(%struct.termios* %0, i32 %1) {
%3 = tail call i32 @cfsetispeed(%struct.termios* %0, i32 %1)
%4 = tail call i32 @cfsetospeed(%struct.termios* %0, i32 %1)
ret void
}
/* Variables and functions */
int omap_rev();
int is_omap15xx(void) { return ((omap_rev() & 0xff) == (0x15)) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_omap15xx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
and    $0xff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x15,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap15xx>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
xor    %ecx,%ecx
cmp    $0x15,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap15xx() {
%1 = call i32 (...) @omap_rev()
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 21
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_omap15xx() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 21
%4 = zext i1 %3 to i32
ret i32 %4
}
long double longdouble_ignoring_signedchar(long double x, signed char y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_signedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %al,-0x11(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_signedchar>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @longdouble_ignoring_signedchar(x86_fp80 %0, i8 signext %1) {
%3 = alloca x86_fp80
%4 = alloca i8
store x86_fp80 %0, x86_fp80* %3
store i8 %1, i8* %4
%5 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_signedchar(x86_fp80 returned %0, i8 signext %1) {
ret x86_fp80 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Obtain NIC information\n");
  printf("require: --nic\n");
  printf("optional: --quiet --mtu --phys --media\n");
  printf("usage: nic_info --nic=em0 --mtu\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Obtain NIC information\0A\00"
@.str.1 = [16 x i8] c"require: --nic\0A\00"
@.str.2 = [40 x i8] c"optional: --quiet --mtu --phys --media\0A\00"
@.str.3 = [33 x i8] c"usage: nic_info --nic=em0 --mtu\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"Obtain NIC information\00"
@str.4 = [15 x i8] c"require: --nic\00"
@str.5 = [39 x i8] c"optional: --quiet --mtu --phys --media\00"
@str.6 = [32 x i8] c"usage: nic_info --nic=em0 --mtu\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int is_str_delimiter(c)
char c;
{ return (c == '"'); }


x86 assembly (clang, -O0):
<is_str_delimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x22,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_str_delimiter>:
xor    %eax,%eax
cmp    $0x22,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_str_delimiter(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 34
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_str_delimiter(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 34
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ sleep(int);
void *func1(void *arg) {
  pthread_t tid;
  tid = pthread_self();
  printf("Soy el thread 1 [TID:%ld] y voy a esperar\n", tid);
  sleep(10);
  printf("Soy el thread 1 [TID:%ld] y he terminado\n", tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
mov    -0x14(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%ebx
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Soy el thread 1 [TID:%ld] y voy a esperar\0A\00"
@.str.1 = [42 x i8] c"Soy el thread 1 [TID:%ld] y he terminado\0A\00"
define i8* @func1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 (...) @pthread_self()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @sleep(i32 10)
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @pthread_exit(i32* null)
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [43 x i8] c"Soy el thread 1 [TID:%ld] y voy a esperar\0A\00"
@.str.1 = [42 x i8] c"Soy el thread 1 [TID:%ld] y he terminado\0A\00"
define noalias i8* @func1(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 10)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%6 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ scrClear();
int /*<<< orphan*/ shLoop();
int /*<<< orphan*/ tmrSetInterval(int);
int /*<<< orphan*/ uioPrint(char *);
void Init32c(void) {
  scrClear();
  tmrSetInterval(1193);
  uioPrint("Ukko loaded.\n");
  while (-1)
    shLoop();
}


x86 assembly (clang, -O0):
<Init32c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <scrClear@plt>
mov    $0x4a9,%edi
call   1050 <tmrSetInterval@plt>
lea    0xea4(%rip),%rdi
call   1040 <uioPrint@plt>
mov    $0x0,%al
call   1030 <shLoop@plt>
jmp    1161 <Init32c+0x21>

x86 assembly (clang, -O2):
<Init32c>:
push   %rax
xor    %eax,%eax
call   1060 <scrClear@plt>
mov    $0x4a9,%edi
call   1050 <tmrSetInterval@plt>
lea    0xea7(%rip),%rdi
call   1040 <uioPrint@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <shLoop@plt>
jmp    1160 <Init32c+0x20>

LLVM IR (-O0):
@.str = [14 x i8] c"Ukko loaded.\0A\00"
define void @Init32c() {
%1 = call i32 (...) @scrClear()
%2 = call i32 @tmrSetInterval(i32 1193)
%3 = call i32 @uioPrint(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @shLoop()
br label %4
}

LLVM IR (-O2):
@.str = [14 x i8] c"Ukko loaded.\0A\00"
define void @Init32c() {
%1 = tail call i32 (...) @scrClear()
%2 = tail call i32 @tmrSetInterval(i32 1193)
%3 = tail call i32 @uioPrint(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @shLoop()
br label %4
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int getopt_internal(int, char **, char const *, struct option const *, int *,
                    int);
int getopt_long_only(int argc, char **argv, const char *shortopts,
                     const struct option *longopts, int *longind) {
  return getopt_internal(argc, argv, shortopts, longopts, longind, 1);
}


x86 assembly (clang, -O0):
<getopt_long_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long_only>:
mov    $0x1,%r9d
jmp    1030 <getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ FE_DOWNWARD;
int /*<<< orphan*/ FE_TONEAREST;
int /*<<< orphan*/ FE_TOWARDZERO;
int /*<<< orphan*/ FE_UPWARD;
int /*<<< orphan*/ fesetround(int /*<<< orphan*/);
void set_rounding(const uint32_t *fcr31) {
  switch (*fcr31 & 3) {
  case 0:
    fesetround(FE_TONEAREST);
    break;
  case 1:
    fesetround(FE_TOWARDZERO);
    break;
  case 2:
    fesetround(FE_UPWARD);
    break;
  case 3:
    fesetround(FE_DOWNWARD);
    break;
  }
}


x86 assembly (clang, -O0):
<set_rounding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x3,%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%eax
ja     118d <set_rounding+0x7d>
mov    -0x10(%rbp),%rax
lea    0xec3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <fesetround@plt>
jmp    118d <set_rounding+0x7d>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <fesetround@plt>
jmp    118d <set_rounding+0x7d>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1030 <fesetround@plt>
jmp    118d <set_rounding+0x7d>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1030 <fesetround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_rounding>:
mov    (%rdi),%eax
and    $0x3,%eax
lea    0x2ce4(%rip),%rcx
mov    (%rcx,%rax,8),%rax
mov    (%rax),%edi
jmp    1030 <fesetround@plt>

LLVM IR (-O0):
@FE_TONEAREST = global i32 0
@FE_TOWARDZERO = global i32 0
@FE_UPWARD = global i32 0
@FE_DOWNWARD = global i32 0
define void @set_rounding(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 3
switch i32 %5, label %18 [
i32 0, label %6
i32 1, label %9
i32 2, label %12
i32 3, label %15
]
6: ; preds = %1
%7 = load i32, i32* @FE_TONEAREST
%8 = call i32 @fesetround(i32 %7)
br label %18
9: ; preds = %1
%10 = load i32, i32* @FE_TOWARDZERO
%11 = call i32 @fesetround(i32 %10)
br label %18
12: ; preds = %1
%13 = load i32, i32* @FE_UPWARD
%14 = call i32 @fesetround(i32 %13)
br label %18
15: ; preds = %1
%16 = load i32, i32* @FE_DOWNWARD
%17 = call i32 @fesetround(i32 %16)
br label %18
18: ; preds = %1, %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
@FE_TONEAREST = global i32 0
@FE_TOWARDZERO = global i32 0
@FE_UPWARD = global i32 0
@FE_DOWNWARD = global i32 0
@switch.table.set_rounding = [4 x i32*] [i32* @FE_TONEAREST, i32* @FE_TOWARDZERO, i32* @FE_UPWARD, i32* @FE_DOWNWARD]
define void @set_rounding(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [4 x i32*], [4 x i32*]* @switch.table.set_rounding, i64 0, i64 %4
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = tail call i32 @fesetround(i32 %7)
ret void
}
int *cp(char *s, char *t) {
  int a = 5;
  int *p = &a;
  return p;
}


x86 assembly (clang, -O0):
<cp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @cp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = alloca i32
ret i32* %3
}
/* Variables and functions */
double fun(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("%f\n", fun(10));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <fun@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <fun@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @fun(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call double @fun(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fwrite(void *, size_t, int, int /*<<< orphan*/ *);
void _memdumpf(void *mem, size_t len, const char *dumpfile) {
  FILE *f = fopen(dumpfile, "w");
  fwrite(mem, len, 1, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<_memdumpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_memdumpf>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xebe(%rip),%rsi
mov    %rdx,%rdi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @_memdumpf(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %4
%11 = load i64, i64* %5
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i64 %11, i32 1, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @_memdumpf(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %0, i64 %1, i32 1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
int litteral(char *, int /*<<< orphan*/);
int lookahead_litteral(char *s) { return litteral(s, 0); }


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

x86 assembly (clang, -O2):
<lookahead_litteral>:
xor    %esi,%esi
jmp    1030 <litteral@plt>

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

LLVM IR (-O2):
define i32 @lookahead_litteral(i8* %0) {
%2 = tail call i32 @litteral(i8* %0, i32 0)
ret i32 %2
}
unsigned char rx_bit(void) {
  return (*((volatile unsigned short *)0xffe80020) & 0x0001);
}


x86 assembly (clang, -O0):
<rx_bit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffe80020,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rx_bit>:
mov    $0xffe80020,%eax
movzwl (%rax),%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @rx_bit() {
%1 = load volatile i16, i16* inttoptr (i64 4293394464 to i16*)
%2 = zext i16 %1 to i32
%3 = and i32 %2, 1
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @rx_bit() {
%1 = load volatile i16, i16* inttoptr (i64 4293394464 to i16*)
%2 = trunc i16 %1 to i8
%3 = and i8 %2, 1
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ rand();
void garble(uint8_t mem[], int len) {
  for (int i = 0; i < len; i++)
    mem[i] = rand();
}


x86 assembly (clang, -O0):
<garble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <garble+0x44>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <garble+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<garble>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <garble+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <garble+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @garble(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 = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @garble(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %11, %7 ]
%9 = tail call i32 (...) @rand()
%10 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %9, i32* %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ http_parse_block(char *, char const *, int);
char *util_toupper(int /*<<< orphan*/);
char *http_protocol(char *buffer, const char *request) {
  return util_toupper(http_parse_block(buffer, request, 3));
}


x86 assembly (clang, -O0):
<http_protocol>:
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    $0x3,%edx
call   1040 <http_parse_block@plt>
mov    %eax,%edi
call   1030 <util_toupper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_protocol>:
push   %rax
mov    $0x3,%edx
call   1040 <http_parse_block@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <util_toupper@plt>

LLVM IR (-O0):
define i8* @http_protocol(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 @http_parse_block(i8* %5, i8* %6, i32 3)
%8 = call i8* @util_toupper(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @http_protocol(i8* %0, i8* %1) {
%3 = tail call i32 @http_parse_block(i8* %0, i8* %1, i32 3)
%4 = tail call i8* @util_toupper(i32 %3)
ret i8* %4
}
float absVal(float x) {
  if (x < 0) {
    x = -x;
  }
  return x;
}


x86 assembly (clang, -O0):
<absVal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <absVal+0x2d>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absVal>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @absVal(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
store float %7, float* %2
br label %8
8: ; preds = %5, %1
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @absVal(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
double tanh(double);
int main() {
  double x, ret;
  x = 0.5;
  ret = tanh(x);
  printf("The hyperbolic tangent of %lf is %lf degrees\n", x, ret);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1030 <tanh@plt>
lea    0xedb(%rip),%rdi
movsd  0xecb(%rip),%xmm1
movsd  0xebb(%rip),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"The hyperbolic tangent of %lf is %lf degrees\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 5.000000e-01, double* %2
%4 = load double, double* %2
%5 = call double @tanh(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), double %6, double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"The hyperbolic tangent of %lf is %lf degrees\0A\00"
define i32 @main() {
%1 = tail call double @tanh(double 5.000000e-01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), double 5.000000e-01, double 0x3FDD9353D7568AF3)
ret i32 0
}
/* Variables and functions */
int getop(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int type;
  char s[100];
  type = getop(s);
  printf("\n%c", type);
  printf("\n%s", s);
  printf("\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
call   1040 <getop@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <getop@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%c\00"
@.str.1 = [4 x i8] c"\0A%s\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @getop(i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int calendar_dpy(int calendar) {
  int dpy = 0;
  if (calendar == 2)
    dpy = 360;
  else if (calendar == 3)
    dpy = 365;
  else if (calendar == 4)
    dpy = 366;
  return (dpy);
}


x86 assembly (clang, -O0):
<calendar_dpy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1124 <calendar_dpy+0x24>
movl   $0x168,-0x8(%rbp)
jmp    1155 <calendar_dpy+0x55>
cmpl   $0x3,-0x4(%rbp)
jne    113a <calendar_dpy+0x3a>
movl   $0x16d,-0x8(%rbp)
jmp    1150 <calendar_dpy+0x50>
cmpl   $0x4,-0x4(%rbp)
jne    114b <calendar_dpy+0x4b>
movl   $0x16e,-0x8(%rbp)
jmp    1150 <calendar_dpy+0x50>
jmp    1155 <calendar_dpy+0x55>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calendar_dpy>:
add    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x2,%edi
ja     1117 <calendar_dpy+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @calendar_dpy(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 eq i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 360, i32* %3
br label %17
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 3
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 365, i32* %3
br label %16
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 4
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 366, i32* %3
br label %15
15: ; preds = %14, %11
br label %16
16: ; preds = %15, %10
br label %17
17: ; preds = %16, %6
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@switch.table.calendar_dpy = [3 x i32] [i32 360, i32 365, i32 366]
define i32 @calendar_dpy(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.calendar_dpy, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int access(char const *, int);
int access_utf8(const char *path, int mode) { return (access(path, mode)); }


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

x86 assembly (clang, -O2):
<access_utf8>:
jmp    1030 <access@plt>

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

LLVM IR (-O2):
define i32 @access_utf8(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @access(i8* %0, i32 %1)
ret i32 %3
}
int is_alpha(unsigned char c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_alpha+0x29>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <is_alpha+0x4e>
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <is_alpha+0x48>
movzbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_alpha(i8 zeroext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
int check_all_flags(void) {
  int ret = 0;
  int cpu0 = 0, cpu1 = 0;
  return ret;
}


x86 assembly (clang, -O0):
<check_all_flags>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @check_all_flags() {
ret i32 0
}
int max_i(int a, int b) { return (b < a) ? a : b; }


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

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

LLVM IR (-O0):
define i32 @max_i(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 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max_i(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int read(int, char *, int);
int _read_random_dev(int fd, char *buff, int len) {
  return read(fd, buff, len);
}


x86 assembly (clang, -O0):
<_read_random_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read_random_dev>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @_read_random_dev(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct cnfnode {
  int dummy;
};
struct cnfmodule {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int unparse_dhcp_top(struct cnfnode *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/);
int unparse_dhcp(struct cnfmodule *cm, FILE *fptr, struct cnfnode *cn_root) {
  return unparse_dhcp_top(cn_root, fptr, 0);
  return 0;
}


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

x86 assembly (clang, -O2):
<unparse_dhcp>:
mov    %rdx,%rdi
xor    %edx,%edx
jmp    1030 <unparse_dhcp_top@plt>

LLVM IR (-O0):
%struct.cnfmodule = type { i32 }
%struct.cnfnode = type { i32 }
define i32 @unparse_dhcp(%struct.cnfmodule* %0, i32* %1, %struct.cnfnode* %2) {
%4 = alloca %struct.cnfmodule*
%5 = alloca i32*
%6 = alloca %struct.cnfnode*
store %struct.cnfmodule* %0, %struct.cnfmodule** %4
store i32* %1, i32** %5
store %struct.cnfnode* %2, %struct.cnfnode** %6
%7 = load %struct.cnfnode*, %struct.cnfnode** %6
%8 = load i32*, i32** %5
%9 = call i32 @unparse_dhcp_top(%struct.cnfnode* %7, i32* %8, i32 0)
ret i32 %9
}

LLVM IR (-O2):
%struct.cnfmodule = type { i32 }
%struct.cnfnode = type { i32 }
define i32 @unparse_dhcp(%struct.cnfmodule* nocapture readnone %0, i32* %1, %struct.cnfnode* %2) {
%4 = tail call i32 @unparse_dhcp_top(%struct.cnfnode* %2, i32* %1, i32 0)
ret i32 %4
}
/* Variables and functions */
double compose_g(double, double, double, double, int /*<<< orphan*/);
int /*<<< orphan*/ compose_gJ(double, double, double);
__attribute__((visibility("default"))) double
compose_gF(double F, double I, double J, double L, double S, double g_I) {
  return compose_g(F, I, J, g_I, compose_gJ(J, L, S));
}


x86 assembly (clang, -O0):
<compose_gF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <compose_gJ@plt>
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
mov    %eax,%edi
call   1040 <compose_g@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compose_gF>:
sub    $0x28,%rsp
movsd  %xmm5,0x20(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
movaps %xmm2,%xmm0
movaps %xmm3,%xmm1
movaps %xmm4,%xmm2
call   1030 <compose_gJ@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
mov    %eax,%edi
add    $0x28,%rsp
jmp    1040 <compose_g@plt>

LLVM IR (-O0):
define double @compose_gF(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %12
%17 = load double, double* %9
%18 = load double, double* %10
%19 = load double, double* %11
%20 = call i32 @compose_gJ(double %17, double %18, double %19)
%21 = call double @compose_g(double %13, double %14, double %15, double %16, i32 %20)
ret double %21
}

LLVM IR (-O2):
define double @compose_gF(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @compose_gJ(double %2, double %3, double %4)
%8 = tail call double @compose_g(double %0, double %1, double %2, double %5, i32 %7)
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test84(__m64 a, __m64 b) { return _mm_cmpeq_pi8(a, b); }


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

x86 assembly (clang, -O2):
<test84>:
jmp    1030 <_mm_cmpeq_pi8@plt>

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

LLVM IR (-O2):
define i32 @test84(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_pi8(i32 %0, i32 %1)
ret i32 %3
}