#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(char *, int *);
int main() {
  int i, sayi1, sayi2;
  int obeb;
  printf("Enter first number: ");
  scanf("%d", &sayi1);
  printf("Enter second number: ");
  scanf("%d", &sayi2);
  int min;
  if (sayi1 < sayi2) {
    min = sayi1;
  } else if (sayi2 < sayi1) {
    min = sayi2;
  }
  int test1, test2;
  for (i = min; i > 0; i--) {
    test1 = sayi1 % i;
    test2 = sayi2 % i;
    if (test1 == 0 && test2 == 0) {
      printf("obeb(ebob): %d\n", i);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <main+0x62>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1199 <main+0x79>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1194 <main+0x74>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1199 <main+0x79>
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11fa <main+0xda>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    11e7 <main+0xc7>
cmpl   $0x0,-0x20(%rbp)
jne    11e7 <main+0xc7>
mov    -0x8(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fa <main+0xda>
jmp    11ec <main+0xcc>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    119f <main+0x7f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%edi
cmp    %edi,%ecx
mov    %edi,%esi
cmovl  %ecx,%esi
test   %esi,%esi
jle    11aa <main+0x8a>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
cltd
idiv   %esi
mov    %edx,%ebx
mov    %edi,%eax
cltd
idiv   %esi
or     %ebx,%edx
je     119c <main+0x7c>
lea    -0x1(%rsi),%eax
cmp    $0x1,%esi
mov    %eax,%esi
jg     1180 <main+0x60>
jmp    11aa <main+0x8a>
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter first number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Enter second number: \00"
@.str.3 = [16 x i8] c"obeb(ebob): %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = load i32, i32* %3
store i32 %17, i32* %6
br label %25
18: ; preds = %0
%19 = load i32, i32* %4
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load i32, i32* %4
store i32 %23, i32* %6
br label %24
24: ; preds = %22, %18
br label %25
25: ; preds = %24, %16
%26 = load i32, i32* %6
store i32 %26, i32* %2
br label %27
27: ; preds = %46, %25
%28 = load i32, i32* %2
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %49
30: ; preds = %27
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = srem i32 %31, %32
store i32 %33, i32* %7
%34 = load i32, i32* %4
%35 = load i32, i32* %2
%36 = srem i32 %34, %35
store i32 %36, i32* %8
%37 = load i32, i32* %7
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %45
39: ; preds = %30
%40 = load i32, i32* %8
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load i32, i32* %2
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %43)
br label %49
45: ; preds = %39, %30
br label %46
46: ; preds = %45
%47 = load i32, i32* %2
%48 = add nsw i32 %47, -1
store i32 %48, i32* %2
br label %27
49: ; preds = %42, %27
%50 = load i32, i32* %1
ret i32 %50
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter first number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Enter second number: \00"
@.str.3 = [16 x i8] c"obeb(ebob): %d\0A\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(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 ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(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 = icmp slt i32 %9, %10
%12 = icmp slt i32 %10, %9
%13 = select i1 %12, i32 %10, i32 undef
%14 = select i1 %11, i32 %9, i32 %13
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %0, %25
%17 = phi i32 [ %26, %25 ], [ %14, %0 ]
%18 = srem i32 %9, %17
%19 = srem i32 %10, %17
%20 = icmp eq i32 %18, 0
%21 = icmp eq i32 %19, 0
%22 = select i1 %20, i1 %21, i1 false
br i1 %22, label %23, label %25
23: ; preds = %16
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %17)
br label %28
25: ; preds = %16
%26 = add nsw i32 %17, -1
%27 = icmp sgt i32 %17, 1
br i1 %27, label %16, label %28
28: ; preds = %25, %0, %23
ret i32 0
}