#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);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int decks;
  puts("Enter a number of decks");
  scanf("%i", &decks);
  if (decks < 1) {
    puts("That is not a valid number of decks");
    return 1;
  }
  printf("There are %i cards\n", (decks * 52));
  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)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jge    1184 <main+0x54>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    119b <main+0x6b>
imul   $0x34,-0x14(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1169 <main+0x39>
imul   $0x34,%eax,%esi
lea    0xedf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter a number of decks\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [36 x i8] c"That is not a valid number of decks\00"
@.str.3 = [20 x i8] c"There are %i cards\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %17
13: ; preds = %2
%14 = load i32, i32* %6
%15 = mul nsw i32 %14, 52
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %15)
store i32 0, i32* %3
br label %17
17: ; preds = %13, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter a number of decks\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [36 x i8] c"That is not a valid number of decks\00"
@.str.3 = [20 x i8] c"There are %i cards\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 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 = icmp slt i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
br label %14
11: ; preds = %2
%12 = mul nsw i32 %7, 52
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %9
%15 = phi i32 [ 1, %9 ], [ 0, %11 ]
ret i32 %15
}