#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 main(int argc, const char *argv[]) {
  int one = 0;
  int two = 0;
  int five = 0;
  int x = 0;
  int sign = 0;
  printf("请输入：");
  scanf("%x", &x);
  for (one = 1; one < x * 10; one++) {
    for (two = 1; two < x * 10 / 2; two++) {
      for (five = 1; five < x * 10 / 5; five++) {
        if (one + two * 2 + five * 5 == 50) {
          printf("%d个1角加%d个2角加%d个5角可以凑成%x元！\n", one, two, five,
                 x);
          sign = 1;
        }
      }
      if (sign == 1) {
        goto out;
      }
    }
  }
out:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   $0xa,-0x20(%rbp),%ecx
cmp    %ecx,%eax
jge    125d <main+0x13d>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
imul   $0xa,-0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
jge    124a <main+0x12a>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
imul   $0xa,-0x20(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    1228 <main+0x108>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
imul   $0x5,-0x1c(%rbp),%ecx
add    %ecx,%eax
cmp    $0x32,%eax
jne    1215 <main+0xf5>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
jmp    121a <main+0xfa>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ba <main+0x9a>
cmpl   $0x1,-0x24(%rbp)
jne    1237 <main+0x117>
jmp    1262 <main+0x142>
jmp    123c <main+0x11c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1194 <main+0x74>
jmp    124f <main+0x12f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117e <main+0x5e>
jmp    1262 <main+0x142>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,(%rsp)
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%r8d
lea    (%r8,%r8,1),%eax
lea    (%rax,%rax,4),%eax
cmp    $0x2,%eax
jl     1210 <main+0xf0>
mov    $0x1,%r15d
movl   $0x2a,0x4(%rsp)
lea    0xe98(%rip),%r14
jmp    1195 <main+0x75>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15d
lea    (%r8,%r8,1),%eax
lea    (%rax,%rax,4),%eax
addl   $0xffffffff,0x4(%rsp)
cmp    %eax,%r15d
jge    1210 <main+0xf0>
lea    (%r8,%r8,4),%eax
cmp    $0x2,%eax
jl     1180 <main+0x60>
mov    $0x1,%ebp
mov    0x4(%rsp),%r12d
jmp    11c4 <main+0xa4>
nopw   0x0(%rax,%rax,1)
cmp    $0x1,%eax
je     1210 <main+0xf0>
add    $0x1,%ebp
lea    (%r8,%r8,4),%eax
add    $0xfffffffe,%r12d
cmp    %eax,%ebp
jge    1180 <main+0x60>
test   %r8d,%r8d
jle    11b5 <main+0x95>
mov    $0x1,%ebx
xor    %eax,%eax
mov    %r12d,%r13d
jmp    11ef <main+0xcf>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
lea    (%r8,%r8,1),%ecx
add    $0xfffffffb,%r13d
cmp    %ecx,%ebx
jge    11b0 <main+0x90>
test   %r13d,%r13d
jne    11e0 <main+0xc0>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
mov    (%rsp),%r8d
jmp    11e0 <main+0xc0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\EF\BC\9A\00"
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [55 x i8] c"%d\E4\B8\AA1\E8\A7\92\E5\8A\A0%d\E4\B8\AA2\E8\A7\92\E5\8A\A0%d\E4\B8\AA5\E8\A7\92\E5\8F\AF\E4\BB\A5\E5\87\91\E6\88\90%x\E5\85\83\EF\BC\81\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
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
store i32 1, i32* %6
br label %13
13: ; preds = %60, %2
%14 = load i32, i32* %6
%15 = load i32, i32* %9
%16 = mul nsw i32 %15, 10
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %63
18: ; preds = %13
store i32 1, i32* %7
br label %19
19: ; preds = %56, %18
%20 = load i32, i32* %7
%21 = load i32, i32* %9
%22 = mul nsw i32 %21, 10
%23 = sdiv i32 %22, 2
%24 = icmp slt i32 %20, %23
br i1 %24, label %25, label %59
25: ; preds = %19
store i32 1, i32* %8
br label %26
26: ; preds = %48, %25
%27 = load i32, i32* %8
%28 = load i32, i32* %9
%29 = mul nsw i32 %28, 10
%30 = sdiv i32 %29, 5
%31 = icmp slt i32 %27, %30
br i1 %31, label %32, label %51
32: ; preds = %26
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = mul nsw i32 %34, 2
%36 = add nsw i32 %33, %35
%37 = load i32, i32* %8
%38 = mul nsw i32 %37, 5
%39 = add nsw i32 %36, %38
%40 = icmp eq i32 %39, 50
br i1 %40, label %41, label %47
41: ; preds = %32
%42 = load i32, i32* %6
%43 = load i32, i32* %7
%44 = load i32, i32* %8
%45 = load i32, i32* %9
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 %42, i32 %43, i32 %44, i32 %45)
store i32 1, i32* %10
br label %47
47: ; preds = %41, %32
br label %48
48: ; preds = %47
%49 = load i32, i32* %8
%50 = add nsw i32 %49, 1
store i32 %50, i32* %8
br label %26
51: ; preds = %26
%52 = load i32, i32* %10
%53 = icmp eq i32 %52, 1
br i1 %53, label %54, label %55
54: ; preds = %51
br label %64
55: ; preds = %51
br label %56
56: ; preds = %55
%57 = load i32, i32* %7
%58 = add nsw i32 %57, 1
store i32 %58, i32* %7
br label %19
59: ; preds = %19
br label %60
60: ; preds = %59
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
store i32 %62, i32* %6
br label %13
63: ; preds = %13
br label %64
64: ; preds = %63, %54
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\EF\BC\9A\00"
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [55 x i8] c"%d\E4\B8\AA1\E8\A7\92\E5\8A\A0%d\E4\B8\AA2\E8\A7\92\E5\8A\A0%d\E4\B8\AA5\E8\A7\92\E5\8F\AF\E4\BB\A5\E5\87\91\E6\88\90%x\E5\85\83\EF\BC\81\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 10
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %56
10: ; preds = %2, %51
%11 = phi i32 [ %52, %51 ], [ %7, %2 ]
%12 = phi i32 [ %53, %51 ], [ 1, %2 ]
%13 = mul nsw i32 %11, 5
%14 = icmp sgt i32 %13, 1
br i1 %14, label %21, label %51
15: ; preds = %21, %49
%16 = phi i32 [ %43, %49 ], [ %23, %21 ]
%17 = phi i32 [ %42, %49 ], [ %22, %21 ]
%18 = add nuw nsw i32 %24, 1
%19 = mul nsw i32 %16, 5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %51
21: ; preds = %10, %15
%22 = phi i32 [ %17, %15 ], [ %11, %10 ]
%23 = phi i32 [ %16, %15 ], [ %11, %10 ]
%24 = phi i32 [ %18, %15 ], [ 1, %10 ]
%25 = icmp sgt i32 %23, 0
br i1 %25, label %26, label %15
26: ; preds = %21
%27 = shl nuw nsw i32 %24, 1
%28 = add nuw nsw i32 %27, %12
br label %29
29: ; preds = %26, %41
%30 = phi i32 [ %22, %26 ], [ %42, %41 ]
%31 = phi i32 [ %23, %26 ], [ %43, %41 ]
%32 = phi i32 [ %23, %26 ], [ %44, %41 ]
%33 = phi i32 [ 0, %26 ], [ %45, %41 ]
%34 = phi i32 [ 1, %26 ], [ %46, %41 ]
%35 = mul nsw i32 %34, 5
%36 = add nuw nsw i32 %28, %35
%37 = icmp eq i32 %36, 50
br i1 %37, label %38, label %41
38: ; preds = %29
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %24, i32 %34, i32 %32)
%40 = load i32, i32* %3
br label %41
41: ; preds = %29, %38
%42 = phi i32 [ %40, %38 ], [ %30, %29 ]
%43 = phi i32 [ %40, %38 ], [ %31, %29 ]
%44 = phi i32 [ %40, %38 ], [ %32, %29 ]
%45 = phi i32 [ 1, %38 ], [ %33, %29 ]
%46 = add nuw nsw i32 %34, 1
%47 = shl nsw i32 %44, 1
%48 = icmp slt i32 %46, %47
br i1 %48, label %29, label %49
49: ; preds = %41
%50 = icmp eq i32 %45, 1
br i1 %50, label %56, label %15
51: ; preds = %15, %10
%52 = phi i32 [ %11, %10 ], [ %17, %15 ]
%53 = add nuw nsw i32 %12, 1
%54 = mul nsw i32 %52, 10
%55 = icmp slt i32 %53, %54
br i1 %55, label %10, label %56
56: ; preds = %51, %49, %2
ret i32 0
}