xunge/DecIR huggingface dataset:
unsigned long long pgt_value_to_gray(unsigned long long _value) {
  return (_value >> 1ULL) ^ _value;
}


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

x86 assembly (clang, -O2):
<pgt_value_to_gray>:
mov    %rdi,%rax
shr    %rax
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @pgt_value_to_gray(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 1
%5 = load i64, i64* %2
%6 = xor i64 %4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @pgt_value_to_gray(i64 %0) {
%2 = lshr i64 %0, 1
%3 = xor i64 %2, %0
ret i64 %3
}
/* Variables and functions */
int atoi(char const *);
int str_int(const char *i) { return atoi(i); }


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

x86 assembly (clang, -O2):
<str_int>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @str_int(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() { printf("%s\n", "Hello world."); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [13 x i8] c"Hello world.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void lgtd_proto_power_off(struct lgtd_client *client,
                          const struct lgtd_proto_target_list *targets) {
  (void)client;
  (void)targets;
}


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

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

LLVM IR (-O0):
%struct.lgtd_client = type opaque
%struct.lgtd_proto_target_list = type opaque
define void @lgtd_proto_power_off(%struct.lgtd_client* %0, %struct.lgtd_proto_target_list* %1) {
%3 = alloca %struct.lgtd_client*
%4 = alloca %struct.lgtd_proto_target_list*
store %struct.lgtd_client* %0, %struct.lgtd_client** %3
store %struct.lgtd_proto_target_list* %1, %struct.lgtd_proto_target_list** %4
%5 = load %struct.lgtd_client*, %struct.lgtd_client** %3
%6 = load %struct.lgtd_proto_target_list*, %struct.lgtd_proto_target_list** %4
ret void
}

LLVM IR (-O2):
%struct.lgtd_client = type opaque
%struct.lgtd_proto_target_list = type opaque
define void @lgtd_proto_power_off(%struct.lgtd_client* nocapture %0, %struct.lgtd_proto_target_list* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(char *myname) { printf("usage: %s  in_filename out_filename\n"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"usage: %s in_filename out_filename\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"usage: %s in_filename out_filename\0A\00"
define void @usage(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
void fn4() {
  int l;
  __asm__("" : "=r"(l) : "m#"(l));
}


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

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

LLVM IR (-O0):
define void @fn4() {
%1 = alloca i32
%2 = call i32 asm "", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %1)
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @fn4() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 asm "", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reg_addrange(char, int);
void reg_addranges_D(void) {
  reg_addrange(0, '0' - 1);
  reg_addrange('9' + 1, 0xFFFF);
}


x86 assembly (clang, -O0):
<reg_addranges_D>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2f,%esi
call   1030 <reg_addrange@plt>
mov    $0x3a,%edi
mov    $0xffff,%esi
call   1030 <reg_addrange@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_addranges_D>:
push   %rax
xor    %edi,%edi
mov    $0x2f,%esi
call   1030 <reg_addrange@plt>
mov    $0x3a,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1030 <reg_addrange@plt>

LLVM IR (-O0):
define void @reg_addranges_D() {
%1 = call i32 @reg_addrange(i8 signext 0, i32 47)
%2 = call i32 @reg_addrange(i8 signext 58, i32 65535)
ret void
}

LLVM IR (-O2):
define void @reg_addranges_D() {
%1 = tail call i32 @reg_addrange(i8 signext 0, i32 47)
%2 = tail call i32 @reg_addrange(i8 signext 58, i32 65535)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlncpy(char *dst, size_t dstspace, const char *src, size_t srclen) {
  int cpn = srclen < dstspace ? srclen : dstspace;
  memcpy(dst, src, cpn);
  return cpn;
}


x86 assembly (clang, -O0):
<strlncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1143 <strlncpy+0x33>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    114b <strlncpy+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlncpy>:
push   %rbx
mov    %rsi,%rbx
cmp    %rsi,%rcx
cmovb  %ecx,%ebx
mov    %rdx,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @strlncpy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i64, i64* %8
%11 = load i64, i64* %6
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i64, i64* %8
br label %17
15: ; preds = %4
%16 = load i64, i64* %6
br label %17
17: ; preds = %15, %13
%18 = phi i64 [ %14, %13 ], [ %16, %15 ]
%19 = trunc i64 %18 to i32
store i32 %19, i32* %9
%20 = load i8*, i8** %5
%21 = load i8*, i8** %7
%22 = load i32, i32* %9
%23 = call i32 @memcpy(i8* %20, i8* %21, i32 %22)
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
define i32 @strlncpy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp ult i64 %3, %1
%6 = select i1 %5, i64 %3, i64 %1
%7 = trunc i64 %6 to i32
%8 = tail call i32 @memcpy(i8* %0, i8* %2, i32 %7)
ret i32 %7
}
int execute_rename() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_rename() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
uint16_t host_to_network_short(uint16_t s) { return htons(s); }


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

x86 assembly (clang, -O2):
<host_to_network_short>:
jmp    1030 <htons@plt>

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

LLVM IR (-O2):
define i32 @host_to_network_short(i32 %0) {
%2 = tail call i32 @htons(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sleep(int);
void *timer_exit(void *arg) {
  sleep(100);
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<timer_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1040 <sleep@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<timer_exit>:
push   %rax
mov    $0x64,%edi
call   1040 <sleep@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i8* @timer_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 100)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define noalias i8* @timer_exit(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 100)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void f0(void) {
  goto a;
a:
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_le64(int /*<<< orphan*/, void *);
void put_unaligned_le64(uint64_t val, void *p) { __put_unaligned_le64(val, p); }


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

x86 assembly (clang, -O2):
<put_unaligned_le64>:
jmp    1030 <__put_unaligned_le64@plt>

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

LLVM IR (-O2):
define void @put_unaligned_le64(i32 %0, i8* %1) {
%3 = tail call i32 @__put_unaligned_le64(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int AAS_TravelFlagForType_inline(int);
int AAS_TravelFlagForType(int traveltype) {
  return AAS_TravelFlagForType_inline(traveltype);
}


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

x86 assembly (clang, -O2):
<AAS_TravelFlagForType>:
jmp    1030 <AAS_TravelFlagForType_inline@plt>

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

LLVM IR (-O2):
define i32 @AAS_TravelFlagForType(i32 %0) {
%2 = tail call i32 @AAS_TravelFlagForType_inline(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned short *, int, int, int /*<<< orphan*/ *);
unsigned short read_ushort(FILE *file) {
  unsigned short ret;
  fread(&ret, 1, sizeof(unsigned short), file);
  return ret;
}


x86 assembly (clang, -O0):
<read_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xa(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ushort>:
push   %rax
mov    %rdi,%rcx
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @read_ushort(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i16* %3, i32 1, i32 2, i32* %4)
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @read_ushort(i32* nocapture %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = call i32 @fread(i16* %2, i32 1, i32 2, i32* %0)
%5 = load i16, i16* %2
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("enter a number");
  scanf("%d", &a);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"enter a number\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"enter a number\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
extern uint32_t ntohl(uint32_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @ntohl(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int getyear(int);
int getmonth(int date) { return (date - 10000 * getyear(date)) / 100; }


x86 assembly (clang, -O0):
<getmonth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getyear@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0x2710,%ecx,%ecx
sub    %ecx,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmonth>:
push   %rbx
mov    %edi,%ebx
call   1030 <getyear@plt>
imul   $0xffffd8f0,%eax,%eax
add    %ebx,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getmonth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @getyear(i32 %4)
%6 = mul nsw i32 10000, %5
%7 = sub nsw i32 %3, %6
%8 = sdiv i32 %7, 100
ret i32 %8
}

LLVM IR (-O2):
define i32 @getmonth(i32 %0) {
%2 = tail call i32 @getyear(i32 %0)
%3 = mul i32 %2, -10000
%4 = add i32 %3, %0
%5 = sdiv i32 %4, 100
ret i32 %5
}
int fun1073() { return 1073; }


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

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

LLVM IR (-O0):
define i32 @fun1073() {
ret i32 1073
}

LLVM IR (-O2):
define i32 @fun1073() {
ret i32 1073
}
void check_zero_sized_VLA_multi1(int x) {
  if (x)
    return;
  int vla[10][x];
}


x86 assembly (clang, -O0):
<check_zero_sized_VLA_multi1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111a <check_zero_sized_VLA_multi1+0x1a>
jmp    112f <check_zero_sized_VLA_multi1+0x2f>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @check_zero_sized_VLA_multi1(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %15
8: ; preds = %1
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %3
%12 = mul nuw i64 10, %10
%13 = alloca i32, i64 %12
store i64 %10, i64* %4
%14 = load i8*, i8** %3
br label %15
15: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @check_zero_sized_VLA_multi1(i32 %0) {
ret void
}
int test_imm_3Buint8_reg(unsigned char val) {
  return ((val) & (-0x3B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffc5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_3Buint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -59
%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_3Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -59
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int write(int, char *, int);
ssize_t bdtun_complete_request(int fd) {
  ssize_t res = write(fd, "\0x00", 1);
  if (res != 1) {
    return res;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bdtun_complete_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1147 <bdtun_complete_request+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <bdtun_complete_request+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdtun_complete_request>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\00x00\00"
define i32 @bdtun_complete_request(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"\00x00\00"
define i32 @bdtun_complete_request(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i32 0, i32 %2
ret i32 %4
}
void set_rt_sto(unsigned long *entry, void *sto) {
  *entry &= 0x3fffUL;
  *entry |= ((unsigned long)sto & (~0x3fffUL));
  *entry |= 0x4;
}


x86 assembly (clang, -O0):
<set_rt_sto>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0x3fff,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
and    $0xffffffffffffc000,%rcx
mov    -0x8(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x4,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_rt_sto>:
mov    (%rdi),%rax
and    $0x3ffb,%eax
and    $0xffffffffffffc000,%rsi
add    %rsi,%rax
add    $0x4,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @set_rt_sto(i64* %0, i8* %1) {
%3 = alloca i64*
%4 = alloca i8*
store i64* %0, i64** %3
store i8* %1, i8** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = and i64 %6, 16383
store i64 %7, i64* %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = and i64 %9, -16384
%11 = load i64*, i64** %3
%12 = load i64, i64* %11
%13 = or i64 %12, %10
store i64 %13, i64* %11
%14 = load i64*, i64** %3
%15 = load i64, i64* %14
%16 = or i64 %15, 4
store i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @set_rt_sto(i64* nocapture %0, i8* %1) {
%3 = load i64, i64* %0
%4 = and i64 %3, 16379
%5 = ptrtoint i8* %1 to i64
%6 = and i64 %5, -16384
%7 = or i64 %6, %4
%8 = or i64 %7, 4
store i64 %8, i64* %0
ret void
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_DELETE_ELEM;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_delete_elem(int fd, void *key) {
  union bpf_attr attr = {
      .map_fd = fd,
      .key = ptr_to_u64(key),
  };
  return syscall(321, BPF_MAP_DELETE_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_delete_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_delete_elem>:
push   %rax
mov    %rsi,%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x141,%edi
mov    $0x4,%ecx
call   1040 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_delete_elem(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast %union.bpf_attr* %5 to i32*
%7 = load i8*, i8** %4
%8 = call i32 @ptr_to_u64(i8* %7)
store i32 %8, i32* %6
%9 = load i32, i32* @BPF_MAP_DELETE_ELEM
%10 = call i32 @syscall(i32 321, i32 %9, %union.bpf_attr* %5, i32 4)
ret i32 %10
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_delete_elem(i32 %0, i8* %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
%6 = tail call i32 @ptr_to_u64(i8* %1)
store i32 %6, i32* %5
%7 = load i32, i32* @BPF_MAP_DELETE_ELEM
%8 = call i32 @syscall(i32 321, i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}
void Retrieve_String(pos, str) int pos;
int *str;
{
  int ss, Base_Seqstr_tok;
  valIth_flags(&Base_Seqstr_tok, 26);
  valIth_seqstr(&ss, Base_Seqstr_tok, pos);
  xtr_string(str, ss);
}


x86 assembly (clang, -O0):
<Retrieve_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x1a,%esi
mov    $0x0,%al
call   1050 <valIth_flags@plt>
mov    -0x18(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    -0x14(%rbp),%rdi
mov    $0x0,%al
call   1040 <valIth_seqstr@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <xtr_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Retrieve_String>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%rdi
mov    $0x1a,%esi
xor    %eax,%eax
call   1050 <valIth_flags@plt>
mov    (%rsp),%esi
lea    0x4(%rsp),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <valIth_seqstr@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <xtr_string@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @Retrieve_String(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @valIth_flags to i32 (i32*, i32, ...)*)(i32* %6, i32 26)
%8 = load i32, i32* %6
%9 = load i32, i32* %3
%10 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @valIth_seqstr to i32 (i32*, i32, i32, ...)*)(i32* %5, i32 %8, i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @xtr_string to i32 (i32*, i32, ...)*)(i32* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Retrieve_String(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @valIth_flags to i32 (i32*, i32, ...)*)(i32* %4, i32 26)
%8 = load i32, i32* %4
%9 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @valIth_seqstr to i32 (i32*, i32, i32, ...)*)(i32* %3, i32 %8, i32 %0)
%10 = load i32, i32* %3
%11 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @xtr_string to i32 (i32*, i32, ...)*)(i32* %1, i32 %10)
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
int /*<<< orphan*/ FIONBIO;
scalar_t__ errno;
int ioctl(int, int /*<<< orphan*/, int *);
int sock_nonblock(int fd, int set) {
  int r;
  do
    r = ioctl(fd, FIONBIO, &set);
  while (r == -1 && errno == EINTR);
  return r;
}


x86 assembly (clang, -O0):
<sock_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    115f <sock_nonblock+0x4f>
mov    0x2e94(%rip),%rax
mov    (%rax),%rax
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111e <sock_nonblock+0xe>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_nonblock>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,0xc(%rsp)
mov    0x2eae(%rip),%r15
lea    0xc(%rsp),%r14
mov    0x2eaa(%rip),%r12
mov    0x2e93(%rip),%r13
nopl   (%rax)
mov    (%r15),%esi
mov    %ebx,%edi
mov    %r14,%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    115c <sock_nonblock+0x4c>
mov    0x0(%r13),%rcx
cmp    %rcx,(%r12)
je     1140 <sock_nonblock+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@FIONBIO = global i32 0
@errno = global i64 0
@EINTR = global i64 0
define i32 @sock_nonblock(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %3
%8 = load i32, i32* @FIONBIO
%9 = call i32 @ioctl(i32 %7, i32 %8, i32* %4)
store i32 %9, i32* %5
br label %10
10: ; preds = %6
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i64, i64* @errno
%15 = load i64, i64* @EINTR
%16 = icmp eq i64 %14, %15
br label %17
17: ; preds = %13, %10
%18 = phi i1 [ false, %10 ], [ %16, %13 ]
br i1 %18, label %6, label %19
19: ; preds = %17
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@FIONBIO = global i32 0
@errno = global i64 0
@EINTR = global i64 0
define i32 @sock_nonblock(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
br label %4
4: ; preds = %4, %2
%5 = load i32, i32* @FIONBIO
%6 = call i32 @ioctl(i32 %0, i32 %5, i32* %3)
%7 = icmp eq i32 %6, -1
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
%11 = select i1 %7, i1 %10, i1 false
br i1 %11, label %4, label %12
12: ; preds = %4
ret i32 %6
}
void mxs_power_wait_pswitch(void) {}


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

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

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

LLVM IR (-O2):
define void @mxs_power_wait_pswitch() {
ret void
}
/* Variables and functions */
int oligo2bin(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int bin;
  char *word = "GGGGGGGGGGGGGGG";
  bin = oligo2bin(word);
  printf("bin->%d\n", bin);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"GGGGGGGGGGGGGGG\00"
@.str.1 = [9 x i8] c"bin->%d\0A\00"
define i32 @main() {
%1 = tail call i32 @oligo2bin(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned char ExceedsThreshold(int initial, int delta, int threshold) {
  return ((initial < threshold) && (initial + delta >= threshold));
}


x86 assembly (clang, -O0):
<ExceedsThreshold>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    112d <ExceedsThreshold+0x2d>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExceedsThreshold>:
cmp    %edx,%edi
setl   %cl
add    %edi,%esi
cmp    %edx,%esi
setge  %al
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @ExceedsThreshold(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %6
%15 = icmp sge i32 %13, %14
br label %16
16: ; preds = %10, %3
%17 = phi i1 [ false, %3 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @ExceedsThreshold(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %2
%5 = add nsw i32 %1, %0
%6 = icmp sge i32 %5, %2
%7 = select i1 %4, i1 %6, i1 false
%8 = zext i1 %7 to i8
ret i8 %8
}
/* Type definitions */
struct _peer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CompleteState(struct _peer *);
void PEER_write(struct _peer *p) { CompleteState(p); }


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

x86 assembly (clang, -O2):
<PEER_write>:
jmp    1030 <CompleteState@plt>

LLVM IR (-O0):
%struct._peer = type { i32 }
define void @PEER_write(%struct._peer* %0) {
%2 = alloca %struct._peer*
store %struct._peer* %0, %struct._peer** %2
%3 = load %struct._peer*, %struct._peer** %2
%4 = call i32 @CompleteState(%struct._peer* %3)
ret void
}

LLVM IR (-O2):
%struct._peer = type { i32 }
define void @PEER_write(%struct._peer* %0) {
%2 = tail call i32 @CompleteState(%struct._peer* %0)
ret void
}
char *strcat(char *s, const char *t) {
  char *p;
  p = s;
  while (*p != '\0') {
    p++;
  }
  while ((*p = *t) != '\0') {
    p++;
    t++;
  }
  return s;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <strcat+0x35>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    113a <strcat+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <strcat+0x6f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113a <strcat+0x3a>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
mov    (%rsi),%dl
mov    %dl,-0x1(%rcx)
test   %dl,%dl
je     1142 <strcat+0x42>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rdx,1),%edi
mov    %dil,(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1130 <strcat+0x30>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %14, %11 ], [ %4, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret i8* %0
}
main() {
  struct {
    int : 3;
    int f : 2;
    int a;
  } a;
  memset(&a, 0, sizeof a);
  a.f = 3;
  a.a = 3;
  long long l = *(long long *)&a;
  printf("%lld\n", l);
  if (l != 12884901912)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%al
and    $0xe7,%al
or     $0x18,%al
mov    %al,-0x10(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movabs $0x300000018,%rax
cmp    %rax,-0x18(%rbp)
je     118a <main+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    1191 <main+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i8, i32 }
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast %struct.anon* %2 to i8*
%5 = bitcast %struct.anon* %2 to i8*
%6 = load i8, i8* %5
%7 = and i8 %6, -25
%8 = or i8 %7, 24
store i8 %8, i8* %5
%9 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
store i32 3, i32* %9
%10 = bitcast %struct.anon* %2 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = load i64, i64* %3
%15 = icmp ne i64 %14, 12884901912
br i1 %15, label %16, label %17
16: ; preds = %0
store i32 1, i32* %1
br label %18
17: ; preds = %0
store i32 0, i32* %1
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 12884901912)
ret i32 0
}
int is_prime(int chislo) {
  if (chislo < 1) {
    return -1;
  }
  int i = 2;
  while (i < chislo) {
    if (chislo % i == 0) {
      if (chislo == 2) {
        return 1;
      } else {
        return 0;
      }
    }
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <is_prime+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <is_prime+0x77>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1170 <is_prime+0x70>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1162 <is_prime+0x62>
cmpl   $0x2,-0x8(%rbp)
jne    1156 <is_prime+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1177 <is_prime+0x77>
movl   $0x0,-0x4(%rbp)
jmp    1177 <is_prime+0x77>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <is_prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
test   %edi,%edi
jle    1133 <is_prime+0x33>
mov    $0x1,%ecx
cmp    $0x3,%edi
jb     1130 <is_prime+0x30>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1139 <is_prime+0x39>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <is_prime+0x20>
mov    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret
xor    %ecx,%ecx
cmp    $0x2,%edi
sete   %cl
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 2
br i1 %4, label %7, label %15
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %15, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7
%13 = icmp eq i32 %0, 2
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %5, %3, %12, %1
%16 = phi i32 [ -1, %1 ], [ %14, %12 ], [ 1, %3 ], [ 1, %5 ]
ret i32 %16
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ AT_SYMLINK_NOFOLLOW;
int fstatat(int /*<<< orphan*/, char const *, struct stat *,
            int /*<<< orphan*/);
int lstat(const char *path, struct stat *buf) {
  return fstatat(AT_FDCWD, path, buf, AT_SYMLINK_NOFOLLOW);
}


x86 assembly (clang, -O0):
<lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ecx
call   1030 <fstatat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <fstatat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@AT_FDCWD = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @AT_FDCWD
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%9 = call i32 @fstatat(i32 %5, i8* %6, %struct.stat* %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@AT_FDCWD = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%5 = tail call i32 @fstatat(i32 %3, i8* %0, %struct.stat* %1, i32 %4)
ret i32 %5
}
void outb(short port, char data) {
  __asm__("outb %%al,%%dx" ::"a"(data), "d"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outb(i16 signext %0, i8 signext %1) {
tail call void asm sideeffect "outb %al,%dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
int f_lt_rr1(float a1, float a2) { return (((a1) < (a2))); }


x86 assembly (clang, -O0):
<f_lt_rr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_lt_rr1>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @f_lt_rr1(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f_lt_rr1(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void EVP_PKEY_copy_parameters(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_copy_parameters() {
ret void
}
/* Variables and functions */
int PAPI_start_counters(int *, int);
void papif_start_counters__(int *events, int *array_len, int *check) {
  *check = PAPI_start_counters(events, *array_len);
}


x86 assembly (clang, -O0):
<papif_start_counters__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <PAPI_start_counters@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_start_counters__>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_start_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_start_counters__(i32* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_start_counters(i32* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_CIPHER_CTX_cleanup(int /*<<< orphan*/ *);
int /*<<< orphan*/ g_free(int /*<<< orphan*/ *);
void ssl_des3_info_delete(void *des3) {
  EVP_CIPHER_CTX *des3_ctx;
  des3_ctx = (EVP_CIPHER_CTX *)des3;
  if (des3_ctx != 0) {
    EVP_CIPHER_CTX_cleanup(des3_ctx);
    g_free(des3_ctx);
  }
}


x86 assembly (clang, -O0):
<ssl_des3_info_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <ssl_des3_info_delete+0x31>
mov    -0x10(%rbp),%rdi
call   1040 <EVP_CIPHER_CTX_cleanup@plt>
mov    -0x10(%rbp),%rdi
call   1030 <g_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_des3_info_delete>:
test   %rdi,%rdi
je     1137 <ssl_des3_info_delete+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <EVP_CIPHER_CTX_cleanup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <g_free@plt>
ret

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

LLVM IR (-O2):
define void @ssl_des3_info_delete(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @EVP_CIPHER_CTX_cleanup(i32* %2)
%6 = tail call i32 @g_free(i32* %2)
br label %7
7: ; preds = %4, %1
ret void
}