#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 atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int puiss(int, int);
int main(int argc, char **argv) {
  if (3 != argc) {
    printf("Nombre de paramètres insuffisants\n");
    return 1;
  }
  int exposant = atoi(argv[1]);
  int limit = atoi(argv[2]);
  int i, temp;
  for (i = 0; i <= limit; i++) {
    int unite = (temp = i) % 10;
    int dizaine = (temp /= 10) % 10;
    int centaine = (temp /= 10) % 10;
    int millier = (temp /= 10) % 10;
    int result = puiss(exposant, unite) + puiss(exposant, centaine) +
                 puiss(exposant, millier) + puiss(exposant, dizaine);
    if (result == i)
      printf("%d ", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
je     116e <main+0x3e>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1281 <main+0x151>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     127a <main+0x14a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x28(%rbp)
mov    -0x20(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x30(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1050 <puiss@plt>
mov    %eax,-0x40(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1050 <puiss@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1050 <puiss@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1050 <puiss@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1267 <main+0x137>
mov    -0x1c(%rbp),%esi
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126c <main+0x13c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1195 <main+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x3,%edi
jne    1250 <main+0x110>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%r12d
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
test   %eax,%eax
js     1263 <main+0x123>
add    $0x1,%eax
xor    %r13d,%r13d
mov    %eax,0x4(%rsp)
jmp    1191 <main+0x51>
add    $0x1,%r13d
mov    0x4(%rsp),%eax
cmp    %r13d,%eax
je     1263 <main+0x123>
mov    %r13d,%ebx
imul   $0x51eb851f,%rbx,%rbp
imul   $0x10624dd3,%rbx,%r14
mov    $0xcccccccd,%ecx
imul   %rcx,%rbx
shr    $0x23,%rbx
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %r13d,%esi
sub    %eax,%esi
mov    %rbx,%rax
imul   %rcx,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
shr    $0x25,%rbp
mov    %rbp,%rax
imul   %rcx,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
shr    $0x26,%r14
mov    %r14,%rax
imul   %rcx,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%r14d
mov    %r12d,%edi
call   1060 <puiss@plt>
mov    %eax,%r15d
mov    %r12d,%edi
mov    %ebp,%esi
call   1060 <puiss@plt>
mov    %eax,%ebp
add    %r15d,%ebp
mov    %r12d,%edi
mov    %r14d,%esi
call   1060 <puiss@plt>
mov    %eax,%r14d
add    %ebp,%r14d
mov    %r12d,%edi
mov    %ebx,%esi
call   1060 <puiss@plt>
add    %r14d,%eax
cmp    %eax,%r13d
jne    1180 <main+0x40>
lea    0xdbf(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1180 <main+0x40>
lea    0xdad(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
jmp    1265 <main+0x125>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Nombre de param\C3\A8tres insuffisants\0A\00"
@.str.1 = [4 x i8] c"%d \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
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 3, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %70
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %6
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
store i32 %27, i32* %7
store i32 0, i32* %8
br label %28
28: ; preds = %66, %19
%29 = load i32, i32* %8
%30 = load i32, i32* %7
%31 = icmp sle i32 %29, %30
br i1 %31, label %32, label %69
32: ; preds = %28
%33 = load i32, i32* %8
store i32 %33, i32* %9
%34 = srem i32 %33, 10
store i32 %34, i32* %10
%35 = load i32, i32* %9
%36 = sdiv i32 %35, 10
store i32 %36, i32* %9
%37 = srem i32 %36, 10
store i32 %37, i32* %11
%38 = load i32, i32* %9
%39 = sdiv i32 %38, 10
store i32 %39, i32* %9
%40 = srem i32 %39, 10
store i32 %40, i32* %12
%41 = load i32, i32* %9
%42 = sdiv i32 %41, 10
store i32 %42, i32* %9
%43 = srem i32 %42, 10
store i32 %43, i32* %13
%44 = load i32, i32* %6
%45 = load i32, i32* %10
%46 = call i32 @puiss(i32 %44, i32 %45)
%47 = load i32, i32* %6
%48 = load i32, i32* %12
%49 = call i32 @puiss(i32 %47, i32 %48)
%50 = add nsw i32 %46, %49
%51 = load i32, i32* %6
%52 = load i32, i32* %13
%53 = call i32 @puiss(i32 %51, i32 %52)
%54 = add nsw i32 %50, %53
%55 = load i32, i32* %6
%56 = load i32, i32* %11
%57 = call i32 @puiss(i32 %55, i32 %56)
%58 = add nsw i32 %54, %57
store i32 %58, i32* %14
%59 = load i32, i32* %14
%60 = load i32, i32* %8
%61 = icmp eq i32 %59, %60
br i1 %61, label %62, label %65
62: ; preds = %32
%63 = load i32, i32* %8
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %62, %32
br label %66
66: ; preds = %65
%67 = load i32, i32* %8
%68 = add nsw i32 %67, 1
store i32 %68, i32* %8
br label %28
69: ; preds = %28
store i32 0, i32* %3
br label %70
70: ; preds = %69, %17
%71 = load i32, i32* %3
ret i32 %71
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d \00"
@str = [35 x i8] c"Nombre de param\C3\A8tres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %36
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = icmp slt i32 %12, 0
br i1 %13, label %36, label %14
14: ; preds = %6, %33
%15 = phi i32 [ %34, %33 ], [ 0, %6 ]
%16 = urem i32 %15, 10
%17 = udiv i32 %15, 10
%18 = urem i32 %17, 10
%19 = udiv i32 %15, 100
%20 = urem i32 %19, 10
%21 = udiv i32 %15, 1000
%22 = urem i32 %21, 10
%23 = tail call i32 @puiss(i32 %9, i32 %16)
%24 = tail call i32 @puiss(i32 %9, i32 %20)
%25 = add nsw i32 %24, %23
%26 = tail call i32 @puiss(i32 %9, i32 %22)
%27 = add nsw i32 %25, %26
%28 = tail call i32 @puiss(i32 %9, i32 %18)
%29 = add nsw i32 %27, %28
%30 = icmp eq i32 %29, %15
br i1 %30, label %31, label %33
31: ; preds = %14
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %33
33: ; preds = %31, %14
%34 = add nuw i32 %15, 1
%35 = icmp eq i32 %15, %12
br i1 %35, label %36, label %14
36: ; preds = %33, %6, %4
%37 = phi i32 [ 1, %4 ], [ 0, %6 ], [ 0, %33 ]
ret i32 %37
}