#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 divisionby30(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int divisor = 180000;
  int div = 30;
  int result = divisor / div;
  int reuslt2 = divisionby30(divisor);
  if (result == reuslt2) {
    printf("\nJa");
  } else {
    printf("\nResult: %d\n", result);
    printf("Function: %d\n", reuslt2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2bf20,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <divisionby30@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1171 <main+0x51>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1193 <main+0x73>
mov    -0x10(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2bf20,%edi
call   1040 <divisionby30@plt>
cmp    $0x1770,%eax
jne    1142 <main+0x22>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1167 <main+0x47>
mov    %eax,%ebx
lea    0xeb9(%rip),%rdi
mov    $0x1770,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0AJa\00"
@.str.1 = [13 x i8] c"\0AResult: %d\0A\00"
@.str.2 = [14 x i8] c"Function: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 180000, i32* %2
store i32 30, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sdiv i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = call i32 @divisionby30(i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %21
16: ; preds = %0
%17 = load i32, i32* %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %16, %14
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0AJa\00"
@.str.1 = [13 x i8] c"\0AResult: %d\0A\00"
@.str.2 = [14 x i8] c"Function: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @divisionby30(i32 180000)
%2 = icmp eq i32 %1, 6000
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 6000)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %5, %3
ret i32 0
}