#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 multiple(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int int1, int2, counter;
  for (counter = 1; counter <= 2; counter++) {
    printf("Enter two integers: \n");
    scanf("%d %d", &int1, &int2);
    if (multiple(int1, int2) == 1) {
      printf("%d is a multiple of %d\n", int2, int1);
    } else {
      printf("%d is not a multiple of %d\n", int2, int1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jg     11c6 <main+0x96>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <multiple@plt>
cmp    $0x1,%eax
jne    119f <main+0x6f>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b3 <main+0x83>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b8 <main+0x88>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%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    0xee8(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xe9f(%rip),%r13
lea    0x4(%rsp),%r15
mov    %rsp,%r12
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <multiple@plt>
cmp    $0x1,%eax
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xe72(%rip),%rbp
lea    0xe83(%rip),%rbx
mov    %rbx,%rdi
cmove  %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <multiple@plt>
cmp    $0x1,%eax
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
cmove  %rbp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <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 = [22 x i8] c"Enter two integers: \0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [24 x i8] c"%d is a multiple of %d\0A\00"
@.str.3 = [28 x i8] c"%d is not a multiple of %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
br label %5
5: ; preds = %24, %0
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 2
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @multiple(i32 %11, i32 %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %19
15: ; preds = %8
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 %17)
br label %23
19: ; preds = %8
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 %21)
br label %23
23: ; preds = %19, %15
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [24 x i8] c"%d is a multiple of %d\0A\00"
@.str.3 = [28 x i8] c"%d is not a multiple of %d\0A\00"
@str = [21 x i8] c"Enter two integers: \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 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @multiple(i32 %7, i32 %8)
%10 = icmp eq i32 %9, 1
%11 = load i32, i32* %2
%12 = load i32, i32* %1
%13 = select i1 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %13, i32 %11, i32 %12)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = call i32 @multiple(i32 %17, i32 %18)
%20 = icmp eq i32 %19, 1
%21 = load i32, i32* %2
%22 = load i32, i32* %1
%23 = select i1 %20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %23, i32 %21, i32 %22)
ret i32 0
}