#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 EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ EvenlyDivisibleBy(int, long);
int atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("Please, next time insert your max as a command line input!\n");
    return EXIT_FAILURE;
  }
  int max = atoi(argv[1]);
  long int value = 0;
  printf("Insert the number that you want to check: ");
  scanf("%ld", &value);
  if (EvenlyDivisibleBy(max, value)) {
    printf("%ld is evenly divisible by %d\n", value, max);
  } else {
    printf("%ld is not evely divisible by %d\n", value, max);
  }
  return EXIT_SUCCESS;
}


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)
cmpl   $0x2,-0x8(%rbp)
je     117f <main+0x3f>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1206 <main+0xc6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <EvenlyDivisibleBy@plt>
cmp    $0x0,%rax
je     11e5 <main+0xa5>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fa <main+0xba>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jne    11c5 <main+0x75>
mov    0x8(%rsi),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebx
movq   $0x0,0x8(%rsp)
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x8(%rsp),%rsi
mov    %ebx,%edi
call   1050 <EvenlyDivisibleBy@plt>
test   %rax,%rax
mov    0x8(%rsp),%rsi
lea    0xea6(%rip),%rax
lea    0xe80(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e15(%rip),%rax
jmp    11d8 <main+0x88>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"Please, next time insert your max as a command line input!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [43 x i8] c"Insert the number that you want to check: \00"
@.str.2 = [4 x i8] c"%ld\00"
@.str.3 = [31 x i8] c"%ld is evenly divisible by %d\0A\00"
@.str.4 = [34 x i8] c"%ld is not evely divisible by %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %3
br label %34
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %6
store i64 0, i64* %7
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %7)
%20 = load i32, i32* %6
%21 = load i64, i64* %7
%22 = call i64 @EvenlyDivisibleBy(i32 %20, i64 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %13
%25 = load i64, i64* %7
%26 = load i32, i32* %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i64 %25, i32 %26)
br label %32
28: ; preds = %13
%29 = load i64, i64* %7
%30 = load i32, i32* %6
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i64 %29, i32 %30)
br label %32
32: ; preds = %28, %24
%33 = load i32, i32* @EXIT_SUCCESS
store i32 %33, i32* %3
br label %34
34: ; preds = %32, %10
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str.1 = [43 x i8] c"Insert the number that you want to check: \00"
@.str.2 = [4 x i8] c"%ld\00"
@.str.3 = [31 x i8] c"%ld is evenly divisible by %d\0A\00"
@.str.4 = [34 x i8] c"%ld is not evely divisible by %d\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [59 x i8] c"Please, next time insert your max as a command line input!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = icmp eq i32 %0, 2
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
br label %22
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %3)
%15 = load i64, i64* %3
%16 = call i64 @EvenlyDivisibleBy(i32 %11, i64 %15)
%17 = icmp eq i64 %16, 0
%18 = load i64, i64* %3
%19 = select i1 %17, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %19, i64 %18, i32 %11)
%21 = load i32, i32* @EXIT_SUCCESS
br label %22
22: ; preds = %8, %5
%23 = phi i32 [ %7, %5 ], [ %21, %8 ]
ret i32 %23
}