#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*/ printf(char *);
div_t div(int numer, int denom) {
  div_t result;
  if (numer == 99 && denom == 99) {
    printf("\nValues are 99 and 99");
    result.quot = 100;
    result.rem = 100;
    return result;
  }
  result.quot = numer / denom;
  result.rem = numer % denom;
  return result;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x63,-0xc(%rbp)
jne    1151 <div+0x41>
cmpl   $0x63,-0x10(%rbp)
jne    1151 <div+0x41>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x64,-0x8(%rbp)
movl   $0x64,-0x4(%rbp)
jmp    1165 <div+0x55>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
cmp    $0x63,%edi
jne    1136 <div+0x26>
cmp    $0x63,%esi
jne    1136 <div+0x26>
push   %rax
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movabs $0x6400000064,%rax
add    $0x8,%rsp
ret
mov    %edi,%eax
cltd
idiv   %esi
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@.str = [22 x i8] c"\0AValues are 99 and 99\00"
define i64 @div(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 99
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 99
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 100, i32* %13
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i32 100, i32* %14
br label %24
15: ; preds = %8, %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sdiv i32 %16, %17
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 %18, i32* %19
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = srem i32 %20, %21
%23 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i32 %22, i32* %23
br label %24
24: ; preds = %15, %11
%25 = bitcast %struct.TYPE_3__* %3 to i64*
%26 = load i64, i64* %25
ret i64 %26
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0AValues are 99 and 99\00"
define i64 @div(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 99
%4 = icmp eq i32 %1, 99
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %15
8: ; preds = %2
%9 = sdiv i32 %0, %1
%10 = srem i32 %0, %1
%11 = zext i32 %10 to i64
%12 = shl nuw i64 %11, 32
%13 = zext i32 %9 to i64
%14 = or i64 %12, %13
br label %15
15: ; preds = %8, %6
%16 = phi i64 [ %14, %8 ], [ 429496729700, %6 ]
ret i64 %16
}