#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 */
int /*<<< orphan*/ assertTrue(char *, int);
TYPE_1__ div(int, int);
void test() {
  div_t result;
  result = div(27, 4);
  assertTrue("result.quot == 6", result.quot == 6);
  ;
  assertTrue("result.rem == 3", result.rem == 3);
  ;
  result = div(27, 3);
  assertTrue("result.quot == 9", result.quot == 9);
  ;
  assertTrue("result.rem == 0", result.rem == 0);
  ;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1b,%edi
mov    $0x4,%esi
call   1040 <div@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeaa(%rip),%rdi
call   1030 <assertTrue@plt>
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xea3(%rip),%rdi
call   1030 <assertTrue@plt>
mov    $0x1b,%edi
mov    $0x3,%esi
call   1040 <div@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe80(%rip),%rdi
call   1030 <assertTrue@plt>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe79(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    $0x1b,%edi
mov    $0x4,%esi
call   1040 <div@plt>
mov    %rax,%rbx
xor    %esi,%esi
cmp    $0x6,%ebx
sete   %sil
lea    0xebd(%rip),%rdi
call   1030 <assertTrue@plt>
shr    $0x20,%rbx
xor    %esi,%esi
cmp    $0x3,%ebx
sete   %sil
lea    0xeb5(%rip),%rdi
call   1030 <assertTrue@plt>
mov    $0x1b,%edi
mov    $0x3,%esi
call   1040 <div@plt>
mov    %rax,%rbx
xor    %esi,%esi
cmp    $0x9,%ebx
sete   %sil
lea    0xe9e(%rip),%rdi
call   1030 <assertTrue@plt>
xor    %esi,%esi
shr    $0x20,%rbx
sete   %sil
lea    0xe99(%rip),%rdi
pop    %rbx
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@.str = [17 x i8] c"result.quot == 6\00"
@.str.1 = [16 x i8] c"result.rem == 3\00"
@.str.2 = [17 x i8] c"result.quot == 9\00"
@.str.3 = [16 x i8] c"result.rem == 0\00"
define void @test() {
%1 = alloca %struct.TYPE_3__
%2 = alloca %struct.TYPE_3__
%3 = alloca %struct.TYPE_3__
%4 = call i64 @div(i32 27, i32 4)
%5 = bitcast %struct.TYPE_3__* %2 to i64*
store i64 %4, i64* %5
%6 = bitcast %struct.TYPE_3__* %1 to i8*
%7 = bitcast %struct.TYPE_3__* %2 to i8*
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i32 0, i32 0
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 6
%11 = zext i1 %10 to i32
%12 = call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i32 0, i32 1
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 3
%16 = zext i1 %15 to i32
%17 = call i32 @assertTrue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = call i64 @div(i32 27, i32 3)
%19 = bitcast %struct.TYPE_3__* %3 to i64*
store i64 %18, i64* %19
%20 = bitcast %struct.TYPE_3__* %1 to i8*
%21 = bitcast %struct.TYPE_3__* %3 to i8*
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i32 0, i32 0
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 9
%25 = zext i1 %24 to i32
%26 = call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i32 0, i32 1
%28 = load i32, i32* %27
%29 = icmp eq i32 %28, 0
%30 = zext i1 %29 to i32
%31 = call i32 @assertTrue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %30)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"result.quot == 6\00"
@.str.1 = [16 x i8] c"result.rem == 3\00"
@.str.2 = [17 x i8] c"result.quot == 9\00"
@.str.3 = [16 x i8] c"result.rem == 0\00"
define void @test() {
%1 = tail call i64 @div(i32 27, i32 4)
%2 = trunc i64 %1 to i32
%3 = icmp eq i32 %2, 6
%4 = zext i1 %3 to i32
%5 = tail call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = and i64 %1, -4294967296
%7 = icmp eq i64 %6, 12884901888
%8 = zext i1 %7 to i32
%9 = tail call i32 @assertTrue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = tail call i64 @div(i32 27, i32 3)
%11 = trunc i64 %10 to i32
%12 = icmp eq i32 %11, 9
%13 = zext i1 %12 to i32
%14 = tail call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = icmp ult i64 %10, 4294967296
%16 = zext i1 %15 to i32
%17 = tail call i32 @assertTrue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %16)
ret void
}