int main(int argc, char *argv[]) {
  int returnValue = 0;
  int k;
  if (returnValue == 0) {
    if (argv != 2) {
      printf("Exactly one argument shall be provided.");
      returnValue = 1;
    }
  }
  if (returnValue == 0) {
    k = atoi(argv[1]);
    if (k < 1) {
      printf("The provided argument must be a positive integer.");
      returnValue = 1;
    }
  }
  return returnValue;
}


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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1170 <main+0x50>
mov    $0x2,%eax
cmp    %rax,-0x10(%rbp)
je     116b <main+0x4b>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1170 <main+0x50>
cmpl   $0x0,-0x14(%rbp)
jne    11b0 <main+0x90>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jge    11ab <main+0x8b>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    11b0 <main+0x90>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%rsi
je     113c <main+0x1c>
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebx
jmp    1151 <main+0x31>
mov    0xa,%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <atoi@plt>
test   %eax,%eax
jle    1155 <main+0x35>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xecc(%rip),%rdi
jmp    112e <main+0xe>

LLVM IR (-O0):
@.str = [40 x i8] c"Exactly one argument shall be provided.\00"
@.str.1 = [50 x i8] c"The provided argument must be a positive integer.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = icmp ne i8** %11, inttoptr (i64 2 to i8**)
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %15
15: ; preds = %13, %10
br label %16
16: ; preds = %15, %2
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %22)
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = icmp slt i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %19
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %6
br label %28
28: ; preds = %26, %19
br label %29
29: ; preds = %28, %16
%30 = load i32, i32* %6
ret i32 %30
}

LLVM IR (-O2):
@.str = [40 x i8] c"Exactly one argument shall be provided.\00"
@.str.1 = [50 x i8] c"The provided argument must be a positive integer.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i8** %1, inttoptr (i64 2 to i8**)
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** inttoptr (i64 10 to i8**)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %5)
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %4, %2
%9 = phi i8* [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), %4 ]
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %8, %4
%12 = phi i32 [ 0, %4 ], [ 1, %8 ]
ret i32 %12
}