#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*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int num;
  int x;
  int y;
  int z;
  char c;
  x = 3;
  y = 5;
  z = 15;
  c = '<';
  num = z / y;
  print_string("Should get 3\nGot: ");
  print_int(num);
  print_string("\n");
  num = c / z;
  print_string("Should get 4\nGot: ");
  print_int(num);
  print_string("\n");
  num = x + 8 * y;
  print_string("Should get 43\nGot: ");
  print_int(num);
  print_string("\n");
  num = x * z / y;
  print_string("Should get 9\nGot: ");
  print_int(num);
  print_string("\n");
  num = (c + z) / z;
  print_string("Should get 5\nGot: ");
  print_int(num);
  print_string("\n");
  num = 2 * (x - 2);
  print_string("Should get 2\nGot: ");
  print_int(num);
  print_string("\n");
  num = z + c + z - 45 / x;
  print_string("Should get 75\nGot: ");
  print_int(num);
  print_string("\n");
  num = (z * 3) / ((2 * z - x * (y + y - y)) * x) + z + z;
  print_string("Should get 31\nGot: ");
  print_int(num);
  print_string("\n");
  num = (z / z) * (x + x) + x;
  print_string("Should get 9\nGot: ");
  print_int(num);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x3,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0xf,-0x10(%rbp)
movb   $0x3c,-0x11(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xead(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x11(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xe98(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe82(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
lea    0xe7d(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe54(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xe63(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe26(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x11(%rbp),%eax
add    -0x10(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xe48(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xdf8(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe2f(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xdcc(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x10(%rbp),%eax
movsbl -0x11(%rbp),%ecx
add    %ecx,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x2d,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
lea    0xe00(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xd8a(%rip),%rdi
call   1030 <print_string@plt>
imul   $0x3,-0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%esi
add    -0xc(%rbp),%esi
sub    -0xc(%rbp),%esi
imul   %esi,%edx
sub    %edx,%ecx
imul   -0x8(%rbp),%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    0xdc9(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xd3f(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    -0x8(%rbp),%ecx
add    -0x8(%rbp),%ecx
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    0xd46(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xd09(%rip),%rdi
call   1030 <print_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x3,%edi
call   1040 <print_int@plt>
lea    0xed2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xec5(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x4,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xeba(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x2b,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xeb0(%rip),%r14
mov    %r14,%rdi
call   1030 <print_string@plt>
mov    $0x9,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xea2(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x5,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xe97(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x2,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xe8c(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x4b,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xe82(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x1f,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
mov    %r14,%rdi
call   1030 <print_string@plt>
mov    $0x9,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Should get 3\0AGot: \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [19 x i8] c"Should get 4\0AGot: \00"
@.str.3 = [20 x i8] c"Should get 43\0AGot: \00"
@.str.4 = [19 x i8] c"Should get 9\0AGot: \00"
@.str.5 = [19 x i8] c"Should get 5\0AGot: \00"
@.str.6 = [19 x i8] c"Should get 2\0AGot: \00"
@.str.7 = [20 x i8] c"Should get 75\0AGot: \00"
@.str.8 = [20 x i8] c"Should get 31\0AGot: \00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 3, i32* %2
store i32 5, i32* %3
store i32 15, i32* %4
store i8 60, i8* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sdiv i32 %6, %7
store i32 %8, i32* %1
%9 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = call i32 @print_int(i32 %10)
%12 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = load i32, i32* %4
%16 = sdiv i32 %14, %15
store i32 %16, i32* %1
%17 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* %1
%19 = call i32 @print_int(i32 %18)
%20 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = mul nsw i32 8, %22
%24 = add nsw i32 %21, %23
store i32 %24, i32* %1
%25 = call i32 @print_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%26 = load i32, i32* %1
%27 = call i32 @print_int(i32 %26)
%28 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* %2
%30 = load i32, i32* %4
%31 = mul nsw i32 %29, %30
%32 = load i32, i32* %3
%33 = sdiv i32 %31, %32
store i32 %33, i32* %1
%34 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%35 = load i32, i32* %1
%36 = call i32 @print_int(i32 %35)
%37 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%38 = load i8, i8* %5
%39 = sext i8 %38 to i32
%40 = load i32, i32* %4
%41 = add nsw i32 %39, %40
%42 = load i32, i32* %4
%43 = sdiv i32 %41, %42
store i32 %43, i32* %1
%44 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%45 = load i32, i32* %1
%46 = call i32 @print_int(i32 %45)
%47 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%48 = load i32, i32* %2
%49 = sub nsw i32 %48, 2
%50 = mul nsw i32 2, %49
store i32 %50, i32* %1
%51 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%52 = load i32, i32* %1
%53 = call i32 @print_int(i32 %52)
%54 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%55 = load i32, i32* %4
%56 = load i8, i8* %5
%57 = sext i8 %56 to i32
%58 = add nsw i32 %55, %57
%59 = load i32, i32* %4
%60 = add nsw i32 %58, %59
%61 = load i32, i32* %2
%62 = sdiv i32 45, %61
%63 = sub nsw i32 %60, %62
store i32 %63, i32* %1
%64 = call i32 @print_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%65 = load i32, i32* %1
%66 = call i32 @print_int(i32 %65)
%67 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%68 = load i32, i32* %4
%69 = mul nsw i32 %68, 3
%70 = load i32, i32* %4
%71 = mul nsw i32 2, %70
%72 = load i32, i32* %2
%73 = load i32, i32* %3
%74 = load i32, i32* %3
%75 = add nsw i32 %73, %74
%76 = load i32, i32* %3
%77 = sub nsw i32 %75, %76
%78 = mul nsw i32 %72, %77
%79 = sub nsw i32 %71, %78
%80 = load i32, i32* %2
%81 = mul nsw i32 %79, %80
%82 = sdiv i32 %69, %81
%83 = load i32, i32* %4
%84 = add nsw i32 %82, %83
%85 = load i32, i32* %4
%86 = add nsw i32 %84, %85
store i32 %86, i32* %1
%87 = call i32 @print_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%88 = load i32, i32* %1
%89 = call i32 @print_int(i32 %88)
%90 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%91 = load i32, i32* %4
%92 = load i32, i32* %4
%93 = sdiv i32 %91, %92
%94 = load i32, i32* %2
%95 = load i32, i32* %2
%96 = add nsw i32 %94, %95
%97 = mul nsw i32 %93, %96
%98 = load i32, i32* %2
%99 = add nsw i32 %97, %98
store i32 %99, i32* %1
%100 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%101 = load i32, i32* %1
%102 = call i32 @print_int(i32 %101)
%103 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Should get 3\0AGot: \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [19 x i8] c"Should get 4\0AGot: \00"
@.str.3 = [20 x i8] c"Should get 43\0AGot: \00"
@.str.4 = [19 x i8] c"Should get 9\0AGot: \00"
@.str.5 = [19 x i8] c"Should get 5\0AGot: \00"
@.str.6 = [19 x i8] c"Should get 2\0AGot: \00"
@.str.7 = [20 x i8] c"Should get 75\0AGot: \00"
@.str.8 = [20 x i8] c"Should get 31\0AGot: \00"
define void @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_int(i32 3)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @print_int(i32 4)
%6 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @print_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @print_int(i32 43)
%9 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @print_int(i32 9)
%12 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%14 = tail call i32 @print_int(i32 5)
%15 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%17 = tail call i32 @print_int(i32 2)
%18 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = tail call i32 @print_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%20 = tail call i32 @print_int(i32 75)
%21 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 @print_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%23 = tail call i32 @print_int(i32 31)
%24 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%25 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%26 = tail call i32 @print_int(i32 9)
%27 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}