#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 */
typedef int uint64_t;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ get_primes(int);
int pow64(int, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int m;
  int n;
  uint64_t N;
  m = atoi(argv[1]);
  n = atoi(argv[2]);
  N = m * pow64(10, n);
  if (N <= 0) {
    return 1;
  }
  if (get_primes(N) < 0) {
    fprintf(stderr, "**error\n");
    return -1;
  }
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow64@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     11aa <main+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    11e4 <main+0xa4>
mov    -0x1c(%rbp),%edi
call   1050 <get_primes@plt>
cmp    $0x0,%rax
jge    11dd <main+0x9d>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xe34(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e4 <main+0xa4>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    $0xa,%edi
mov    %eax,%esi
call   1030 <pow64@plt>
imul   %ebp,%eax
test   %eax,%eax
jle    119a <main+0x5a>
mov    %eax,%edi
call   1050 <get_primes@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jns    119f <main+0x5f>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    119f <main+0x5f>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"**error\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %6
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = call i32 @pow64(i32 10, i32 %18)
%20 = mul nsw i32 %17, %19
store i32 %20, i32* %8
%21 = load i32, i32* %8
%22 = icmp sle i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %2
store i32 1, i32* %3
br label %32
24: ; preds = %2
%25 = load i32, i32* %8
%26 = call i64 @get_primes(i32 %25)
%27 = icmp slt i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %32
31: ; preds = %24
store i32 0, i32* %3
br label %32
32: ; preds = %31, %28, %23
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"**error\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @pow64(i32 10, i32 %8)
%10 = mul nsw i32 %9, %5
%11 = icmp slt i32 %10, 1
br i1 %11, label %18, label %12
12: ; preds = %2
%13 = tail call i64 @get_primes(i32 %10)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %12, %2, %15
%19 = phi i32 [ -1, %15 ], [ 1, %2 ], [ 0, %12 ]
ret i32 %19
}