#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(void) {
  int x;
  int y;
  int z = 1;
  int i;
  printf("Input two number pls[x^y]:");
  scanf("%d%d", &x, &y);
  for (i = 1; i <= y; i++)
    z = z * x % 1000;
  printf("%d|%d|%d\n", z / 100, (z % 100) / 10, z % 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     118b <main+0x6b>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <main+0x3f>
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x18(%rbp),%edx
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%edx
test   %edx,%edx
jle    1166 <main+0x46>
mov    0x4(%rsp),%r8d
lea    -0x1(%rdx),%esi
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0x3,%esi
jae    116f <main+0x4f>
mov    $0x1,%edi
jmp    1214 <main+0xf4>
mov    $0x1,%di
jmp    1248 <main+0x128>
and    $0xfffffffc,%edx
mov    $0x1,%edi
nopw   0x0(%rax,%rax,1)
imul   %r8d,%edi
movslq %edi,%rsi
imul   $0x10624dd3,%rsi,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x26,%rdi
add    %eax,%edi
imul   $0x3e8,%edi,%eax
sub    %eax,%esi
imul   %r8d,%esi
movslq %esi,%rax
imul   $0x10624dd3,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x26,%rsi
add    %edi,%esi
imul   $0x3e8,%esi,%esi
sub    %esi,%eax
imul   %r8d,%eax
cltq
imul   $0x10624dd3,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x26,%rsi
add    %edi,%esi
imul   $0x3e8,%esi,%esi
sub    %esi,%eax
imul   %r8d,%eax
movslq %eax,%rdi
imul   $0x10624dd3,%rdi,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x26,%rax
add    %esi,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
add    $0xfffffffc,%edx
jne    1180 <main+0x60>
test   %ecx,%ecx
je     1248 <main+0x128>
nopl   0x0(%rax,%rax,1)
imul   %r8d,%edi
movslq %edi,%rdi
imul   $0x10624dd3,%rdi,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
add    $0xffffffff,%ecx
jne    1220 <main+0x100>
movswl %di,%eax
imul   $0x147b,%eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0x13,%esi
add    %ecx,%esi
imul   $0x64,%esi,%ecx
mov    %edi,%edx
sub    %ecx,%edx
movsbl %dl,%ecx
imul   $0x67,%ecx,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
shr    $0xa,%edx
add    %cl,%dl
movsbl %dl,%edx
imul   $0x6667,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x12,%eax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edi
movswl %di,%ecx
lea    0xd86(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Input two number pls[x^y]:\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [10 x i8] c"%d|%d|%d\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
store i32 1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
store i32 1, i32* %5
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = mul nsw i32 %13, %14
%16 = srem i32 %15, 1000
store i32 %16, i32* %4
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %8
20: ; preds = %8
%21 = load i32, i32* %4
%22 = sdiv i32 %21, 100
%23 = load i32, i32* %4
%24 = srem i32 %23, 100
%25 = sdiv i32 %24, 10
%26 = load i32, i32* %4
%27 = srem i32 %26, 10
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %25, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Input two number pls[x^y]:\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [10 x i8] c"%d|%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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 1
br i1 %8, label %43, label %9
9: ; preds = %0
%10 = load i32, i32* %1
%11 = add i32 %7, -1
%12 = and i32 %7, 3
%13 = icmp ult i32 %11, 3
br i1 %13, label %29, label %14
14: ; preds = %9
%15 = and i32 %7, -4
br label %16
16: ; preds = %16, %14
%17 = phi i32 [ 1, %14 ], [ %26, %16 ]
%18 = phi i32 [ 0, %14 ], [ %27, %16 ]
%19 = mul nsw i32 %10, %17
%20 = srem i32 %19, 1000
%21 = mul nsw i32 %10, %20
%22 = srem i32 %21, 1000
%23 = mul nsw i32 %10, %22
%24 = srem i32 %23, 1000
%25 = mul nsw i32 %10, %24
%26 = srem i32 %25, 1000
%27 = add i32 %18, 4
%28 = icmp eq i32 %27, %15
br i1 %28, label %29, label %16
29: ; preds = %16, %9
%30 = phi i32 [ undef, %9 ], [ %26, %16 ]
%31 = phi i32 [ 1, %9 ], [ %26, %16 ]
%32 = icmp eq i32 %12, 0
br i1 %32, label %40, label %33
33: ; preds = %29, %33
%34 = phi i32 [ %37, %33 ], [ %31, %29 ]
%35 = phi i32 [ %38, %33 ], [ 0, %29 ]
%36 = mul nsw i32 %10, %34
%37 = srem i32 %36, 1000
%38 = add i32 %35, 1
%39 = icmp eq i32 %38, %12
br i1 %39, label %40, label %33
40: ; preds = %33, %29
%41 = phi i32 [ %30, %29 ], [ %37, %33 ]
%42 = trunc i32 %41 to i16
br label %43
43: ; preds = %40, %0
%44 = phi i16 [ 1, %0 ], [ %42, %40 ]
%45 = sdiv i16 %44, 100
%46 = sext i16 %45 to i32
%47 = srem i16 %44, 100
%48 = trunc i16 %47 to i8
%49 = sdiv i8 %48, 10
%50 = sext i8 %49 to i32
%51 = srem i16 %44, 10
%52 = sext i16 %51 to i32
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %46, i32 %50, i32 %52)
ret i32 0
}