#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 *, int *);
int main() {
  int h, w, i, j;
  while (1) {
    scanf("%d%d\n", &h, &w);
    if (h == 0)
      break;
    for (i = 0; i < h; i++) {
      for (j = 0; j < w; j++)
        printf("#");
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1152 <main+0x32>
jmp    11bd <main+0x9d>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ac <main+0x8c>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1192 <main+0x72>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116c <main+0x4c>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x39>
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     11c5 <main+0xa5>
lea    0xeaf(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%r12
jmp    1180 <main+0x60>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     11c5 <main+0xa5>
test   %eax,%eax
jle    1160 <main+0x40>
xor    %ebp,%ebp
jmp    11a3 <main+0x83>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jge    1160 <main+0x40>
cmpl   $0x0,0xc(%rsp)
jle    1190 <main+0x70>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jl     11b0 <main+0x90>
jmp    1190 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %31, label %8
8: ; preds = %0, %26
%9 = phi i32 [ %29, %26 ], [ %6, %0 ]
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %26
11: ; preds = %8, %21
%12 = phi i32 [ %23, %21 ], [ 0, %8 ]
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %11, %15
%16 = phi i32 [ %18, %15 ], [ 0, %11 ]
%17 = call i32 @putchar(i32 35)
%18 = add nuw nsw i32 %16, 1
%19 = load i32, i32* %2
%20 = icmp slt i32 %18, %19
br i1 %20, label %15, label %21
21: ; preds = %15, %11
%22 = call i32 @putchar(i32 10)
%23 = add nuw nsw i32 %12, 1
%24 = load i32, i32* %1
%25 = icmp slt i32 %23, %24
br i1 %25, label %11, label %26
26: ; preds = %21, %8
%27 = call i32 @putchar(i32 10)
%28 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%29 = load i32, i32* %1
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %8
31: ; preds = %26, %0
ret i32 0
}