#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 */
scalar_t__ d5(int);
scalar_t__ d7(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Enter a number");
  scanf("%d", &a);
  if (d5(a) == 0 && d7(a) == 0) {
    printf("The number is divisible by 5 and 7");
  } else {
    printf("The number is not divisible by 5 and 7");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <d5@plt>
cmp    $0x0,%rax
jne    11a0 <main+0x60>
mov    -0x8(%rbp),%edi
call   1050 <d7@plt>
cmp    $0x0,%rax
jne    11a0 <main+0x60>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
jmp    11ac <main+0x6c>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <d5@plt>
test   %rax,%rax
jne    117a <main+0x3a>
mov    0x4(%rsp),%edi
call   1050 <d7@plt>
test   %rax,%rax
je     118a <main+0x4a>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe81(%rip),%rdi
jmp    1181 <main+0x41>

LLVM IR (-O0):
@.str = [15 x i8] c"Enter a number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"The number is divisible by 5 and 7\00"
@.str.3 = [39 x i8] c"The number is not divisible by 5 and 7\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i64 @d5(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i64 @d7(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %16
14: ; preds = %8, %0
%15 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter a number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"The number is divisible by 5 and 7\00"
@.str.3 = [39 x i8] c"The number is not divisible by 5 and 7\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @d5(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %1
%10 = call i64 @d7(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8, %0
br label %13
13: ; preds = %8, %12
%14 = phi i8* [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), %12 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), %8 ]
%15 = call i32 @printf(i8* dereferenceable(1) %14)
ret i32 0
}