#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 main(void) {
  int i1 = 365, j1 = 7;
  int i2 = 12258, j2 = 23;
  int i3 = 996, j3 = 4;
  int Next_multiple_1 = i1 + j1 - i1 % j1;
  int Next_multiple_2 = i2 + j2 - i2 % j2;
  int Next_multiple_3 = i3 + j3 - i3 % j3;
  printf("Next_multiple_1 is %i\n", Next_multiple_1);
  printf("Next_multiple_2 is %i\n", Next_multiple_2);
  printf("Next_multiple_3 is %i\n", Next_multiple_3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x173,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x2fe3,%esi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x3e8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"Next_multiple_1 is %i\0A\00"
@.str.1 = [23 x i8] c"Next_multiple_2 is %i\0A\00"
@.str.2 = [23 x i8] c"Next_multiple_3 is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 371)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 12259)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 1000)
ret i32 0
}