xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *copystr(const char *str) {
  char *cpy = malloc(strlen(str) + 1);
  if (cpy == NULL)
    return NULL;
  return strcpy(cpy, str);
}


x86 assembly (clang, -O0):
<copystr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <copystr+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    117e <copystr+0x4e>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copystr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <copystr+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @copystr(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
int isleap(y)
int y;
{ return (y & 3) == 0 && (y % 100 != 0 || y % 400 == 0); }


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    114e <isleap+0x4e>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    1148 <isleap+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <isleap+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <isleap+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isleap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
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 %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
long sumOfSquares(long, long);
long func1(long a, long b, long c) {
  long x = c * (a + b);
  long y = c * (a - b);
  return sumOfSquares(x, y);
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    -0x10(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    -0x10(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <sumOfSquares@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
mov    %rdi,%rax
add    %rsi,%rdi
imul   %rdx,%rdi
sub    %rsi,%rax
imul   %rdx,%rax
mov    %rax,%rsi
jmp    1030 <sumOfSquares@plt>

LLVM IR (-O0):
define i64 @func1(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = add nsw i64 %10, %11
%13 = mul nsw i64 %9, %12
store i64 %13, i64* %7
%14 = load i64, i64* %6
%15 = load i64, i64* %4
%16 = load i64, i64* %5
%17 = sub nsw i64 %15, %16
%18 = mul nsw i64 %14, %17
store i64 %18, i64* %8
%19 = load i64, i64* %7
%20 = load i64, i64* %8
%21 = call i64 @sumOfSquares(i64 %19, i64 %20)
ret i64 %21
}

LLVM IR (-O2):
define i64 @func1(i64 %0, i64 %1, i64 %2) {
%4 = add nsw i64 %1, %0
%5 = mul nsw i64 %4, %2
%6 = sub nsw i64 %0, %1
%7 = mul nsw i64 %6, %2
%8 = tail call i64 @sumOfSquares(i64 %5, i64 %7)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ td_add(double const *, double *, double *);
int /*<<< orphan*/ td_copy(double const *, double *);
int /*<<< orphan*/ td_minus(double *);
void td_sub(const double *a, const double *b, double *c) {
  double minb[3];
  td_copy(b, minb);
  td_minus(minb);
  td_add(a, minb, c);
}


x86 assembly (clang, -O0):
<td_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <td_copy@plt>
lea    -0x30(%rbp),%rdi
call   1050 <td_minus@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <td_add@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_sub>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1040 <td_copy@plt>
mov    %rbx,%rdi
call   1050 <td_minus@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <td_add@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @td_sub(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %5
%9 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%10 = call i32 @td_copy(double* %8, double* %9)
%11 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%12 = call i32 @td_minus(double* %11)
%13 = load double*, double** %4
%14 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%15 = load double*, double** %6
%16 = call i32 @td_add(double* %13, double* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @td_sub(double* %0, double* %1, double* %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = call i32 @td_copy(double* %1, double* %6)
%8 = call i32 @td_minus(double* %6)
%9 = call i32 @td_add(double* %0, double* %6, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bitree_destroy(void *);
int /*<<< orphan*/ free(void *);
void destroy_tree(void *tree) {
  bitree_destroy(tree);
  free(tree);
  return;
}


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

x86 assembly (clang, -O2):
<destroy_tree>:
push   %rbx
mov    %rdi,%rbx
call   1040 <bitree_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_tree(i8* %0) {
%2 = tail call i32 @bitree_destroy(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_region(unsigned short, int);
int /*<<< orphan*/ cli();
int isa_reset(unsigned short);
int /*<<< orphan*/ restore_flags(unsigned long);
int /*<<< orphan*/ save_flags(unsigned long);
int isa_detect(unsigned short portbase) {
  int ret = 0;
  unsigned long flags;
  save_flags(flags);
  cli();
  if (!check_region(portbase, 8))
    ret = isa_reset(portbase);
  restore_flags(flags);
  return ret;
}


x86 assembly (clang, -O0):
<isa_detect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <save_flags@plt>
mov    $0x0,%al
call   1070 <cli@plt>
mov    $0x8,%esi
movzwl -0x2(%rbp),%edi
call   1060 <check_region@plt>
cmp    $0x0,%eax
jne    1199 <isa_detect+0x49>
movzwl -0x2(%rbp),%edi
call   1050 <isa_reset@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <restore_flags@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isa_detect>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <save_flags@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1070 <cli@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1060 <check_region@plt>
test   %eax,%eax
jne    117d <isa_detect+0x2d>
movzwl %bx,%edi
call   1050 <isa_reset@plt>
mov    %eax,%ebp
call   1030 <restore_flags@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isa_detect(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
store i16 %0, i16* %2
store i32 0, i32* %3
%5 = load i64, i64* %4
%6 = call i32 @save_flags(i64 %5)
%7 = call i32 (...) @cli()
%8 = load i16, i16* %2
%9 = call i32 @check_region(i16 zeroext %8, i32 8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i16, i16* %2
%13 = call i32 @isa_reset(i16 zeroext %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %1
%15 = load i64, i64* %4
%16 = call i32 @restore_flags(i64 %15)
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @isa_detect(i16 zeroext %0) {
%2 = tail call i32 @save_flags(i64 undef)
%3 = tail call i32 (...) @cli()
%4 = tail call i32 @check_region(i16 zeroext %0, i32 8)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @isa_reset(i16 zeroext %0)
br label %8
8: ; preds = %6, %1
%9 = phi i32 [ 0, %1 ], [ %7, %6 ]
%10 = tail call i32 @restore_flags(i64 undef)
ret i32 %9
}
int int_min() {
  int d, d_p, min, step;
  short int i, j;
  d = 0;
  d_p = 0;
  i = 0;
  j = 0;
  d = -1;
  while (d < 0) {
    d_p = d;
    d = d * 10;
  }
  d = d_p;
  d_p = 0;
  step = d;
  while (step < (-1)) {
    step = step / 10;
    while (d < 0) {
      d_p = d;
      d = d + step;
    }
    d = d_p;
  }
  return d;
}


x86 assembly (clang, -O0):
<int_min>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movw   $0x0,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movl   $0xffffffff,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1141 <int_min+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0xa,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <int_min+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jge    1195 <int_min+0x95>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    118a <int_min+0x8a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <int_min+0x6c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <int_min+0x54>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @int_min() {
ret i32 727379968
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_send_mqtt_short_command(struct mg_connection *, int,
                                              int /*<<< orphan*/);
void mg_mqtt_unsuback(struct mg_connection *nc, uint16_t message_id) {
  mg_send_mqtt_short_command(nc, 11, message_id);
}


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

x86 assembly (clang, -O2):
<mg_mqtt_unsuback>:
mov    %esi,%edx
mov    $0xb,%esi
jmp    1030 <mg_send_mqtt_short_command@plt>

LLVM IR (-O0):
%struct.mg_connection = type { i32 }
define void @mg_mqtt_unsuback(%struct.mg_connection* %0, i32 %1) {
%3 = alloca %struct.mg_connection*
%4 = alloca i32
store %struct.mg_connection* %0, %struct.mg_connection** %3
store i32 %1, i32* %4
%5 = load %struct.mg_connection*, %struct.mg_connection** %3
%6 = load i32, i32* %4
%7 = call i32 @mg_send_mqtt_short_command(%struct.mg_connection* %5, i32 11, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
define void @mg_mqtt_unsuback(%struct.mg_connection* %0, i32 %1) {
%3 = tail call i32 @mg_send_mqtt_short_command(%struct.mg_connection* %0, i32 11, i32 %1)
ret void
}
void getNbContactSolids(int *nbSolids) { *nbSolids = 1; }


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

x86 assembly (clang, -O2):
<getNbContactSolids>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @getNbContactSolids(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
void array_4(void) {
  short int *primes[] = {1, 3, 5, 7, 9, 11, 13};
  int size = sizeof(primes) / 4;
  showarray_4(primes, size);
}


x86 assembly (clang, -O0):
<array_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x38,%edx
call   1030 <memcpy@plt>
movl   $0xe,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    $0x0,%al
call   1040 <showarray_4@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_4>:
sub    $0x38,%rsp
mov    0xf15(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1030 <showarray_4@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.array_4.primes = [7 x i16*] [i16* inttoptr (i64 1 to i16*), i16* inttoptr (i64 3 to i16*), i16* inttoptr (i64 5 to i16*), i16* inttoptr (i64 7 to i16*), i16* inttoptr (i64 9 to i16*), i16* inttoptr (i64 11 to i16*), i16* inttoptr (i64 13 to i16*)]
define void @array_4() {
%1 = alloca [7 x i16*]
%2 = alloca i32
%3 = bitcast [7 x i16*]* %1 to i8*
store i32 14, i32* %2
%4 = getelementptr inbounds [7 x i16*], [7 x i16*]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 (i16**, i32, ...) bitcast (i32 (...)* @showarray_4 to i32 (i16**, i32, ...)*)(i16** %4, i32 %5)
ret void
}

LLVM IR (-O2):
@__const.array_4.primes = [7 x i16*] [i16* inttoptr (i64 1 to i16*), i16* inttoptr (i64 3 to i16*), i16* inttoptr (i64 5 to i16*), i16* inttoptr (i64 7 to i16*), i16* inttoptr (i64 9 to i16*), i16* inttoptr (i64 11 to i16*), i16* inttoptr (i64 13 to i16*)]
define void @array_4() {
%1 = alloca [7 x i16*]
%2 = bitcast [7 x i16*]* %1 to i8*
%3 = getelementptr inbounds [7 x i16*], [7 x i16*]* %1, i64 0, i64 0
%4 = call i32 (i16**, i32, ...) bitcast (i32 (...)* @showarray_4 to i32 (i16**, i32, ...)*)(i16** %3, i32 14)
ret void
}
int test_partial_array(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @test_partial_array() {
ret i32 0
}

LLVM IR (-O2):
define i32 @test_partial_array() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void push() { emitln("push\t%%eax"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"push\09%%eax\00"
define void @push() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"push\09%%eax\00"
define void @push() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void yycomment(char *s) {}


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

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

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

LLVM IR (-O2):
define void @yycomment(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
int /*<<< orphan*/ WaypointHandle();
void WaypointUpdated() { UAVObjUpdated(WaypointHandle()); }


x86 assembly (clang, -O0):
<WaypointUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <WaypointHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaypointUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <WaypointHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @WaypointUpdated() {
%1 = call i32 (...) @WaypointHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @WaypointUpdated() {
%1 = tail call i32 (...) @WaypointHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ can_fit_more(int);
int /*<<< orphan*/ gc();
int /*<<< orphan*/ grow_universe();
void check_gc(int malloc_size) {
  if (!can_fit_more(malloc_size)) {
    gc();
    while (!can_fit_more(malloc_size))
      grow_universe();
  }
}


x86 assembly (clang, -O0):
<check_gc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <can_fit_more@plt>
cmp    $0x0,%eax
jne    1181 <check_gc+0x51>
mov    $0x0,%al
call   1040 <gc@plt>
mov    -0x4(%rbp),%edi
call   1030 <can_fit_more@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1170 <check_gc+0x40>
jmp    117c <check_gc+0x4c>
mov    $0x0,%al
call   1050 <grow_universe@plt>
jmp    1153 <check_gc+0x23>
jmp    1181 <check_gc+0x51>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_gc>:
push   %rbx
mov    %edi,%ebx
call   1030 <can_fit_more@plt>
test   %eax,%eax
je     113e <check_gc+0xe>
pop    %rbx
ret
xor    %eax,%eax
call   1040 <gc@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <can_fit_more@plt>
test   %eax,%eax
jne    113c <check_gc+0xc>
xor    %eax,%eax
call   1050 <grow_universe@plt>
jmp    1150 <check_gc+0x20>

LLVM IR (-O0):
define void @check_gc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @can_fit_more(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = call i32 (...) @gc()
br label %8
8: ; preds = %13, %6
%9 = load i32, i32* %2
%10 = call i32 @can_fit_more(i32 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 (...) @grow_universe()
br label %8
15: ; preds = %8
br label %16
16: ; preds = %15, %1
ret void
}

LLVM IR (-O2):
define void @check_gc(i32 %0) {
%2 = tail call i32 @can_fit_more(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = tail call i32 (...) @gc()
%6 = tail call i32 @can_fit_more(i32 %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4, %8
%9 = tail call i32 (...) @grow_universe()
%10 = tail call i32 @can_fit_more(i32 %0)
%11 = icmp eq i32 %10, 0
br i1 %11, label %8, label %12
12: ; preds = %8, %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ w;

/* Variables and functions */
int ffs(long);
int lffs(long w) {
  int r;
  if (sizeof(w) == sizeof(int))
    r = ffs(w);
  else {
    r = ffs(w);
  }
  return r;
}


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

x86 assembly (clang, -O2):
<lffs>:
bsf    %rdi,%rcx
add    $0x1,%ecx
xor    %eax,%eax
test   %rdi,%rdi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @lffs(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @ffs(i64 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @lffs(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i32
%4 = add nuw nsw i32 %3, 1
%5 = icmp eq i64 %0, 0
%6 = select i1 %5, i32 0, i32 %4
ret i32 %6
}
int neiln0(long a) { return -(a != 0); }


x86 assembly (clang, -O0):
<neiln0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neiln0>:
neg    %rdi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @neiln0(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @neiln0(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ strlen(char *);
char *rightString(char *s, int width) {
  int start = (int)strlen(s) - width;
  return &s[start >= 0 ? start : 0];
}


x86 assembly (clang, -O0):
<rightString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     114b <rightString+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <rightString+0x45>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <rightString+0x45>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightString>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %ecx,%ecx
sub    %ebp,%eax
cmovs  %ecx,%eax
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @rightString(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = sub nsw i32 %4, %1
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, i32 %5, i32 0
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
ret i8* %9
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 2;
  int y = 3;
  printf("x : %d\ny : %d\n\n", x, y);
  do {
    int t = x;
    x = y;
    y = t;
  } while (0);
  ;
  printf("x : %d\ny : %d\n\n", x, y);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"x : %d\0Ay : %d\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3, i32 2)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void radish_request_dialog(void *state, void *dialog) {}


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

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

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

LLVM IR (-O2):
define void @radish_request_dialog(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _sha512_be64dec(unsigned char const *);
void be64dec_vect(uint64_t *dst, const unsigned char *src, size_t len) {
  size_t i;
  for (i = 0; i < len / 8; i++) {
    dst[i] = _sha512_be64dec(src + i * 8);
  }
}


x86 assembly (clang, -O0):
<be64dec_vect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x3,%rcx
cmp    %rcx,%rax
jae    1173 <be64dec_vect+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <_sha512_be64dec@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <be64dec_vect+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be64dec_vect>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x8,%rdx
jb     1149 <be64dec_vect+0x39>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
shr    $0x3,%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    %r12,%rdi
call   1030 <_sha512_be64dec@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
add    $0x8,%r12
cmp    %rbx,%r14
jne    1130 <be64dec_vect+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @be64dec_vect(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %22, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = udiv i64 %10, 8
%12 = icmp ult i64 %9, %11
br i1 %12, label %13, label %25
13: ; preds = %8
%14 = load i8*, i8** %5
%15 = load i64, i64* %7
%16 = mul i64 %15, 8
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = call i32 @_sha512_be64dec(i8* %17)
%19 = load i32*, i32** %4
%20 = load i64, i64* %7
%21 = getelementptr inbounds i32, i32* %19, i64 %20
store i32 %18, i32* %21
br label %22
22: ; preds = %13
%23 = load i64, i64* %7
%24 = add i64 %23, 1
store i64 %24, i64* %7
br label %8
25: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @be64dec_vect(i32* nocapture writeonly %0, i8* %1, i64 %2) {
%4 = icmp ult i64 %2, 8
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = lshr i64 %2, 3
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %13, %7 ], [ 0, %5 ]
%9 = shl i64 %8, 3
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = tail call i32 @_sha512_be64dec(i8* %10)
%12 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
float Sleef_lgammaf_u10(float x) { return __builtin_lgammaf(x); }


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

x86 assembly (clang, -O2):
<Sleef_lgammaf_u10>:
jmp    1030 <lgammaf@plt>

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

LLVM IR (-O2):
define float @Sleef_lgammaf_u10(float %0) {
%2 = tail call float @lgammaf(float %0)
ret float %2
}
int priorrune(char *rp, char *s) {
  *rp = s[0];
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @priorrune(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
ret i32 1
}
/* Variables and functions */
int length_length(int);
int header_length(int type, int data_len) {
  return 1 + length_length(data_len);
}


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

x86 assembly (clang, -O2):
<header_length>:
push   %rax
mov    %esi,%edi
call   1030 <length_length@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @header_length(i32 %0, i32 %1) {
%3 = tail call i32 @length_length(i32 %1)
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gettid();
int /*<<< orphan*/ kill(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *, int);
void __assert(char *assertion, char *file, int line) {
  printf("assertion failed: %s (%s, line %d)\n", assertion, file, line);
  kill(gettid());
}


x86 assembly (clang, -O0):
<__assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %eax,%edi
call   1050 <kill@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__assert>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <gettid@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <kill@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"assertion failed: %s (%s, line %d)\0A\00"
define void @__assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
%11 = call i32 (...) @gettid()
%12 = call i32 @kill(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"assertion failed: %s (%s, line %d)\0A\00"
define void @__assert(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%5 = tail call i32 (...) @gettid()
%6 = tail call i32 @kill(i32 %5)
ret void
}
/* Variables and functions */
void putc(char c) {
  while (((*((volatile unsigned long *)0x7F005018)) & (1 << 14)))
    ;
  (*((volatile unsigned char *)0x7F005020)) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     1127 <putc+0x27>
jmp    110a <putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x7f005020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testq  $0x4000,0x7f005018
jne    1100 <putc>
mov    %dil,0x7f005020
7f
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 2130726944 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 16384
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 2130726944 to i8*)
ret void
}
OP(ed, d9) {}


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

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

LLVM IR (-O0):
define i32 @OP(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
int is_control_char(int ch) {
  if (ch >= ' ')
    return 0;
  if (ch == '\n')
    return 0;
  if (ch == '\t')
    return 0;
  if ((ch == 0x11) || (ch == 0x13))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_control_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     111d <is_control_char+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1170 <is_control_char+0x70>
cmpl   $0xa,-0x8(%rbp)
jne    1133 <is_control_char+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1170 <is_control_char+0x70>
cmpl   $0x9,-0x8(%rbp)
jne    1149 <is_control_char+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1170 <is_control_char+0x70>
cmpl   $0x11,-0x8(%rbp)
je     115d <is_control_char+0x5d>
cmpl   $0x13,-0x8(%rbp)
jne    1169 <is_control_char+0x69>
movl   $0x0,-0x4(%rbp)
jmp    1170 <is_control_char+0x70>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_control_char>:
cmp    $0x20,%edi
setl   %al
lea    -0xb(%rdi),%ecx
cmp    $0xfffffffe,%ecx
setb   %cl
and    $0xfffffffd,%edi
cmp    $0x11,%edi
setne  %dl
and    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_control_char(i32 %0) {
%2 = icmp slt i32 %0, 32
%3 = add i32 %0, -11
%4 = icmp ult i32 %3, -2
%5 = and i32 %0, -3
%6 = icmp ne i32 %5, 17
%7 = and i1 %2, %4
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
unsigned int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *,
                      unsigned int *);
void listen_udp_packet(char message[65507], unsigned int *message_length,
                       int socket_) {
  unsigned int client_address_length;
  struct sockaddr_in client_address;
  *message_length =
      recvfrom(socket_, message, 65507, 0, (struct sockaddr *)&client_address,
               &client_address_length);
}


x86 assembly (clang, -O0):
<listen_udp_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
lea    -0x20(%rbp),%r8
mov    $0xffe3,%edx
xor    %ecx,%ecx
lea    -0x18(%rbp),%r9
call   1030 <recvfrom@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listen_udp_packet>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x8(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %edx,%edi
mov    $0xffe3,%edx
xor    %ecx,%ecx
call   1030 <recvfrom@plt>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define void @listen_udp_packet(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sockaddr_in
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%12 = call i32 @recvfrom(i32 %9, i8* %10, i32 65507, i32 0, %struct.sockaddr* %11, i32* %7)
%13 = load i32*, i32** %5
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define void @listen_udp_packet(i8* %0, i32* nocapture writeonly %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
%6 = bitcast i32* %4 to i8*
%7 = bitcast %struct.sockaddr_in* %5 to i8*
%8 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%9 = call i32 @recvfrom(i32 %2, i8* %0, i32 65507, i32 0, %struct.sockaddr* %8, i32* %4)
store i32 %9, i32* %1
ret void
}
double m2Nm(const double valueMt) { return valueMt / 1852; }


x86 assembly (clang, -O0):
<m2Nm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @m2Nm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.852000e+03
ret double %4
}

LLVM IR (-O2):
define double @m2Nm(double %0) {
%2 = fdiv double %0, 1.852000e+03
ret double %2
}
/* Variables and functions */
char *crypt(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) { printf("%s\n", crypt("12345", "50")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <crypt@plt>
mov    %rax,%rsi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <crypt@plt>
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"12345\00"
@.str.2 = [3 x i8] c"50\00"
define i32 @main() {
%1 = call i8* @crypt(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"12345\00"
@.str.2 = [3 x i8] c"50\00"
define i32 @main() {
%1 = tail call i8* @crypt(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
void bcopy(const void *__src, void *__dest, unsigned long int __len) {
  __builtin___memmove_chk(__dest, __src, (unsigned int)__len,
                          18446744073709551615ul);
}


x86 assembly (clang, -O0):
<bcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%eax
mov    %eax,%edx
mov    $0xffffffffffffffff,%rcx
call   1030 <__memmove_chk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcopy>:
mov    %rdi,%rax
mov    %edx,%edx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @bcopy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = trunc i64 %9 to i32
%11 = zext i32 %10 to i64
%12 = call i8* @__memmove_chk(i8* %7, i8* %8, i64 %11, i64 -1)
ret void
}

LLVM IR (-O2):
define void @bcopy(i8* nocapture %0, i8* nocapture writeonly %1, i64 %2) {
%4 = and i64 %2, 4294967295
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %0, i64 %4, i1 false)
ret void
}
int test_imm_97int32_mem(int *val) {
  return ((*val) & (0x97 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_97int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 151
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((destructor(789))) void F() {}


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 789, void ()* @F, i8* null }]
define void @F() {
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 789, void ()* @F, i8* null }]
define void @F() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(int);
int /*<<< orphan*/ printf(char *);
void *xmalloc(int len) {
  void *ptr = malloc(len);
  if (ptr == NULL) {
    printf("stderr: malloc failed\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <xmalloc+0x38>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"stderr: malloc failed\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@str = [22 x i8] c"stderr: malloc failed\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}