#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 */

/* Variables and functions */
int /*<<< orphan*/ ft_putnbr(int);
void ft_find_next_prime(int nb) {
  if (nb < 2 || (nb != 2 && (nb % 2 == 0)) || (nb != 3 && (nb % 3 == 0)) ||
      (nb != 5 && (nb % 5 == 0)) || (nb != 7 && (nb % 7 == 0)) ||
      (nb != 9 && (nb % 9 == 0)))
    ft_find_next_prime(nb + 1);
  else
    ft_putnbr(nb);
}


x86 assembly (clang, -O0):
<ft_find_next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jl     11cb <ft_find_next_prime+0xab>
cmpl   $0x2,-0x4(%rbp)
je     1153 <ft_find_next_prime+0x33>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <ft_find_next_prime+0xab>
cmpl   $0x3,-0x4(%rbp)
je     1171 <ft_find_next_prime+0x51>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <ft_find_next_prime+0xab>
cmpl   $0x5,-0x4(%rbp)
je     118f <ft_find_next_prime+0x6f>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <ft_find_next_prime+0xab>
cmpl   $0x7,-0x4(%rbp)
je     11ad <ft_find_next_prime+0x8d>
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <ft_find_next_prime+0xab>
cmpl   $0x9,-0x4(%rbp)
je     11db <ft_find_next_prime+0xbb>
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11db <ft_find_next_prime+0xbb>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <ft_find_next_prime@plt>
jmp    11e3 <ft_find_next_prime+0xc3>
mov    -0x4(%rbp),%edi
call   1030 <ft_putnbr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_find_next_prime>:
mov    $0xaaaaaaab,%eax
mov    $0xcccccccd,%r8d
jmp    1123 <ft_find_next_prime+0x13>
nopl   (%rax)
add    $0x1,%edi
cmp    $0x2,%edi
jl     1120 <ft_find_next_prime+0x10>
je     1131 <ft_find_next_prime+0x21>
mov    %edi,%edx
and    $0x1,%edx
je     1120 <ft_find_next_prime+0x10>
mov    %edi,%edx
cmp    $0x3,%edi
je     114a <ft_find_next_prime+0x3a>
mov    %rdx,%rsi
imul   %rax,%rsi
shr    $0x21,%rsi
lea    (%rsi,%rsi,2),%esi
cmp    %edi,%esi
je     1120 <ft_find_next_prime+0x10>
cmp    $0x5,%edi
je     1161 <ft_find_next_prime+0x51>
mov    %rdx,%rsi
imul   %r8,%rsi
shr    $0x22,%rsi
lea    (%rsi,%rsi,4),%esi
cmp    %edi,%esi
je     1120 <ft_find_next_prime+0x10>
cmp    $0x7,%edi
je     1189 <ft_find_next_prime+0x79>
imul   $0x24924925,%rdx,%rsi
shr    $0x20,%rsi
mov    %edi,%ecx
sub    %esi,%ecx
shr    %ecx
add    %esi,%ecx
shr    $0x2,%ecx
lea    0x0(,%rcx,8),%esi
sub    %ecx,%esi
cmp    %edi,%esi
je     1120 <ft_find_next_prime+0x10>
cmp    $0x9,%edi
je     11a0 <ft_find_next_prime+0x90>
imul   $0x38e38e39,%rdx,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,8),%ecx
cmp    %edi,%ecx
je     1120 <ft_find_next_prime+0x10>
jmp    1030 <ft_putnbr@plt>

LLVM IR (-O0):
define void @ft_find_next_prime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2
br i1 %4, label %40, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %40, label %12
12: ; preds = %8, %5
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %2
%17 = srem i32 %16, 3
%18 = icmp eq i32 %17, 0
br i1 %18, label %40, label %19
19: ; preds = %15, %12
%20 = load i32, i32* %2
%21 = icmp ne i32 %20, 5
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i32, i32* %2
%24 = srem i32 %23, 5
%25 = icmp eq i32 %24, 0
br i1 %25, label %40, label %26
26: ; preds = %22, %19
%27 = load i32, i32* %2
%28 = icmp ne i32 %27, 7
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load i32, i32* %2
%31 = srem i32 %30, 7
%32 = icmp eq i32 %31, 0
br i1 %32, label %40, label %33
33: ; preds = %29, %26
%34 = load i32, i32* %2
%35 = icmp ne i32 %34, 9
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = load i32, i32* %2
%38 = srem i32 %37, 9
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %36, %29, %22, %15, %8, %1
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
br label %46
43: ; preds = %36, %33
%44 = load i32, i32* %2
%45 = call i32 @ft_putnbr(i32 %44)
br label %46
46: ; preds = %43, %40
ret void
}

LLVM IR (-O2):
define void @ft_find_next_prime(i32 %0) {
br label %2
2: ; preds = %30, %1
%3 = phi i32 [ %0, %1 ], [ %31, %30 ]
%4 = icmp slt i32 %3, 2
br i1 %4, label %30, label %5
5: ; preds = %2
%6 = icmp ne i32 %3, 2
%7 = and i32 %3, 1
%8 = icmp eq i32 %7, 0
%9 = and i1 %6, %8
br i1 %9, label %30, label %10
10: ; preds = %5
%11 = icmp ne i32 %3, 3
%12 = urem i32 %3, 3
%13 = icmp eq i32 %12, 0
%14 = and i1 %11, %13
br i1 %14, label %30, label %15
15: ; preds = %10
%16 = icmp ne i32 %3, 5
%17 = urem i32 %3, 5
%18 = icmp eq i32 %17, 0
%19 = and i1 %16, %18
br i1 %19, label %30, label %20
20: ; preds = %15
%21 = icmp ne i32 %3, 7
%22 = urem i32 %3, 7
%23 = icmp eq i32 %22, 0
%24 = and i1 %21, %23
br i1 %24, label %30, label %25
25: ; preds = %20
%26 = icmp ne i32 %3, 9
%27 = urem i32 %3, 9
%28 = icmp eq i32 %27, 0
%29 = and i1 %26, %28
br i1 %29, label %30, label %32
30: ; preds = %25, %20, %15, %10, %5, %2
%31 = add nsw i32 %3, 1
br label %2
32: ; preds = %25
%33 = tail call i32 @ft_putnbr(i32 %3)
ret void
}