#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, int);
int main(void) {
  int nextMultiple;
  int i, j;
  i = 365;
  j = 7;
  nextMultiple = i + j - i % j;
  printf("Next largest even multiple of %i for %i is %i\n", j, i, nextMultiple);
  i = 12258;
  j = 23;
  nextMultiple = i + j - i % j;
  printf("Next largest even multiple of %i for %i is %i\n", j, i, nextMultiple);
  i = 996;
  j = 4;
  nextMultiple = i + j - i % j;
  printf("Next largest even multiple of %i for %i is %i\n", j, i, nextMultiple);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x16d,-0xc(%rbp)
movl   $0x7,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    -0x1c(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2fe2,-0xc(%rbp)
movl   $0x17,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    -0x18(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
movl   $0x3e4,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    -0x14(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x16d,%edx
mov    $0x173,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
mov    $0x2fe2,%edx
mov    $0x2fe3,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x3e4,%edx
mov    $0x3e8,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Next largest even multiple of %i for %i is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 365, i32* %3
store i32 7, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = sub nsw i32 %7, %10
store i32 %11, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
store i32 12258, i32* %3
store i32 23, i32* %4
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = srem i32 %19, %20
%22 = sub nsw i32 %18, %21
store i32 %22, i32* %2
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24, i32 %25)
store i32 996, i32* %3
store i32 4, i32* %4
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = add nsw i32 %27, %28
%30 = load i32, i32* %3
%31 = load i32, i32* %4
%32 = srem i32 %30, %31
%33 = sub nsw i32 %29, %32
store i32 %33, i32* %2
%34 = load i32, i32* %4
%35 = load i32, i32* %3
%36 = load i32, i32* %2
%37 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %34, i32 %35, i32 %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"Next largest even multiple of %i for %i is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 7, i32 365, i32 371)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 23, i32 12258, i32 12259)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 4, i32 996, i32 1000)
ret i32 0
}