#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);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int a, b;
  scanf("%d", &a);
  for (b = a; b >= 1; b--) {
    if (a % b == 0) {
      printf("%d\n", b);
    }
  }
  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)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jl     1188 <main+0x68>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%edx
jne    1175 <main+0x55>
mov    -0x18(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    117a <main+0x5a>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    114c <main+0x2c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    116f <main+0x4f>
lea    0xec0(%rip),%rbx
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
cltd
idiv   %ebp
test   %edx,%edx
jne    1161 <main+0x41>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
cmp    $0x2,%ebp
jl     116f <main+0x4f>
add    $0xffffffff,%ebp
mov    0x4(%rsp),%eax
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %2, %17
%9 = phi i32 [ %19, %17 ], [ %6, %2 ]
%10 = phi i32 [ %18, %17 ], [ %6, %2 ]
%11 = srem i32 %9, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %15
15: ; preds = %8, %13
%16 = icmp sgt i32 %10, 1
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = add nsw i32 %10, -1
%19 = load i32, i32* %3
br label %8
20: ; preds = %15, %2
ret i32 0
}