#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
  int rem;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
TYPE_1__ div(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  div_t output;
  output = div(27, 4);
  printf("Quotient part of (27/ 4) = %d\n", output.quot);
  printf("Remainder part of (27/4) = %d\n", output.rem);
  output = div(27, 3);
  printf("Quotient part of (27/ 3) = %d\n", output.quot);
  printf("Remainder part of (27/3) = %d\n", output.rem);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1b,%edi
mov    $0x4,%esi
call   1040 <div@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1b,%edi
mov    $0x3,%esi
call   1040 <div@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1b,%edi
mov    $0x4,%esi
call   1040 <div@plt>
mov    %rax,%rbx
shr    $0x20,%rbx
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1b,%edi
mov    $0x3,%esi
call   1040 <div@plt>
mov    %rax,%rbx
shr    $0x20,%rbx
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@.str = [31 x i8] c"Quotient part of (27/ 4) = %d\0A\00"
@.str.1 = [31 x i8] c"Remainder part of (27/4) = %d\0A\00"
@.str.2 = [31 x i8] c"Quotient part of (27/ 3) = %d\0A\00"
@.str.3 = [31 x i8] c"Remainder part of (27/3) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.TYPE_3__
%3 = alloca %struct.TYPE_3__
%4 = alloca %struct.TYPE_3__
store i32 0, i32* %1
%5 = call i64 @div(i32 27, i32 4)
%6 = bitcast %struct.TYPE_3__* %3 to i64*
store i64 %5, i64* %6
%7 = bitcast %struct.TYPE_3__* %2 to i8*
%8 = bitcast %struct.TYPE_3__* %3 to i8*
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 1
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = call i64 @div(i32 27, i32 3)
%16 = bitcast %struct.TYPE_3__* %4 to i64*
store i64 %15, i64* %16
%17 = bitcast %struct.TYPE_3__* %2 to i8*
%18 = bitcast %struct.TYPE_3__* %4 to i8*
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 1
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Quotient part of (27/ 4) = %d\0A\00"
@.str.1 = [31 x i8] c"Remainder part of (27/4) = %d\0A\00"
@.str.2 = [31 x i8] c"Quotient part of (27/ 3) = %d\0A\00"
@.str.3 = [31 x i8] c"Remainder part of (27/3) = %d\0A\00"
define i32 @main() {
%1 = tail call i64 @div(i32 27, i32 4)
%2 = trunc i64 %1 to i32
%3 = lshr i64 %1, 32
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%7 = tail call i64 @div(i32 27, i32 3)
%8 = trunc i64 %7 to i32
%9 = lshr i64 %7, 32
%10 = trunc i64 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %10)
ret i32 0
}