#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 main() {
  int i;
  int a = 54;
  for (i = 1; i <= a; i++) {
    if (a % i == 0) {
      printf(" %d", i);
    }
  }
  printf("\n");
  int b = 24;
  for (i = 1; i <= b; i++) {
    if (b % i == 0) {
      printf(" %d", i);
    }
  }
  printf("\n");
  int factor[100];
  int factors = 0;
  for (i = 1; i <= b || i <= a; i++) {
    if (a % i == 0 && b % i == 0) {
      printf(" %d", i);
      if (factors >= 100) {
        printf("两个整数公因数的个数超过了预设的值%d\n", 100);
        printf("请修改MAX的值来达到你的要求\n");
        return 1;
      }
      factor[factors] = i;
      factors++;
    }
  }
  printf("\n");
  for (i = 0; i < factors; i++) {
    printf(" %d", factor[i]);
  }
  printf("\n");
  printf("gcd(%d,%d)=%d\n", a, b, factor[factors - 1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x36,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1170 <main+0x60>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    115d <main+0x4d>
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1162 <main+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <main+0x20>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x18,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11cc <main+0xbc>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    11b9 <main+0xa9>
mov    -0x8(%rbp),%esi
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11be <main+0xae>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118c <main+0x7c>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1a4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0x10(%rbp),%ecx
mov    %al,-0x1a5(%rbp)
jle    120e <main+0xfe>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0x1a5(%rbp)
mov    -0x1a5(%rbp),%al
test   $0x1,%al
jne    1221 <main+0x111>
jmp    12bf <main+0x1af>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    12ac <main+0x19c>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    12ac <main+0x19c>
mov    -0x8(%rbp),%esi
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x64,-0x1a4(%rbp)
jl     128c <main+0x17c>
lea    0xd9e(%rip),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1345 <main+0x235>
mov    -0x8(%rbp),%ecx
movslq -0x1a4(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    12b1 <main+0x1a1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11eb <main+0xdb>
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    130a <main+0x1fa>
movslq -0x8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xd0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12d4 <main+0x1c4>
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x1a4(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1a0(%rbp,%rax,4),%ecx
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x190,%rsp
mov    $0x1,%ebx
mov    $0x36,%al
movzbl %al,%ebp
lea    0xeb0(%rip),%r14
jmp    1168 <main+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x37,%ebx
je     1181 <main+0x51>
mov    %ebp,%eax
div    %bl
movzbl %ah,%eax
test   %al,%al
jne    1160 <main+0x30>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
mov    $0x18,%al
movzbl %al,%ebp
lea    0xe64(%rip),%r14
jmp    11a8 <main+0x78>
xchg   %ax,%ax
add    $0x1,%ebx
cmp    $0x19,%ebx
je     11c1 <main+0x91>
mov    %ebp,%eax
div    %bl
movzbl %ah,%eax
test   %al,%al
jne    11a0 <main+0x70>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11a0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
mov    $0x36,%al
movzbl %al,%ebp
mov    $0x18,%al
movzbl %al,%r14d
lea    0xe1e(%rip),%r15
xor    %r12d,%r12d
jmp    11f8 <main+0xc8>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x37,%ebx
je     1231 <main+0x101>
mov    %ebp,%eax
div    %bl
movzbl %ah,%eax
test   %al,%al
jne    11f0 <main+0xc0>
mov    %r14d,%eax
div    %bl
movzbl %ah,%eax
test   %al,%al
jne    11f0 <main+0xc0>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x64,%r12d
jge    12a3 <main+0x173>
movslq %r12d,%rax
mov    %ebx,(%rsp,%rax,4)
add    $0x1,%r12d
jmp    11f0 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r12d,%r12d
jle    1266 <main+0x136>
mov    %r12d,%ebp
lea    0xdb6(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1250 <main+0x120>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq %r12d,%rax
mov    -0x4(%rsp,%rax,4),%ecx
lea    0xdbd(%rip),%rdi
xor    %ebx,%ebx
mov    $0x36,%esi
mov    $0x18,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%eax
add    $0x190,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd5a(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd8d(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
jmp    1291 <main+0x161>

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [55 x i8] c"\E4\B8\A4\E4\B8\AA\E6\95\B4\E6\95\B0\E5\85\AC\E5\9B\A0\E6\95\B0\E7\9A\84\E4\B8\AA\E6\95\B0\E8\B6\85\E8\BF\87\E4\BA\86\E9\A2\84\E8\AE\BE\E7\9A\84\E5\80\BC%d\0A\00"
@.str.3 = [41 x i8] c"\E8\AF\B7\E4\BF\AE\E6\94\B9MAX\E7\9A\84\E5\80\BC\E6\9D\A5\E8\BE\BE\E5\88\B0\E4\BD\A0\E7\9A\84\E8\A6\81\E6\B1\82\0A\00"
@.str.4 = [15 x i8] c"gcd(%d,%d)=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i32]
%6 = alloca i32
store i32 0, i32* %1
store i32 54, i32* %3
store i32 1, i32* %2
br label %7
7: ; preds = %20, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = srem i32 %12, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i32, i32* %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %11
br label %20
20: ; preds = %19
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %7
23: ; preds = %7
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 24, i32* %4
store i32 1, i32* %2
br label %25
25: ; preds = %38, %23
%26 = load i32, i32* %2
%27 = load i32, i32* %4
%28 = icmp sle i32 %26, %27
br i1 %28, label %29, label %41
29: ; preds = %25
%30 = load i32, i32* %4
%31 = load i32, i32* %2
%32 = srem i32 %30, %31
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = load i32, i32* %2
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %34, %29
br label %38
38: ; preds = %37
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %25
41: ; preds = %25
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
store i32 1, i32* %2
br label %43
43: ; preds = %79, %41
%44 = load i32, i32* %2
%45 = load i32, i32* %4
%46 = icmp sle i32 %44, %45
br i1 %46, label %51, label %47
47: ; preds = %43
%48 = load i32, i32* %2
%49 = load i32, i32* %3
%50 = icmp sle i32 %48, %49
br label %51
51: ; preds = %47, %43
%52 = phi i1 [ true, %43 ], [ %50, %47 ]
br i1 %52, label %53, label %82
53: ; preds = %51
%54 = load i32, i32* %3
%55 = load i32, i32* %2
%56 = srem i32 %54, %55
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %78
58: ; preds = %53
%59 = load i32, i32* %4
%60 = load i32, i32* %2
%61 = srem i32 %59, %60
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %78
63: ; preds = %58
%64 = load i32, i32* %2
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %64)
%66 = load i32, i32* %6
%67 = icmp sge i32 %66, 100
br i1 %67, label %68, label %71
68: ; preds = %63
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 100)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %1
br label %107
71: ; preds = %63
%72 = load i32, i32* %2
%73 = load i32, i32* %6
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 %74
store i32 %72, i32* %75
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
store i32 %77, i32* %6
br label %78
78: ; preds = %71, %58, %53
br label %79
79: ; preds = %78
%80 = load i32, i32* %2
%81 = add nsw i32 %80, 1
store i32 %81, i32* %2
br label %43
82: ; preds = %51
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %84
84: ; preds = %94, %82
%85 = load i32, i32* %2
%86 = load i32, i32* %6
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %97
88: ; preds = %84
%89 = load i32, i32* %2
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 %90
%92 = load i32, i32* %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %92)
br label %94
94: ; preds = %88
%95 = load i32, i32* %2
%96 = add nsw i32 %95, 1
store i32 %96, i32* %2
br label %84
97: ; preds = %84
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%99 = load i32, i32* %3
%100 = load i32, i32* %4
%101 = load i32, i32* %6
%102 = sub nsw i32 %101, 1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 %103
%105 = load i32, i32* %104
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %99, i32 %100, i32 %105)
store i32 0, i32* %1
br label %107
107: ; preds = %97, %68
%108 = load i32, i32* %1
ret i32 %108
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
@.str.2 = [55 x i8] c"\E4\B8\A4\E4\B8\AA\E6\95\B4\E6\95\B0\E5\85\AC\E5\9B\A0\E6\95\B0\E7\9A\84\E4\B8\AA\E6\95\B0\E8\B6\85\E8\BF\87\E4\BA\86\E9\A2\84\E8\AE\BE\E7\9A\84\E5\80\BC%d\0A\00"
@.str.4 = [15 x i8] c"gcd(%d,%d)=%d\0A\00"
@str = [40 x i8] c"\E8\AF\B7\E4\BF\AE\E6\94\B9MAX\E7\9A\84\E5\80\BC\E6\9D\A5\E8\BE\BE\E5\88\B0\E4\BD\A0\E7\9A\84\E8\A6\81\E6\B1\82\00"
define i32 @main() {
%1 = alloca [100 x i32]
br label %2
2: ; preds = %0, %9
%3 = phi i32 [ 1, %0 ], [ %10, %9 ]
%4 = trunc i32 %3 to i8
%5 = urem i8 54, %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %9
9: ; preds = %2, %7
%10 = add nuw nsw i32 %3, 1
%11 = icmp eq i32 %10, 55
br i1 %11, label %12, label %2
12: ; preds = %9
%13 = tail call i32 @putchar(i32 10)
br label %14
14: ; preds = %12, %21
%15 = phi i32 [ 1, %12 ], [ %22, %21 ]
%16 = trunc i32 %15 to i8
%17 = urem i8 24, %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %21
21: ; preds = %14, %19
%22 = add nuw nsw i32 %15, 1
%23 = icmp eq i32 %22, 25
br i1 %23, label %24, label %14
24: ; preds = %21
%25 = tail call i32 @putchar(i32 10)
%26 = bitcast [100 x i32]* %1 to i8*
br label %27
27: ; preds = %24, %46
%28 = phi i32 [ 0, %24 ], [ %47, %46 ]
%29 = phi i32 [ 1, %24 ], [ %48, %46 ]
%30 = trunc i32 %29 to i8
%31 = urem i8 54, %30
%32 = icmp eq i8 %31, 0
br i1 %32, label %33, label %46
33: ; preds = %27
%34 = urem i8 24, %30
%35 = icmp eq i8 %34, 0
br i1 %35, label %36, label %46
36: ; preds = %33
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%38 = icmp sgt i32 %28, 99
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 100)
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %69
42: ; preds = %36
%43 = sext i32 %28 to i64
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %43
store i32 %29, i32* %44
%45 = add nsw i32 %28, 1
br label %46
46: ; preds = %27, %33, %42
%47 = phi i32 [ %45, %42 ], [ %28, %33 ], [ %28, %27 ]
%48 = add nuw nsw i32 %29, 1
%49 = icmp eq i32 %48, 55
br i1 %49, label %50, label %27
50: ; preds = %46
%51 = tail call i32 @putchar(i32 10)
%52 = icmp sgt i32 %47, 0
br i1 %52, label %53, label %62
53: ; preds = %50
%54 = zext i32 %47 to i64
br label %55
55: ; preds = %53, %55
%56 = phi i64 [ 0, %53 ], [ %60, %55 ]
%57 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %58)
%60 = add nuw nsw i64 %56, 1
%61 = icmp eq i64 %60, %54
br i1 %61, label %62, label %55
62: ; preds = %55, %50
%63 = tail call i32 @putchar(i32 10)
%64 = add nsw i32 %47, -1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 54, i32 24, i32 %67)
br label %69
69: ; preds = %62, %39
%70 = phi i32 [ 1, %39 ], [ 0, %62 ]
ret i32 %70
}