xunge/DecIR huggingface dataset:
void avio_rb24() {}


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

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

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

LLVM IR (-O2):
define void @avio_rb24() {
ret void
}
int test_imm_60uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x60 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_60uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 412316860416
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void reset_frame_skip(void) {}


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

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

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

LLVM IR (-O2):
define void @reset_frame_skip() {
ret void
}
unsigned xrop3_62_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~S;
  stk3 = D & stk4;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_62_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_62_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xff,%edi
or     %edi,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_62_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %24, -1
store i32 %25, i32* %11
%26 = load i32, i32* %5
%27 = load i32, i32* %11
%28 = and i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %7
%30 = load i32, i32* %10
%31 = or i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_62_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %3, 255
%8 = or i32 %6, %7
%9 = xor i32 %8, %4
ret i32 %9
}
char safechar(char c) { return (c < ' ') ? '.' : c; }


x86 assembly (clang, -O0):
<safechar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jge    1124 <safechar+0x24>
mov    $0x2e,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <safechar+0x2b>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<safechar>:
cmp    $0x20,%dil
mov    $0x2e,%eax
cmovge %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @safechar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ 46, %6 ], [ %9, %7 ]
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @safechar(i8 signext %0) {
%2 = icmp slt i8 %0, 32
%3 = select i1 %2, i8 46, i8 %0
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ z_stream;

/* Variables and functions */
int inflateSetDictionary(int /*<<< orphan*/ *, char const *, unsigned int);
int streaming_commons_inflate_set_dictionary(z_stream *stream,
                                             const char *dictionary,
                                             unsigned int dictLength) {
  return inflateSetDictionary(stream, dictionary, dictLength);
}


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

x86 assembly (clang, -O2):
<streaming_commons_inflate_set_dictionary>:
jmp    1030 <inflateSetDictionary@plt>

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

LLVM IR (-O2):
define i32 @streaming_commons_inflate_set_dictionary(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @inflateSetDictionary(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef union fc_sockaddr {
  int dummy;
} fc_sockaddr;
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_get(struct genlist const *, int);
union fc_sockaddr *fc_sockaddr_list_get(const struct fc_sockaddr_list *tthis,
                                        int index) {
  return (
      (union fc_sockaddr *)genlist_get((const struct genlist *)tthis, index));
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_get>:
jmp    1030 <genlist_get@plt>

LLVM IR (-O0):
%union.fc_sockaddr = type { i32 }
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define %union.fc_sockaddr* @fc_sockaddr_list_get(%struct.fc_sockaddr_list* %0, i32 %1) {
%3 = alloca %struct.fc_sockaddr_list*
%4 = alloca i32
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %3
store i32 %1, i32* %4
%5 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %3
%6 = bitcast %struct.fc_sockaddr_list* %5 to %struct.genlist*
%7 = load i32, i32* %4
%8 = call i64 @genlist_get(%struct.genlist* %6, i32 %7)
%9 = inttoptr i64 %8 to %union.fc_sockaddr*
ret %union.fc_sockaddr* %9
}

LLVM IR (-O2):
%union.fc_sockaddr = type { i32 }
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define %union.fc_sockaddr* @fc_sockaddr_list_get(%struct.fc_sockaddr_list* %0, i32 %1) {
%3 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%4 = tail call i64 @genlist_get(%struct.genlist* %3, i32 %1)
%5 = inttoptr i64 %4 to %union.fc_sockaddr*
ret %union.fc_sockaddr* %5
}
int test_imm_05uint16_mem(unsigned short *val) {
  return ((*val) & (-0x05 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_05uint16_mem>:
movzwl (%rdi),%eax
test   $0xfffb,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_05uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -5
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef long uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_binary(uint64_t long_num) {
  long a = long_num;
  while (a) {
    if (a & 1)
      printf("1");
    else
      printf("0");
    a >>= 1;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_binary>:
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     116f <print_binary+0x5f>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1152 <print_binary+0x42>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    115e <print_binary+0x4e>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <print_binary+0x14>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_binary>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     113a <print_binary+0x2a>
mov    %rdi,%r14
mov    %rdi,%rbx
nop
mov    %r14d,%edi
and    $0x1,%edi
or     $0x30,%edi
call   1030 <putchar@plt>
sar    %rbx
cmp    $0x1,%r14
mov    %rbx,%r14
ja     1120 <print_binary+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_binary(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %9, %3 ], [ %0, %1 ]
%5 = and i64 %4, 1
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 48, i32 49
%8 = tail call i32 @putchar(i32 %7)
%9 = ashr i64 %4, 1
%10 = icmp ult i64 %4, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct snd_mask {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ snd_mask_leave(struct snd_mask *, int /*<<< orphan*/);
int /*<<< orphan*/ snd_mask_min(struct snd_mask *);
scalar_t__ snd_mask_single(struct snd_mask *);
int snd_mask_refine_first(struct snd_mask *mask) {
  if (snd_mask_single(mask))
    return 0;
  snd_mask_leave(mask, snd_mask_min(mask));
  return 1;
}


x86 assembly (clang, -O0):
<snd_mask_refine_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <snd_mask_single@plt>
cmp    $0x0,%rax
je     115b <snd_mask_refine_first+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    117e <snd_mask_refine_first+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <snd_mask_min@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <snd_mask_leave@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_mask_refine_first>:
push   %rbx
mov    %rdi,%rbx
call   1050 <snd_mask_single@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1145 <snd_mask_refine_first+0x15>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <snd_mask_min@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <snd_mask_leave@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.snd_mask = type { i32 }
define i32 @snd_mask_refine_first(%struct.snd_mask* %0) {
%2 = alloca i32
%3 = alloca %struct.snd_mask*
store %struct.snd_mask* %0, %struct.snd_mask** %3
%4 = load %struct.snd_mask*, %struct.snd_mask** %3
%5 = call i64 @snd_mask_single(%struct.snd_mask* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %13
8: ; preds = %1
%9 = load %struct.snd_mask*, %struct.snd_mask** %3
%10 = load %struct.snd_mask*, %struct.snd_mask** %3
%11 = call i32 @snd_mask_min(%struct.snd_mask* %10)
%12 = call i32 @snd_mask_leave(%struct.snd_mask* %9, i32 %11)
store i32 1, i32* %2
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.snd_mask = type { i32 }
define i32 @snd_mask_refine_first(%struct.snd_mask* %0) {
%2 = tail call i64 @snd_mask_single(%struct.snd_mask* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @snd_mask_min(%struct.snd_mask* %0)
%6 = tail call i32 @snd_mask_leave(%struct.snd_mask* %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %8
}
int test_imm_E8uint8_mem(unsigned char *val) {
  return ((*val) & (0xE8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E8uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -24
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EulerTotient_ProductForm(long long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long long *);
int main() {
  long long num;
  printf("Enter the number: \n");
  scanf("%lld", &num);
  printf("Euler totient function value is: %lld",
         EulerTotient_ProductForm(num));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
call   1060 <EulerTotient_ProductForm@plt>
lea    0xe94(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter the number: \0A\00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [38 x i8] c"Euler totient function value is: %lld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = call i32 @EulerTotient_ProductForm(i64 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [38 x i8] c"Euler totient function value is: %lld\00"
@str = [19 x i8] c"Enter the number: \00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @EulerTotient_ProductForm(i64 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
double tanf(double);
double tan(double arg) { return tanf(arg); }


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

x86 assembly (clang, -O2):
<tan>:
jmp    1030 <tanf@plt>

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

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double @tanf(double %0)
ret double %2
}
const char *get_ucpname(int ptype, int pvalue) {
  ptype = ptype * pvalue;
  return (ptype == pvalue) ? "??" : "??";
}


x86 assembly (clang, -O0):
<get_ucpname>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
lea    0xedf(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ucpname>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"??\00"
define i8* @get_ucpname(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 = mul nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp eq i32 %8, %9
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
ret i8* %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"??\00"
define i8* @get_ucpname(i32 %0, i32 %1) {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
extern int ast_tveq(struct timeval _a, struct timeval _b) {
  return (_a.tv_sec == _b.tv_sec && _a.tv_usec == _b.tv_usec);
}


x86 assembly (clang, -O0):
<ast_tveq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x20(%rbp),%rcx
mov    %al,-0x21(%rbp)
jne    1135 <ast_tveq+0x35>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ast_tveq>:
xor    %rdx,%rdi
xor    %rcx,%rsi
xor    %eax,%eax
or     %rdi,%rsi
sete   %al
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @ast_tveq(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %5 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timeval* %6 to { i64, i64 }*
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 0
store i64 %2, i64* %11
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%16 = load i64, i64* %15
%17 = icmp eq i64 %14, %16
br i1 %17, label %18, label %24
18: ; preds = %4
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%22 = load i64, i64* %21
%23 = icmp eq i64 %20, %22
br label %24
24: ; preds = %18, %4
%25 = phi i1 [ false, %4 ], [ %23, %18 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @ast_tveq(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %0, %2
%6 = icmp eq i64 %1, %3
%7 = select i1 %5, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
void xen_smp_intr_free(unsigned int cpu) {}


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

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

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

LLVM IR (-O2):
define void @xen_smp_intr_free(i32 %0) {
ret void
}
void ARGBAttenuateRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBAttenuateRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void bar() { strcpy(NULL, NULL); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <strcpy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @strcpy(i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @strcpy(i32* null, i32* null)
ret void
}
int ti_willr_start(double const *options) { return (int)options[0] - 1; }


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

x86 assembly (clang, -O2):
<ti_willr_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_willr_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_willr_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("Hello World\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ createPathIfNotExists(char **);
int /*<<< orphan*/ getCacheApp(char **, char *);
void getCachePath(char **path, char *app_name) {
  getCacheApp(path, app_name);
  if (*path) {
    createPathIfNotExists(path);
  }
}


x86 assembly (clang, -O0):
<getCachePath>:
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   1040 <getCacheApp@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1154 <getCachePath+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <createPathIfNotExists@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCachePath>:
push   %rbx
mov    %rdi,%rbx
call   1040 <getCacheApp@plt>
cmpq   $0x0,(%rbx)
je     1138 <getCachePath+0x18>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <createPathIfNotExists@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @getCachePath(i8** %0, i8* %1) {
%3 = tail call i32 @getCacheApp(i8** %0, i8* %1)
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @createPathIfNotExists(i8** %0)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
double one();
double zero();
double inf(void) { return one() / zero(); }


x86 assembly (clang, -O0):
<inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <one@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <zero@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inf>:
push   %rax
xor    %eax,%eax
call   1040 <one@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <zero@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @inf() {
%1 = call double (...) @one()
%2 = call double (...) @zero()
%3 = fdiv double %1, %2
ret double %3
}

LLVM IR (-O2):
define double @inf() {
%1 = tail call double (...) @one()
%2 = tail call double (...) @zero()
%3 = fdiv double %1, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
char *strncat(char *, char const *, int /*<<< orphan*/);
char *strcat(char *dest, const char *src) {
  return strncat(dest, src, strlen(src));
}


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

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncat@plt>

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

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @strncat(i8* %0, i8* %1, i32 %3)
ret i8* %4
}
int __intlog2(int a) {
  int i;
  for (i = 1; a > 1; i++, a = a >> 1)
    ;
  return i - 1;
}


x86 assembly (clang, -O0):
<__intlog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1134 <__intlog2+0x34>
jmp    111d <__intlog2+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <__intlog2+0xe>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__intlog2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <__intlog2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <__intlog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @__intlog2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %4, %3 ]
ret i32 %10
}
int test_imm_3Cuint32_reg(unsigned int val) {
  return ((val) & (0x3C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Cuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x3c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_3Cuint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 60
%5 = icmp ne i32 %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_3Cuint32_reg(i32 %0) {
%2 = and i32 %0, 60
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int BMPSizeHelper(int height, int rowsize) {
  return height * ((rowsize + 3) & ~3);
}


x86 assembly (clang, -O0):
<BMPSizeHelper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x3,%ecx
and    $0xfffffffc,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMPSizeHelper>:
lea    0x3(%rsi),%eax
and    $0xfffffffc,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @BMPSizeHelper(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 = add nsw i32 %6, 3
%8 = and i32 %7, -4
%9 = mul nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @BMPSizeHelper(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 3
%4 = and i32 %3, -4
%5 = mul nsw i32 %4, %0
ret i32 %5
}
__attribute__((no, noclone)) void f4(struct A *x, char *y, struct A *z) {
  asm volatile("" : : "g"(x), "g"(z), "g"(y) : "memory");
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %rdx,-0x10(%rsp)
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x18(%rsp)
ret

LLVM IR (-O0):
%struct.A = type opaque
define void @f4(%struct.A* %0, i8* %1, %struct.A* %2) {
%4 = alloca %struct.A*
%5 = alloca i8*
%6 = alloca %struct.A*
store %struct.A* %0, %struct.A** %4
store i8* %1, i8** %5
store %struct.A* %2, %struct.A** %6
%7 = load %struct.A*, %struct.A** %4
%8 = load %struct.A*, %struct.A** %6
%9 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
%struct.A = type opaque
define void @f4(%struct.A* %0, i8* %1, %struct.A* %2) {
tail call void asm sideeffect "", "imr,imr,imr,~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.A* %0, %struct.A* %2, i8* %1)
ret void
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  unsigned long long tv_nsec;
};

/* Variables and functions */
unsigned long long ts_to_nsec(struct timespec ts) {
  return ts.tv_sec * 1000000000LL + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<ts_to_nsec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_to_nsec>:
imul   $0x3b9aca00,%rdi,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @ts_to_nsec(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @ts_to_nsec(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 1000000000
%4 = add i64 %3, %1
ret i64 %4
}
int execute_alloc_hugepages() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_alloc_hugepages() {
ret i32 0
}
/* Variables and functions */
char *str(int);
int /*<<< orphan*/ strerror_r(int, char *, int);
const char *perr_arg(int err) {
  char *st = str(100);
  strerror_r(err, st, 100);
  return st;
}


x86 assembly (clang, -O0):
<perr_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <str@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x64,%edx
call   1030 <strerror_r@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perr_arg>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x64,%edi
call   1040 <str@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
mov    $0x64,%edx
call   1030 <strerror_r@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @perr_arg(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @str(i32 100)
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = load i8*, i8** %3
%7 = call i32 @strerror_r(i32 %5, i8* %6, i32 100)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @perr_arg(i32 %0) {
%2 = tail call i8* @str(i32 100)
%3 = tail call i32 @strerror_r(i32 %0, i8* %2, i32 100)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ init_screen();
int /*<<< orphan*/ puts(char *);
int main() {
  init_screen();
  puts("Hello World");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <init_screen@plt>
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
jmp    1142 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_screen@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_screen()
%3 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %4, %0
br label %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 (...) @init_screen()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
br label %3
}
/* Variables and functions */
double calc_linear_factor(double, double);
double sqrt(double);
double calc_sphere_increasing_factor(double middle, double z) {
  z = calc_linear_factor(middle, z) - 1.0;
  return sqrt(1.0 - z * z);
}


x86 assembly (clang, -O0):
<calc_sphere_increasing_factor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <calc_linear_factor@plt>
movsd  0xeb7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe81(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_sphere_increasing_factor>:
push   %rax
call   1040 <calc_linear_factor@plt>
movapd %xmm0,%xmm1
addsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm1
movsd  0xeca(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1152 <calc_sphere_increasing_factor+0x32>
sqrtsd %xmm0,%xmm0
pop    %rax
ret
pop    %rax
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @calc_sphere_increasing_factor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @calc_linear_factor(double %5, double %6)
%8 = fsub double %7, 1.000000e+00
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fneg double %9
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double 1.000000e+00)
%13 = call double @sqrt(double %12)
ret double %13
}

LLVM IR (-O2):
define double @calc_sphere_increasing_factor(double %0, double %1) {
%3 = tail call double @calc_linear_factor(double %0, double %1)
%4 = fadd double %3, -1.000000e+00
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = tail call double @sqrt(double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ i2c_print_status(int /*<<< orphan*/);
int /*<<< orphan*/ mmio_read(void *, int);
void i2c_show_status(void *base) { i2c_print_status(mmio_read(base, 0x60d8)); }


x86 assembly (clang, -O0):
<i2c_show_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x60d8,%esi
call   1030 <mmio_read@plt>
mov    %eax,%edi
call   1040 <i2c_print_status@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_show_status>:
push   %rax
mov    $0x60d8,%esi
call   1030 <mmio_read@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <i2c_print_status@plt>

LLVM IR (-O0):
define void @i2c_show_status(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mmio_read(i8* %3, i32 24792)
%5 = call i32 @i2c_print_status(i32 %4)
ret void
}

LLVM IR (-O2):
define void @i2c_show_status(i8* %0) {
%2 = tail call i32 @mmio_read(i8* %0, i32 24792)
%3 = tail call i32 @i2c_print_status(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void mov_m16_reg16(unsigned short *m16, int reg16) {
  put8(0x66);
  put8(0x89);
  put8((reg16 << 3) | 5);
  put32((unsigned int)(m16));
}


x86 assembly (clang, -O0):
<mov_m16_reg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x89,%edi
call   1030 <put8@plt>
mov    -0xc(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_m16_reg16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x89,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_m16_reg16(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 102)
%6 = call i32 @put8(i32 137)
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
%9 = or i32 %8, 5
%10 = call i32 @put8(i32 %9)
%11 = load i16*, i16** %3
%12 = ptrtoint i16* %11 to i32
%13 = call i32 @put32(i32 %12)
ret void
}

LLVM IR (-O2):
define void @mov_m16_reg16(i16* %0, i32 %1) {
%3 = tail call i32 @put8(i32 102)
%4 = tail call i32 @put8(i32 137)
%5 = shl i32 %1, 3
%6 = or i32 %5, 5
%7 = tail call i32 @put8(i32 %6)
%8 = ptrtoint i16* %0 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @put32(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int inotify_init(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<inotify_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotify_init>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @inotify_init() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @inotify_init() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
char *strstr(char *, char const *);
char *str_rstr(char *haystack, const char *needle) {
  if (*haystack) {
    char *p, *q;
    for (q = NULL; (p = strstr(haystack, needle)); q = p, haystack = p + 1)
      ;
    return q;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<str_rstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117b <str_rstr+0x6b>
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     116e <str_rstr+0x5e>
jmp    1155 <str_rstr+0x45>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1135 <str_rstr+0x25>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1183 <str_rstr+0x73>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_rstr>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1136 <str_rstr+0x26>
mov    %rsi,%r14
xor    %eax,%eax
xchg   %ax,%ax
mov    %rax,%rbx
mov    %r14,%rsi
call   1030 <strstr@plt>
lea    0x1(%rax),%rdi
test   %rax,%rax
jne    1120 <str_rstr+0x10>
jmp    1138 <str_rstr+0x28>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @str_rstr(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %0, %2 ]
%7 = phi i8* [ %8, %5 ], [ null, %2 ]
%8 = tail call i8* @strstr(i8* %6, i8* dereferenceable(1) %1)
%9 = icmp eq i8* %8, null
%10 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %9, label %11, label %5
11: ; preds = %5, %2
%12 = phi i8* [ null, %2 ], [ %7, %5 ]
ret i8* %12
}
void free_imatrix(int **m, int num_row) {
  int i;
  for (i = num_row - 1; i >= 0; i--)
    free(m[i]);
  free(m);
}


x86 assembly (clang, -O0):
<free_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1151 <free_imatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <free_imatrix+0x18>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_imatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1146 <free_imatrix+0x36>
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <free_imatrix+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_imatrix(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i32*, i32** %0, i64 %9
%11 = bitcast i32** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = bitcast i32** %0 to i8*
tail call void @free(i8* %15)
ret void
}