#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 /*<<< orphan*/ scanf_s(char *, int *);
int /*<<< orphan*/ system(char *);
main() {
  int a, b;
  int kalan;
  printf("A sayisini giriniz: ");
  scanf_s("%d", &a);
  printf("B sayisini giriniz: ");
  scanf_s("%d", &b);
  kalan = (a % b);
  printf("Kalan: %d", kalan);
  printf("\n");
  if (kalan == 0)
    printf("&d , %d 'ye tam bolunur.\n", a, b);
  else
    printf("%d , %d 'ye tam bolunmez.\n", a, b);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf_s@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf_s@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
jne    11c7 <main+0x97>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11db <main+0xab>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed7(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf_s@plt>
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf_s@plt>
mov    0xc(%rsp),%eax
cltd
idivl  0x8(%rsp)
mov    %edx,%ebx
lea    0xe96(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xe7c(%rip),%rax
lea    0xe8f(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe98(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"A sayisini giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"B sayisini giriniz: \00"
@.str.3 = [10 x i8] c"Kalan: %d\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [26 x i8] c"&d , %d 'ye tam bolunur.\0A\00"
@.str.6 = [27 x i8] c"%d , %d 'ye tam bolunmez.\0A\00"
@.str.7 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = srem i32 %9, %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %0
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %18, i32 %19)
br label %25
21: ; preds = %0
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %22, i32 %23)
br label %25
25: ; preds = %21, %17
%26 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [21 x i8] c"A sayisini giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"B sayisini giriniz: \00"
@.str.3 = [10 x i8] c"Kalan: %d\00"
@.str.5 = [26 x i8] c"&d , %d 'ye tam bolunur.\0A\00"
@.str.6 = [27 x i8] c"%d , %d 'ye tam bolunmez.\0A\00"
@.str.7 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = srem i32 %9, %10
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = call i32 @putchar(i32 10)
%14 = icmp eq i32 %11, 0
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = select i1 %14, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %17, i32 %15, i32 %16)
%19 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}