#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*/ getchar();
int log10(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
void one() {
  int number, length, i;
  printf("enter number (int), length (int) of table: ");
  scanf("%d%d", &number, &length);
  printf("\ngenerated table of %d of length %d:\n\n", number, length);
  for (i = 1; i <= length; ++i)
    printf("%d * %*d = %*d\n", number,
           log10(length) > 0 ? (int)(1 + log10(length))
                             : (int)(1 - log10(length)),
           i,
           log10(length * number) > 0 ? (int)(1 + log10(length * number))
                                      : (int)(1 - log10(length * number)),
           (number * i));
  getchar();
  printf("\nreturning to menu. press Enter...");
  getchar();
}


x86 assembly (clang, -O0):
<one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1251 <one+0x111>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <log10@plt>
cmp    $0x0,%eax
jle    11bb <one+0x7b>
mov    -0x8(%rbp),%edi
call   1060 <log10@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cf <one+0x8f>
mov    -0x8(%rbp),%edi
call   1060 <log10@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
imul   -0x4(%rbp),%edi
call   1060 <log10@plt>
cmp    $0x0,%eax
jle    1207 <one+0xc7>
mov    -0x8(%rbp),%edi
imul   -0x4(%rbp),%edi
call   1060 <log10@plt>
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    121f <one+0xdf>
mov    -0x8(%rbp),%edi
imul   -0x4(%rbp),%edi
call   1060 <log10@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%esi
mov    -0x20(%rbp),%r8d
mov    -0x4(%rbp),%r9d
imul   -0xc(%rbp),%r9d
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1185 <one+0x45>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edi
test   %edi,%edi
jle    1218 <one+0xd8>
lea    0xebf(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    0xc(%rsp),%r15d
call   1060 <log10@plt>
mov    %eax,%r12d
mov    0x8(%rsp),%edi
call   1060 <log10@plt>
mov    %eax,%ebx
neg    %ebx
test   %r12d,%r12d
cmovg  %eax,%ebx
add    $0x1,%ebx
mov    0xc(%rsp),%edi
imul   0x8(%rsp),%edi
call   1060 <log10@plt>
mov    %eax,%r12d
mov    0xc(%rsp),%edi
imul   0x8(%rsp),%edi
call   1060 <log10@plt>
mov    %eax,%r8d
neg    %r8d
test   %r12d,%r12d
cmovg  %eax,%r8d
add    $0x1,%r8d
mov    0xc(%rsp),%r9d
imul   %ebp,%r9d
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edi
cmp    %edi,%ebp
jl     11a0 <one+0x60>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xe42(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [44 x i8] c"enter number (int), length (int) of table: \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [39 x i8] c"\0Agenerated table of %d of length %d:\0A\0A\00"
@.str.3 = [16 x i8] c"%d * %*d = %*d\0A\00"
@.str.4 = [35 x i8] c"\0Areturning to menu. press Enter...\00"
define void @one() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7)
store i32 1, i32* %3
br label %9
9: ; preds = %52, %0
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %55
13: ; preds = %9
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @log10(i32 %15)
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i32, i32* %2
%20 = call i32 @log10(i32 %19)
%21 = add nsw i32 1, %20
br label %26
22: ; preds = %13
%23 = load i32, i32* %2
%24 = call i32 @log10(i32 %23)
%25 = sub nsw i32 1, %24
br label %26
26: ; preds = %22, %18
%27 = phi i32 [ %21, %18 ], [ %25, %22 ]
%28 = load i32, i32* %3
%29 = load i32, i32* %2
%30 = load i32, i32* %1
%31 = mul nsw i32 %29, %30
%32 = call i32 @log10(i32 %31)
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %26
%35 = load i32, i32* %2
%36 = load i32, i32* %1
%37 = mul nsw i32 %35, %36
%38 = call i32 @log10(i32 %37)
%39 = add nsw i32 1, %38
br label %46
40: ; preds = %26
%41 = load i32, i32* %2
%42 = load i32, i32* %1
%43 = mul nsw i32 %41, %42
%44 = call i32 @log10(i32 %43)
%45 = sub nsw i32 1, %44
br label %46
46: ; preds = %40, %34
%47 = phi i32 [ %39, %34 ], [ %45, %40 ]
%48 = load i32, i32* %1
%49 = load i32, i32* %3
%50 = mul nsw i32 %48, %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %27, i32 %28, i32 %47, i32 %50)
br label %52
52: ; preds = %46
%53 = load i32, i32* %3
%54 = add nsw i32 %53, 1
store i32 %54, i32* %3
br label %9
55: ; preds = %9
%56 = call i32 (...) @getchar()
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%58 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"enter number (int), length (int) of table: \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [39 x i8] c"\0Agenerated table of %d of length %d:\0A\0A\00"
@.str.3 = [16 x i8] c"%d * %*d = %*d\0A\00"
@.str.4 = [35 x i8] c"\0Areturning to menu. press Enter...\00"
define void @one() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 1
br i1 %11, label %41, label %12
12: ; preds = %0, %12
%13 = phi i32 [ %39, %12 ], [ %10, %0 ]
%14 = phi i32 [ %38, %12 ], [ 1, %0 ]
%15 = load i32, i32* %1
%16 = call i32 @log10(i32 %13)
%17 = icmp sgt i32 %16, 0
%18 = load i32, i32* %2
%19 = call i32 @log10(i32 %18)
%20 = sub i32 0, %19
%21 = select i1 %17, i32 %19, i32 %20
%22 = add i32 %21, 1
%23 = load i32, i32* %2
%24 = load i32, i32* %1
%25 = mul nsw i32 %24, %23
%26 = call i32 @log10(i32 %25)
%27 = icmp sgt i32 %26, 0
%28 = load i32, i32* %2
%29 = load i32, i32* %1
%30 = mul nsw i32 %29, %28
%31 = call i32 @log10(i32 %30)
%32 = sub i32 0, %31
%33 = select i1 %27, i32 %31, i32 %32
%34 = add i32 %33, 1
%35 = load i32, i32* %1
%36 = mul nsw i32 %35, %14
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %22, i32 %14, i32 %34, i32 %36)
%38 = add nuw nsw i32 %14, 1
%39 = load i32, i32* %2
%40 = icmp slt i32 %14, %39
br i1 %40, label %12, label %41
41: ; preds = %12, %0
%42 = call i32 (...) @getchar()
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%44 = call i32 (...) @getchar()
ret void
}