#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*/ fflush(int /*<<< orphan*/);
int printOddNumb();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int rows, number = 1;
  printf("Enter number of rows: ");
  fflush(stdout);
  scanf("%d", &rows);
  for (int i = 1; i <= rows; i++) {
    for (int j = 1; j <= i; j++) {
      printf("%d ", printOddNumb());
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe97(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11f0 <main+0xb0>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11d4 <main+0x94>
mov    $0x0,%al
call   1050 <printOddNumb@plt>
mov    %eax,%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11a3 <main+0x63>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1190 <main+0x50>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe9c(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11e0 <main+0x90>
mov    $0x1,%r14d
lea    0xe81(%rip),%rbx
nopl   0x0(%rax)
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1060 <printOddNumb@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%eax
cmp    0xc(%rsp),%r14d
mov    %eax,%r14d
jl     11a0 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter number of rows: \00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
store i32 1, i32* %8
br label %14
14: ; preds = %31, %2
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %34
18: ; preds = %14
store i32 1, i32* %9
br label %19
19: ; preds = %26, %18
%20 = load i32, i32* %9
%21 = load i32, i32* %8
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %29
23: ; preds = %19
%24 = call i32 (...) @printOddNumb()
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %23
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 1
store i32 %28, i32* %9
br label %19
29: ; preds = %19
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %14
34: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter number of rows: \00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %2, %15
%12 = phi i32 [ %20, %15 ], [ 2, %2 ]
%13 = phi i32 [ %17, %15 ], [ 1, %2 ]
br label %21
14: ; preds = %15, %2
ret i32 0
15: ; preds = %21
%16 = call i32 @putchar(i32 10)
%17 = add nuw nsw i32 %13, 1
%18 = load i32, i32* %3
%19 = icmp slt i32 %13, %18
%20 = add nuw i32 %12, 1
br i1 %19, label %11, label %14
21: ; preds = %11, %21
%22 = phi i32 [ 1, %11 ], [ %25, %21 ]
%23 = call i32 (...) @printOddNumb()
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = add nuw i32 %22, 1
%26 = icmp eq i32 %25, %12
br i1 %26, label %15, label %21
}