#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int init, max, temp, digcnt = 0;
  printf("Enter initial number:");
  scanf("%d", &init);
  printf("Enter max range:");
  scanf("%d", &max);
  if (max < init) {
    init ^= max ^= init ^= max;
  }
  while (init <= max) {
    printf("\n");
    temp = 1;
    while (temp <= max) {
      printf("%*d ", digcnt, temp * init);
      temp++;
    }
    init++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1193 <main+0x73>
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <main+0x78>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11f9 <main+0xd9>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11eb <main+0xcb>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
imul   -0x8(%rbp),%edx
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b9 <main+0x99>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <main+0x78>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xece(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
cmp    %ecx,%eax
jge    1188 <main+0x58>
mov    %ecx,0x4(%rsp)
mov    %eax,(%rsp)
mov    %ecx,%edx
cmp    %edx,%eax
jg     1190 <main+0x60>
jmp    1199 <main+0x69>
mov    %eax,%edx
mov    %ecx,%eax
cmp    %edx,%eax
jle    1199 <main+0x69>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe8a(%rip),%rbx
jmp    11bd <main+0x8d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsp),%ecx
lea    0x1(%rcx),%edx
mov    %edx,(%rsp)
cmp    %eax,%ecx
jge    1190 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11b0 <main+0x80>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    (%rsp),%edx
imul   %ebp,%edx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cmp    %eax,%ebp
jl     11e0 <main+0xb0>
jmp    11b0 <main+0x80>

LLVM IR (-O0):
@.str = [22 x i8] c"Enter initial number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Enter max range:\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [5 x i8] c"%*d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = xor i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %3
%18 = xor i32 %17, %16
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = xor i32 %19, %18
store i32 %20, i32* %2
br label %21
21: ; preds = %13, %0
br label %22
22: ; preds = %40, %21
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = icmp sle i32 %23, %24
br i1 %25, label %26, label %43
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %4
br label %28
28: ; preds = %32, %26
%29 = load i32, i32* %4
%30 = load i32, i32* %3
%31 = icmp sle i32 %29, %30
br i1 %31, label %32, label %40
32: ; preds = %28
%33 = load i32, i32* %5
%34 = load i32, i32* %4
%35 = load i32, i32* %2
%36 = mul nsw i32 %34, %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %33, i32 %36)
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %28
40: ; preds = %28
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %22
43: ; preds = %22
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter initial number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Enter max range:\00"
@.str.4 = [5 x i8] c"%*d \00"
define i32 @main() {
%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 ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 %10, i32* %2
store i32 %9, i32* %1
br label %13
13: ; preds = %12, %0
%14 = phi i32 [ %10, %12 ], [ %9, %0 ]
%15 = phi i32 [ %9, %12 ], [ %10, %0 ]
%16 = icmp sgt i32 %15, %14
br i1 %16, label %34, label %17
17: ; preds = %13, %29
%18 = call i32 @putchar(i32 10)
%19 = load i32, i32* %2
%20 = icmp slt i32 %19, 1
br i1 %20, label %29, label %21
21: ; preds = %17, %21
%22 = phi i32 [ %26, %21 ], [ 1, %17 ]
%23 = load i32, i32* %1
%24 = mul nsw i32 %23, %22
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 0, i32 %24)
%26 = add nuw nsw i32 %22, 1
%27 = load i32, i32* %2
%28 = icmp slt i32 %22, %27
br i1 %28, label %21, label %29
29: ; preds = %21, %17
%30 = phi i32 [ %19, %17 ], [ %27, %21 ]
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
%33 = icmp slt i32 %31, %30
br i1 %33, label %17, label %34
34: ; preds = %29, %13
ret i32 0
}