#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 */
double logbase(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int x = 0;
  printf("Enter a number:: ");
  scanf("%d", &x);
  printf("%.4f\n", logbase(x, 10));
  printf("Continue:: (Y/N) ");
  scanf("%s", &x);
  if ((x == 'y') || (x == 'Y'))
    return main();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    $0xa,%esi
call   1030 <logbase@plt>
lea    0xe8d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe89(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x79,-0x8(%rbp)
je     11c1 <main+0x81>
cmpl   $0x59,-0x8(%rbp)
jne    11ce <main+0x8e>
call   1050 <main@plt>
mov    %eax,-0x4(%rbp)
jmp    11d5 <main+0x95>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
mov    $0xa,%esi
call   1030 <logbase@plt>
lea    0xe91(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
and    $0xffffffdf,%eax
cmp    $0x59,%eax
jne    11b9 <main+0x79>
call   1050 <main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a number:: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"%.4f\0A\00"
@.str.3 = [18 x i8] c"Continue:: (Y/N) \00"
@.str.4 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 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)
%5 = load i32, i32* %2
%6 = call double @logbase(i32 %5, i32 10)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 121
br i1 %11, label %15, label %12
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 89
br i1 %14, label %15, label %17
15: ; preds = %12, %0
%16 = call i32 @main()
store i32 %16, i32* %1
br label %18
17: ; preds = %12
store i32 0, i32* %1
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter a number:: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"%.4f\0A\00"
@.str.3 = [18 x i8] c"Continue:: (Y/N) \00"
@.str.4 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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)
%5 = load i32, i32* %1
%6 = call double @logbase(i32 %5, i32 10)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = and i32 %10, -33
%12 = icmp eq i32 %11, 89
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @main()
br label %15
15: ; preds = %0, %13
ret i32 0
}