#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__ multiple(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  int num1, num2;
  for (i = 0; i < 3; i++) {
    printf("Enter the first number: ");
    scanf("%d", &num1);
    printf("Enter the second number: ");
    scanf("%d", &num2);
    if (multiple(num1, num2))
      printf("%d is a multiple of %d\n\n", num2, num1);
    else
      printf("%d is NOT a multiple of %d\n\n", num2, num1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11e1 <main+0xb1>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <multiple@plt>
cmp    $0x0,%rax
je     11ba <main+0x8a>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ce <main+0x9e>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d3 <main+0xa3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rbx
lea    0x4(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0xeb5(%rip),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <multiple@plt>
test   %rax,%rax
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xeb3(%rip),%r12
lea    0xe93(%rip),%rbp
mov    %rbp,%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe48(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <multiple@plt>
test   %rax,%rax
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbp,%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdf6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <multiple@plt>
test   %rax,%rax
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
cmove  %r12,%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter the first number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Enter the second number: \00"
@.str.3 = [25 x i8] c"%d is a multiple of %d\0A\0A\00"
@.str.4 = [29 x i8] c"%d is NOT a multiple of %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %26, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %29
8: ; preds = %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i64 @multiple(i32 %13, i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %8
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %18, i32 %19)
br label %25
21: ; preds = %8
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %22, i32 %23)
br label %25
25: ; preds = %21, %17
br label %26
26: ; preds = %25
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %5
29: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter the first number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Enter the second number: \00"
@.str.3 = [25 x i8] c"%d is a multiple of %d\0A\0A\00"
@.str.4 = [29 x i8] c"%d is NOT a multiple of %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 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* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i64 @multiple(i32 %9, i32 %10)
%12 = icmp eq i64 %11, 0
%13 = load i32, i32* %2
%14 = load i32, i32* %1
%15 = select i1 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %15, i32 %13, i32 %14)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = call i64 @multiple(i32 %21, i32 %22)
%24 = icmp eq i64 %23, 0
%25 = load i32, i32* %2
%26 = load i32, i32* %1
%27 = select i1 %24, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %27, i32 %25, i32 %26)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%33 = load i32, i32* %1
%34 = load i32, i32* %2
%35 = call i64 @multiple(i32 %33, i32 %34)
%36 = icmp eq i64 %35, 0
%37 = load i32, i32* %2
%38 = load i32, i32* %1
%39 = select i1 %36, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %39, i32 %37, i32 %38)
ret i32 0
}