#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);
main() {
  int num1, num2, result;
  num1 = 2, num2 = 2;
  result = num1 % num2;
  printf("The remainder of %d divided by %d is %d\n", num1, num2, result);
  num1 = 3, num2 = 2;
  result = num1 % num2;
  printf("The remainder of %d divided by %d is %d\n", num1, num2, result);
  num1 = 5, num2 = 2;
  result = num1 % num2;
  printf("The remainder of %d divided by %d is %d\n", num1, num2, result);
  num1 = 7, num2 = 3;
  result = num1 % num2;
  printf("The remainder of %d divided by %d is %d\n", num1, num2, result);
  num1 = 100, num2 = 33;
  result = num1 % num2;
  printf("The remainder of %d divided by %d is %d\n", num1, num2, result);
  num1 = 100, num2 = 7;
  result = num1 % num2;
  printf("The remainder of %d divided by %d is %d\n", num1, num2, result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x3,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
movl   $0x5,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
movl   $0x64,-0x4(%rbp)
movl   $0x21,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x64,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xddf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x21,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x7,%edx
mov    $0x2,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"The remainder of %d divided by %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 2, i32* %1
store i32 2, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
store i32 3, i32* %1
store i32 2, i32* %2
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = srem i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
store i32 5, i32* %1
store i32 2, i32* %2
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = srem i32 %18, %19
store i32 %20, i32* %3
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
store i32 7, i32* %1
store i32 3, i32* %2
%25 = load i32, i32* %1
%26 = load i32, i32* %2
%27 = srem i32 %25, %26
store i32 %27, i32* %3
%28 = load i32, i32* %1
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %28, i32 %29, i32 %30)
store i32 100, i32* %1
store i32 33, i32* %2
%32 = load i32, i32* %1
%33 = load i32, i32* %2
%34 = srem i32 %32, %33
store i32 %34, i32* %3
%35 = load i32, i32* %1
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %36, i32 %37)
store i32 100, i32* %1
store i32 7, i32* %2
%39 = load i32, i32* %1
%40 = load i32, i32* %2
%41 = srem i32 %39, %40
store i32 %41, i32* %3
%42 = load i32, i32* %1
%43 = load i32, i32* %2
%44 = load i32, i32* %3
%45 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %42, i32 %43, i32 %44)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"The remainder of %d divided by %d is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 3, i32 2, i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 5, i32 2, i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 7, i32 3, i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 100, i32 33, i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 100, i32 7, i32 2)
ret i32 0
}