#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 min_divisible_by(int);
int /*<<< orphan*/ printf(char *, ...);
void min_base(int x) {
  if (x == 3)
    printf("4\n");
  else if (x < 7)
    printf("No such base\n");
  else
    printf("%d\n", min_divisible_by(x - 3));
}


x86 assembly (clang, -O0):
<min_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1148 <min_base+0x28>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1185 <min_base+0x65>
cmpl   $0x7,-0x4(%rbp)
jge    1165 <min_base+0x45>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1180 <min_base+0x60>
mov    -0x4(%rbp),%edi
sub    $0x3,%edi
call   1040 <min_divisible_by@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1185 <min_base+0x65>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_base>:
cmp    $0x3,%edi
jne    1141 <min_base+0x11>
lea    0xed5(%rip),%rdi
jmp    1030 <puts@plt>
cmp    $0x6,%edi
jg     1152 <min_base+0x22>
lea    0xeb7(%rip),%rdi
jmp    1030 <puts@plt>
push   %rax
add    $0xfffffffd,%edi
call   1050 <min_divisible_by@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"4\0A\00"
@.str.1 = [14 x i8] c"No such base\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define void @min_base(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %18
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %17
12: ; preds = %7
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 3
%15 = call i32 @min_divisible_by(i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %12, %10
br label %18
18: ; preds = %17, %5
ret void
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [13 x i8] c"No such base\00"
@str.3 = [2 x i8] c"4\00"
define void @min_base(i32 %0) {
%2 = icmp eq i32 %0, 3
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
br label %13
5: ; preds = %1
%6 = icmp slt i32 %0, 7
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %13
9: ; preds = %5
%10 = add nsw i32 %0, -3
%11 = tail call i32 @min_divisible_by(i32 %10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %7, %9, %3
ret void
}