#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*/ dibujar(char *, int, int);
int getRandomNum(int);
void getDegrees() {
  int randomNum = getRandomNum(10);
  if (randomNum < 2)
    dibujar("degrees.png", 80 * 0, 243);
  else if ((randomNum >= 2) && (randomNum < 4))
    dibujar("degrees.png", 80 * 1, 243);
  else if (randomNum == 4)
    dibujar("degrees.png", 80 * 2, 243);
  else if (randomNum == 5)
    dibujar("degrees.png", 80 * 3, 243);
  else if ((randomNum >= 6) && (randomNum < 8))
    dibujar("degrees.png", 80 * 4, 243);
  else if ((randomNum >= 8) && (randomNum < 10))
    dibujar("degrees.png", 80 * 5, 243);
}


x86 assembly (clang, -O0):
<getDegrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <getRandomNum@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1157 <getDegrees+0x37>
lea    0xeba(%rip),%rdi
xor    %esi,%esi
mov    $0xf3,%edx
call   1040 <dibujar@plt>
jmp    1242 <getDegrees+0x122>
cmpl   $0x2,-0x4(%rbp)
jl     1186 <getDegrees+0x66>
cmpl   $0x4,-0x4(%rbp)
jge    1186 <getDegrees+0x66>
lea    0xe8e(%rip),%rdi
mov    $0x50,%esi
mov    $0xf3,%edx
call   1040 <dibujar@plt>
jmp    123d <getDegrees+0x11d>
cmpl   $0x4,-0x4(%rbp)
jne    11ab <getDegrees+0x8b>
lea    0xe69(%rip),%rdi
mov    $0xa0,%esi
mov    $0xf3,%edx
call   1040 <dibujar@plt>
jmp    1238 <getDegrees+0x118>
cmpl   $0x5,-0x4(%rbp)
jne    11d0 <getDegrees+0xb0>
lea    0xe44(%rip),%rdi
mov    $0xf0,%esi
mov    $0xf3,%edx
call   1040 <dibujar@plt>
jmp    1233 <getDegrees+0x113>
cmpl   $0x6,-0x4(%rbp)
jl     11ff <getDegrees+0xdf>
cmpl   $0x8,-0x4(%rbp)
jge    11ff <getDegrees+0xdf>
lea    0xe15(%rip),%rdi
mov    $0x140,%esi
mov    $0xf3,%edx
call   1040 <dibujar@plt>
jmp    122e <getDegrees+0x10e>
cmpl   $0x8,-0x4(%rbp)
jl     1229 <getDegrees+0x109>
cmpl   $0xa,-0x4(%rbp)
jge    1229 <getDegrees+0x109>
lea    0xde6(%rip),%rdi
mov    $0x190,%esi
mov    $0xf3,%edx
call   1040 <dibujar@plt>
jmp    122e <getDegrees+0x10e>
jmp    1233 <getDegrees+0x113>
jmp    1238 <getDegrees+0x118>
jmp    123d <getDegrees+0x11d>
jmp    1242 <getDegrees+0x122>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDegrees>:
push   %rax
mov    $0xa,%edi
call   1030 <getRandomNum@plt>
xor    %esi,%esi
cmp    $0x2,%eax
jl     1165 <getDegrees+0x45>
mov    $0x50,%esi
cmp    $0x4,%eax
jb     1165 <getDegrees+0x45>
je     114a <getDegrees+0x2a>
cmp    $0x5,%eax
jne    1151 <getDegrees+0x31>
mov    $0xf0,%esi
jmp    1165 <getDegrees+0x45>
mov    $0xa0,%esi
jmp    1165 <getDegrees+0x45>
mov    $0x140,%esi
cmp    $0x8,%eax
jb     1165 <getDegrees+0x45>
mov    $0x190,%esi
cmp    $0x9,%eax
ja     1177 <getDegrees+0x57>
lea    0xe94(%rip),%rdi
mov    $0xf3,%edx
pop    %rax
jmp    1040 <dibujar@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"degrees.png\00"
define void @getDegrees() {
%1 = alloca i32
%2 = call i32 @getRandomNum(i32 10)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @dibujar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 0, i32 243)
br label %46
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp sge i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @dibujar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 80, i32 243)
br label %45
15: ; preds = %10, %7
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 4
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @dibujar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 160, i32 243)
br label %44
20: ; preds = %15
%21 = load i32, i32* %1
%22 = icmp eq i32 %21, 5
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @dibujar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 240, i32 243)
br label %43
25: ; preds = %20
%26 = load i32, i32* %1
%27 = icmp sge i32 %26, 6
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load i32, i32* %1
%30 = icmp slt i32 %29, 8
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @dibujar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 320, i32 243)
br label %42
33: ; preds = %28, %25
%34 = load i32, i32* %1
%35 = icmp sge i32 %34, 8
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load i32, i32* %1
%38 = icmp slt i32 %37, 10
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @dibujar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 400, i32 243)
br label %41
41: ; preds = %39, %36, %33
br label %42
42: ; preds = %41, %31
br label %43
43: ; preds = %42, %23
br label %44
44: ; preds = %43, %18
br label %45
45: ; preds = %44, %13
br label %46
46: ; preds = %45, %5
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"degrees.png\00"
define void @getDegrees() {
%1 = tail call i32 @getRandomNum(i32 10)
%2 = icmp slt i32 %1, 2
br i1 %2, label %11, label %3
3: ; preds = %0
%4 = icmp ult i32 %1, 4
br i1 %4, label %11, label %5
5: ; preds = %3
switch i32 %1, label %7 [
i32 4, label %11
i32 5, label %6
]
6: ; preds = %5
br label %11
7: ; preds = %5
%8 = icmp ult i32 %1, 8
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = icmp ult i32 %1, 10
br i1 %10, label %11, label %14
11: ; preds = %9, %7, %5, %3, %0, %6
%12 = phi i32 [ 240, %6 ], [ 0, %0 ], [ 80, %3 ], [ 160, %5 ], [ 320, %7 ], [ 400, %9 ]
%13 = tail call i32 @dibujar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %12, i32 243)
br label %14
14: ; preds = %11, %9
ret void
}