#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ left_trunc(int);
int /*<<< orphan*/ possibly_trunc(int);
scalar_t__ right_trunc(int);
int truncatable_prime(int32_t i) {
  return !(i < 10 || !possibly_trunc(i)) && (right_trunc(i) && left_trunc(i));
}


x86 assembly (clang, -O0):
<truncatable_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1194 <truncatable_prime+0x64>
mov    -0x4(%rbp),%edi
call   1040 <possibly_trunc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
je     1194 <truncatable_prime+0x64>
mov    -0x4(%rbp),%edi
call   1050 <right_trunc@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x6(%rbp)
je     118e <truncatable_prime+0x5e>
mov    -0x4(%rbp),%edi
call   1030 <left_trunc@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncatable_prime>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cmp    $0xa,%edi
jl     1160 <truncatable_prime+0x30>
mov    %edi,%ebp
call   1040 <possibly_trunc@plt>
test   %eax,%eax
je     1160 <truncatable_prime+0x30>
mov    %ebp,%edi
call   1050 <right_trunc@plt>
test   %rax,%rax
je     1160 <truncatable_prime+0x30>
mov    %ebp,%edi
call   1030 <left_trunc@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @truncatable_prime(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call i32 @possibly_trunc(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i64 @right_trunc(i32 %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i64 @left_trunc(i32 %0)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %9, %3, %1
%14 = phi i32 [ 0, %3 ], [ 0, %1 ], [ 0, %6 ], [ %12, %9 ]
ret i32 %14
}