xunge/DecIR huggingface dataset:
void address_encoder(int address_in, unsigned char *address_out) {
  int i = 0;
  int adrbytes = 4;
  unsigned char nibble;
  for (i = 0; i < adrbytes; i++) {
    nibble = (address_in >> (4 * (3 - i))) & 0x0F;
    address_out[i] = (unsigned char)(0x82 + (nibble * 4));
  }
  return;
}


x86 assembly (clang, -O0):
<address_encoder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1169 <address_encoder+0x69>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
sub    -0x14(%rbp),%ecx
shl    $0x2,%ecx
sar    %cl,%eax
and    $0xf,%eax
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
shl    $0x2,%eax
add    $0x82,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <address_encoder+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<address_encoder>:
mov    %edi,%eax
shr    $0xa,%eax
and    $0x3c,%al
or     $0x82,%al
mov    %al,(%rsi)
mov    %edi,%eax
shr    $0x6,%eax
and    $0x3c,%al
or     $0x82,%al
mov    %al,0x1(%rsi)
mov    %edi,%eax
shr    $0x2,%al
and    $0x3c,%al
or     $0x82,%al
mov    %al,0x2(%rsi)
shl    $0x2,%dil
and    $0x3c,%dil
or     $0x82,%dil
mov    %dil,0x3(%rsi)
ret

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

LLVM IR (-O2):
define void @address_encoder(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 10
%4 = trunc i32 %3 to i8
%5 = and i8 %4, 60
%6 = or i8 %5, -126
store i8 %6, i8* %1
%7 = lshr i32 %0, 6
%8 = trunc i32 %7 to i8
%9 = and i8 %8, 60
%10 = or i8 %9, -126
%11 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %10, i8* %11
%12 = trunc i32 %0 to i8
%13 = lshr i8 %12, 2
%14 = and i8 %13, 60
%15 = or i8 %14, -126
%16 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %15, i8* %16
%17 = trunc i32 %0 to i8
%18 = shl i8 %17, 2
%19 = and i8 %18, 60
%20 = or i8 %19, -126
%21 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %20, i8* %21
ret void
}
/* Variables and functions */
int test(unsigned char *, int);
int is_g(unsigned char *seq, int n) {
  int ndx = n * 2;
  if (test(seq, ndx) == 0 || test(seq, ndx + 1) == 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <test@plt>
cmp    $0x0,%eax
je     1155 <is_g+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
add    $0x1,%esi
call   1030 <test@plt>
cmp    $0x1,%eax
jne    1161 <is_g+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1168 <is_g+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_g>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
add    %esi,%ebx
mov    %ebx,%esi
call   1030 <test@plt>
test   %eax,%eax
je     113f <is_g+0x2f>
or     $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <test@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
setne  %al
jmp    1141 <is_g+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @is_g(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = tail call i32 @test(i8* %0, i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = or i32 %3, 1
%8 = tail call i32 @test(i8* %0, i32 %7)
%9 = icmp ne i32 %8, 1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
void frssort1(unsigned char **, size_t);
void forward8(unsigned char **strings, size_t n) {
  return frssort1(strings, n);
}


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

x86 assembly (clang, -O2):
<forward8>:
jmp    1030 <frssort1@plt>

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

LLVM IR (-O2):
define void @forward8(i8** %0, i64 %1) {
tail call void @frssort1(i8** %0, i64 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct ns_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ns_send_mqtt_short_command(struct ns_connection *, int,
                                              int /*<<< orphan*/);
void ns_mqtt_unsuback(struct ns_connection *nc, uint16_t message_id) {
  ns_send_mqtt_short_command(nc, 11, message_id);
}


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

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

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

LLVM IR (-O2):
%struct.ns_connection = type { i32 }
define void @ns_mqtt_unsuback(%struct.ns_connection* %0, i32 %1) {
%3 = tail call i32 @ns_send_mqtt_short_command(%struct.ns_connection* %0, i32 11, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prints(char *);
void println() { prints("\n"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @println() {
%1 = call i32 @prints(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @println() {
%1 = tail call i32 @prints(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void acs_cleanup(struct hostapd_iface *iface) {}


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

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

LLVM IR (-O0):
%struct.hostapd_iface = type opaque
define void @acs_cleanup(%struct.hostapd_iface* %0) {
%2 = alloca %struct.hostapd_iface*
store %struct.hostapd_iface* %0, %struct.hostapd_iface** %2
ret void
}

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define void @acs_cleanup(%struct.hostapd_iface* nocapture %0) {
ret void
}
/* Variables and functions */
void *malloc(int);
void *xmalloc(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<xmalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
char base64_encode_value(char value_in) {
  static const char encoding[] =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  static const char encoding_size = sizeof(encoding);
  if (value_in >= encoding_size) {
    return '=';
  }
  return encoding[(int)value_in];
}


x86 assembly (clang, -O0):
<base64_encode_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1120 <base64_encode_value+0x20>
movb   $0x3d,-0x1(%rbp)
jmp    1134 <base64_encode_value+0x34>
movsbl -0x2(%rbp),%eax
movslq %eax,%rcx
lea    0xed2(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_value>:
mov    $0x3d,%al
cmp    $0x40,%dil
jg     1116 <base64_encode_value+0x16>
movsbq %dil,%rax
lea    0xeed(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@base64_encode_value.encoding = internal constant [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
@base64_encode_value.encoding_size = internal constant i8 65
define signext i8 @base64_encode_value(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 61, i8* %2
br label %14
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [65 x i8], [65 x i8]* @base64_encode_value.encoding, i64 0, i64 %11
%13 = load i8, i8* %12
store i8 %13, i8* %2
br label %14
14: ; preds = %8, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
@base64_encode_value.encoding = internal unnamed_addr constant [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @base64_encode_value(i8 signext %0) {
%2 = icmp sgt i8 %0, 64
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = getelementptr inbounds [65 x i8], [65 x i8]* @base64_encode_value.encoding, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 61, %1 ]
ret i8 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  uint8_t code[] __attribute__((aligned(32))) = {0xc3};
  void (*func)(void);
  func = (void (*)(void))(uintptr_t)code;
  fprintf(stderr, "** intended_exit_status=untrusted_sigsegv_or_equivalent\n");
  func();
  fprintf(stderr, "We're still running. This is bad.\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffffe0,%rsp
sub    $0x40,%rsp
movl   $0x0,0x2c(%rsp)
mov    0xed6(%rip),%eax
mov    %eax,0x20(%rsp)
lea    0x20(%rsp),%rax
mov    %rax,0x18(%rsp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
call   *0x18(%rsp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
and    $0xffffffffffffffe0,%rsp
sub    $0x20,%rsp
mov    0x2ebc(%rip),%rbx
mov    (%rbx),%edi
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rsp,%rax
call   *%rax
mov    (%rbx),%edi
lea    0xef9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.code = [1 x i32] [i32 195]
@stderr = global i32 0
@.str = [57 x i8] c"** intended_exit_status=untrusted_sigsegv_or_equivalent\0A\00"
@.str.1 = [35 x i8] c"We're still running. This is bad.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = alloca void ()*
store i32 0, i32* %1
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%6 = ptrtoint i32* %5 to i64
%7 = inttoptr i64 %6 to void ()*
store void ()* %7, void ()** %3
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%10 = load void ()*, void ()** %3
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"** intended_exit_status=untrusted_sigsegv_or_equivalent\0A\00"
@.str.1 = [35 x i8] c"We're still running. This is bad.\0A\00"
define i32 @main() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = bitcast [1 x i32]* %1 to void ()*
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ prune_sub1(int);
void call_prune_sub1_1_Good() { prune_sub1(5); }


x86 assembly (clang, -O0):
<call_prune_sub1_1_Good>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <prune_sub1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_prune_sub1_1_Good>:
mov    $0x5,%edi
jmp    1030 <prune_sub1@plt>

LLVM IR (-O0):
define void @call_prune_sub1_1_Good() {
%1 = call i32 @prune_sub1(i32 5)
ret void
}

LLVM IR (-O2):
define void @call_prune_sub1_1_Good() {
%1 = tail call i32 @prune_sub1(i32 5)
ret void
}
void r_icu_irq5_interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @r_icu_irq5_interrupt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((destructor)) destroy(void) {
  printf("Chamado depois de main().\n");
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Chamado depois de main().\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @destroy, i8* null }]
define void @destroy() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @destroy, i8* null }]
@str = [26 x i8] c"Chamado depois de main().\00"
define void @destroy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage:    smasm <flags> <input> [output]\n"
         "\tl       will generate a .log file reporting everything happened\n"
         "\te       is used to execute a file\n"
         "\tc       will compile a source file\n");
}


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

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

LLVM IR (-O0):
@.str = [178 x i8] c"usage: smasm <flags> <input> [output]\0A\09l will generate a .log file reporting everything happened\0A\09e is used to execute a file\0A\09c will compile a source file\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [177 x i8] c"usage: smasm <flags> <input> [output]\0A\09l will generate a .log file reporting everything happened\0A\09e is used to execute a file\0A\09c will compile a source file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([177 x i8], [177 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a = 1 + (10, 20, 30, 40);
  printf("%d\n", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 41)
ret i32 0
}
void record_free_skb_head(struct sk_buff *skb) {}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
define void @record_free_skb_head(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
ret void
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
define void @record_free_skb_head(%struct.sk_buff* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int containsDuplicate(int *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int nums[] = {1, 2, 3, 4};
  int b_value;
  b_value = containsDuplicate(nums, sizeof(nums) / sizeof(nums[0]));
  if (b_value)
    printf("contain dump.");
  else
    printf("no dump.");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <containsDuplicate@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1171 <main+0x51>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x5d>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <containsDuplicate@plt>
test   %eax,%eax
lea    0xed9(%rip),%rax
lea    0xec4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [14 x i8] c"contain dump.\00"
@.str.1 = [9 x i8] c"no dump.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%6 = call i32 @containsDuplicate(i32* %5, i32 4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@__const.main.nums = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [14 x i8] c"contain dump.\00"
@.str.1 = [9 x i8] c"no dump.\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @containsDuplicate(i32* %3, i32 4)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
void copyaline(char *to, char *from) {
  int i;
  for (i = 0; (to[i] = from[i]) != '\0'; ++i)
    ;
}


x86 assembly (clang, -O0):
<copyaline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1148 <copyaline+0x48>
jmp    113a <copyaline+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copyaline+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyaline>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copyaline+0x10>
ret

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

LLVM IR (-O2):
define void @copyaline(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void pollar_rejection_init() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<pollar_rejection_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pollar_rejection_init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @pollar_rejection_init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void __attribute__((__noreturn__)) yy_fatal_error(const char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(2);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yy_fatal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
void finish(int sig) {
  endwin();
  exit(sig != 0);
}


x86 assembly (clang, -O0):
<finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<finish>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1040 <exit@plt>

LLVM IR (-O0):
define void @finish(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
define void @finish(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int cb_ascending(const void *a, const void *b) {
  if (*(double *)(a) < *(double *)(b))
    return -1;
  else if (*(double *)(a) > *(double *)(b))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cb_ascending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <cb_ascending+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <cb_ascending+0x60>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <cb_ascending+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1160 <cb_ascending+0x60>
jmp    1159 <cb_ascending+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ascending>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cb_ascending(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %25
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp ogt double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %25
23: ; preds = %14
br label %24
24: ; preds = %23
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %13
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @cb_ascending(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ hide(int);
void auto_state(void) {
  auto int a = 0;
  hide(a);
  a++;
  hide(a);
}


x86 assembly (clang, -O0):
<auto_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <hide@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <hide@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auto_state>:
push   %rax
xor    %edi,%edi
call   1030 <hide@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <hide@plt>

LLVM IR (-O0):
define void @auto_state() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @hide(i32 %2)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @hide(i32 %6)
ret void
}

LLVM IR (-O2):
define void @auto_state() {
%1 = tail call i32 @hide(i32 0)
%2 = tail call i32 @hide(i32 1)
ret void
}
/* Variables and functions */
void preenche_valor(double **, int, int, double);
void preenche_valor_quadrada(double **M, int dim, double valor) {
  return preenche_valor(M, dim, dim, valor);
}


x86 assembly (clang, -O0):
<preenche_valor_quadrada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
call   1030 <preenche_valor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preenche_valor_quadrada>:
mov    %esi,%edx
jmp    1030 <preenche_valor@plt>

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

LLVM IR (-O2):
define void @preenche_valor_quadrada(double** %0, i32 %1, double %2) {
tail call void @preenche_valor(double** %0, i32 %1, i32 %1, double %2)
ret void
}
int imin(const int a, const int b) { return (a < b) ? a : b; }


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

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

LLVM IR (-O0):
define i32 @imin(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 = 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 @imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int test_imm_4Eint64_lowword_reg(long long val) {
  return ((val) & (0x4E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Eint64_lowword_reg>:
test   $0x4e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Eint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 78
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mpga_get_sampling_freq(const uint8_t *p_mpga) {
  return (p_mpga[2] & 0xc) >> 2;
}


x86 assembly (clang, -O0):
<mpga_get_sampling_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0xc,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_get_sampling_freq>:
mov    0x8(%rdi),%eax
shr    $0x2,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mpga_get_sampling_freq(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 12
%7 = ashr i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @mpga_get_sampling_freq(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 2
%5 = and i32 %4, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ hook(char *);
void init(void) { hook("init() called inside missing-import."); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"init() called inside missing-import.\00"
define void @init() {
%1 = call i32 @hook(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"init() called inside missing-import.\00"
define void @init() {
%1 = tail call i32 @hook(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ process(char *, char *);
int main(void) {
  char *dataA = "programming";
  char *dataB = "dynamic";
  process(dataA, dataB);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <process@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"programming\00"
@.str.1 = [8 x i8] c"dynamic\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @process(i8* %4, i8* %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [12 x i8] c"programming\00"
@.str.1 = [8 x i8] c"dynamic\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @process(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ assert(int);
scalar_t__ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fd_set_close_on_exec(int fd) {
  assert(fd >= 0);
  if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<fd_set_close_on_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%edi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    116c <fd_set_close_on_exec+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <fd_set_close_on_exec+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_set_close_on_exec>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
call   1030 <fcntl@plt>
sar    $0x3f,%rax
pop    %rbx
ret

LLVM IR (-O0):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define i32 @fd_set_close_on_exec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* @F_SETFD
%10 = load i32, i32* @FD_CLOEXEC
%11 = call i64 @fcntl(i32 %8, i32 %9, i32 %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define i32 @fd_set_close_on_exec(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @F_SETFD
%6 = load i32, i32* @FD_CLOEXEC
%7 = tail call i64 @fcntl(i32 %0, i32 %5, i32 %6)
%8 = ashr i64 %7, 63
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int system(char *);
int main(int argc, char *argv[]) {
  setuid(0);
  char cmdLine[256];
  sprintf(cmdLine, "/bin/bash /etc/init.d/eyetrack %s", argv[1]);
  return system(cmdLine);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1050 <setuid@plt>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe9a(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
xor    %edi,%edi
call   1050 <setuid@plt>
mov    0x8(%rbx),%rdx
lea    0xeb3(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"/bin/bash /etc/init.d/eyetrack %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @setuid(i32 0)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%14 = call i32 @system(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [34 x i8] c"/bin/bash /etc/init.d/eyetrack %s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = tail call i32 @setuid(i32 0)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @system(i8* %5)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushpointer4array(char *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 4));
}


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

x86 assembly (clang, -O2):
<pushpointer4array>:
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushpointer4array(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 = mul nsw i32 %6, 4
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushpointer4array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
void ExitProg(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ExitProg() {
ret void
}
START_TEST(test_hashtable_create) {}


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

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

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

LLVM IR (-O2):
define i32 @START_TEST(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int rmdir(char const *);
__attribute__((__weak__, __always___)) int
softboundcets_rmdir(const char *pathname) {
  return rmdir(pathname);
}


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

x86 assembly (clang, -O2):
<softboundcets_rmdir>:
jmp    1030 <rmdir@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_rmdir(i8* %0) {
%2 = tail call i32 @rmdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_file(char *);
void test_find_file_dont_exist(void) {
  char *filename = "settings.pyc";
  assert(-1 == find_file(filename));
}


x86 assembly (clang, -O0):
<test_find_file_dont_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <find_file@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_find_file_dont_exist>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <find_file@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"settings.pyc\00"
define void @test_find_file_dont_exist() {
%1 = alloca i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @find_file(i8* %2)
%4 = icmp eq i32 -1, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"settings.pyc\00"
define void @test_find_file_dont_exist() {
%1 = tail call i32 @find_file(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
void c_setuid_(uid_t *uid) { setuid(*uid); }


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

x86 assembly (clang, -O2):
<c_setuid_>:
mov    (%rdi),%edi
jmp    1030 <setuid@plt>

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

LLVM IR (-O2):
define void @c_setuid_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @setuid(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_greater_than(void) {
  gen_pop();
  gen_call("ccgt");
}


x86 assembly (clang, -O0):
<gen_greater_than>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_greater_than>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ccgt\00"
define void @gen_greater_than() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ccgt\00"
define void @gen_greater_than() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void func(void) { asm("func_label: .globl func_label"); }


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

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

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

LLVM IR (-O2):
define void @func() {
tail call void asm sideeffect "func_label: .globl func_label", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _s2warn(char *, char *);
void cs2socb_(void *icbfn) {
  _s2warn("cs2socb", "function not available / useful from FORTRAN");
  return;
}


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

x86 assembly (clang, -O2):
<cs2socb_>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
jmp    1030 <_s2warn@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"cs2socb\00"
@.str.1 = [45 x i8] c"function not available / useful from FORTRAN\00"
define void @cs2socb_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @_s2warn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"cs2socb\00"
@.str.1 = [45 x i8] c"function not available / useful from FORTRAN\00"
define void @cs2socb_(i8* nocapture readnone %0) {
%2 = tail call i32 @_s2warn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float Float_copy(float *x) { return *x; }


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

x86 assembly (clang, -O2):
<Float_copy>:
movss  (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define float @Float_copy(float* nocapture %0) {
%2 = load float, float* %0
ret float %2
}