#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 */
scalar_t__ jud(int *, int, int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, int *);
int main() {
  int n, i, ans[10], s, t = 0;
  while (scanf("%d", &n), n) {
    if (t++)
      printf("\n");
    for (i = 1234, s = 0; i <= 98765; ++i) {
      if (!(i % n)) {
        memset(ans, 0, sizeof(int) * 10);
        if (jud(ans, i, i / n)) {
          printf("%.5d / %.5d = %d\n", i, i / n, n);
          ++s;
        }
      }
    }
    if (!s)
      printf("There are no solutions for %d.\n", n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x48(%rbp)
lea    0xea3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     124a <main+0x10a>
mov    -0x48(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x48(%rbp)
cmp    $0x0,%eax
je     1192 <main+0x52>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x4d2,-0xc(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x181cd,-0xc(%rbp)
jg     122a <main+0xea>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1217 <main+0xd7>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edx
call   1060 <jud@plt>
cmp    $0x0,%rax
je     1212 <main+0xd2>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edx
mov    -0x8(%rbp),%ecx
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1217 <main+0xd7>
jmp    121c <main+0xdc>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a0 <main+0x60>
cmpl   $0x0,-0x44(%rbp)
jne    1245 <main+0x105>
mov    -0x8(%rbp),%esi
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1156 <main+0x16>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xe9b(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
je     1247 <main+0xf7>
lea    0x10(%rsp),%rbx
lea    0xe7d(%rip),%r14
lea    0xc(%rsp),%r13
xor    %r15d,%r15d
jmp    11b3 <main+0x63>
test   %r12d,%r12d
je     1230 <main+0xe0>
lea    0xe60(%rip),%rdi
mov    %r13,%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
je     1247 <main+0xf7>
test   %r15d,%r15d
je     11c2 <main+0x72>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
mov    $0x4d2,%ebp
xor    %r12d,%r12d
jmp    11db <main+0x8b>
add    $0x1,%ebp
cmp    $0x181ce,%ebp
je     1190 <main+0x40>
mov    %ebp,%eax
cltd
idivl  0xc(%rsp)
test   %edx,%edx
jne    11d0 <main+0x80>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
mov    %ebp,%eax
cltd
idivl  0xc(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1070 <jud@plt>
test   %rax,%rax
je     11d0 <main+0x80>
mov    0xc(%rsp),%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r12d
jmp    11d0 <main+0x80>
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
lea    0xdda(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1199 <main+0x49>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [18 x i8] c"%.5d / %.5d = %d\0A\00"
@.str.3 = [32 x i8] c"There are no solutions for %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
br label %7
7: ; preds = %56, %0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %57
11: ; preds = %7
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
store i32 %13, i32* %6
%14 = icmp ne i32 %12, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %11
store i32 1234, i32* %3
store i32 0, i32* %5
br label %18
18: ; preds = %47, %17
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 98765
br i1 %20, label %21, label %50
21: ; preds = %18
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = srem i32 %22, %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %46, label %26
26: ; preds = %21
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%28 = call i32 @memset(i32* %27, i32 0, i32 40)
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%30 = load i32, i32* %3
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = sdiv i32 %31, %32
%34 = call i64 @jud(i32* %29, i32 %30, i32 %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %45
36: ; preds = %26
%37 = load i32, i32* %3
%38 = load i32, i32* %3
%39 = load i32, i32* %2
%40 = sdiv i32 %38, %39
%41 = load i32, i32* %2
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %37, i32 %40, i32 %41)
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 1
store i32 %44, i32* %5
br label %45
45: ; preds = %36, %26
br label %46
46: ; preds = %45, %21
br label %47
47: ; preds = %46
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %18
50: ; preds = %18
%51 = load i32, i32* %5
%52 = icmp ne i32 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = load i32, i32* %2
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %53, %50
br label %7
57: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"%.5d / %.5d = %d\0A\00"
@.str.3 = [32 x i8] c"There are no solutions for %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %47, label %8
8: ; preds = %0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
br label %10
10: ; preds = %8, %43
%11 = phi i32 [ 0, %8 ], [ %12, %43 ]
%12 = add nuw nsw i32 %11, 1
%13 = icmp eq i32 %11, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 @putchar(i32 10)
br label %16
16: ; preds = %14, %10
br label %17
17: ; preds = %16, %34
%18 = phi i32 [ %35, %34 ], [ 0, %16 ]
%19 = phi i32 [ %36, %34 ], [ 1234, %16 ]
%20 = load i32, i32* %1
%21 = srem i32 %19, %20
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %34
23: ; preds = %17
%24 = call i32 @memset(i32* %9, i32 0, i32 40)
%25 = load i32, i32* %1
%26 = sdiv i32 %19, %25
%27 = call i64 @jud(i32* %9, i32 %19, i32 %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %34, label %29
29: ; preds = %23
%30 = load i32, i32* %1
%31 = sdiv i32 %19, %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %31, i32 %30)
%33 = add nsw i32 %18, 1
br label %34
34: ; preds = %17, %29, %23
%35 = phi i32 [ %18, %17 ], [ %33, %29 ], [ %18, %23 ]
%36 = add nuw nsw i32 %19, 1
%37 = icmp eq i32 %36, 98766
br i1 %37, label %38, label %17
38: ; preds = %34
%39 = icmp eq i32 %35, 0
br i1 %39, label %40, label %43
40: ; preds = %38
%41 = load i32, i32* %1
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %40, %38
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%45 = load i32, i32* %1
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %10
47: ; preds = %43, %0
ret i32 0
}