xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x13() {
  Assert_real((isalpha(19) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              100, ("isalpha should be 0 for 0x13"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x13>:
push   %rbp
mov    %rsp,%rbp
mov    $0x13,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x64,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x13>:
push   %rax
mov    $0x13,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x64,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x13\00"
define void @t_isalpha_0x13() {
%1 = call i64 @isalpha(i32 19)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x13\00"
define void @t_isalpha_0x13() {
%1 = tail call i64 @isalpha(i32 19)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) int detexGetNumberOfComponents(uint32_t pixel_format) {
  return 1 + ((pixel_format & 0x30) >> 4);
}


x86 assembly (clang, -O0):
<detexGetNumberOfComponents>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x30,%eax
sar    $0x4,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<detexGetNumberOfComponents>:
shr    $0x4,%edi
and    $0x3,%edi
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @detexGetNumberOfComponents(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 48
%5 = ashr i32 %4, 4
%6 = add nsw i32 1, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @detexGetNumberOfComponents(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 3
%4 = add nuw nsw i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct sigcontext {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sigreturn(struct sigcontext *context) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__sigreturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sigreturn>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sigcontext = type { i32 }
@ENOSYS = global i32 0
define i32 @__sigreturn(%struct.sigcontext* %0) {
%2 = alloca %struct.sigcontext*
store %struct.sigcontext* %0, %struct.sigcontext** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
%struct.sigcontext = type { i32 }
@ENOSYS = global i32 0
define i32 @__sigreturn(%struct.sigcontext* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA(int, int);
void SetPanTiltMode(unsigned char UcPnTmod) {
  switch (UcPnTmod) {
  case 0x00:
    RegWriteA(0x0109, 0x00);
    break;
  case 0x01:
    RegWriteA(0x0109, 0x01);
    break;
  }
}


x86 assembly (clang, -O0):
<SetPanTiltMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1143 <SetPanTiltMode+0x33>
jmp    1132 <SetPanTiltMode+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1154 <SetPanTiltMode+0x44>
jmp    1163 <SetPanTiltMode+0x53>
mov    $0x109,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
jmp    1163 <SetPanTiltMode+0x53>
mov    $0x109,%edi
mov    $0x1,%esi
call   1030 <RegWriteA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPanTiltMode>:
test   %edi,%edi
je     1129 <SetPanTiltMode+0x19>
cmp    $0x1,%dil
jne    1135 <SetPanTiltMode+0x25>
mov    $0x1,%esi
mov    $0x109,%edi
jmp    1030 <RegWriteA@plt>
xor    %esi,%esi
mov    $0x109,%edi
jmp    1030 <RegWriteA@plt>
ret

LLVM IR (-O0):
define void @SetPanTiltMode(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %7
]
5: ; preds = %1
%6 = call i32 @RegWriteA(i32 265, i32 0)
br label %9
7: ; preds = %1
%8 = call i32 @RegWriteA(i32 265, i32 1)
br label %9
9: ; preds = %1, %7, %5
ret void
}

LLVM IR (-O2):
define void @SetPanTiltMode(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 0, label %3
i8 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ]
%5 = tail call i32 @RegWriteA(i32 265, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_44_neg();
void z80_ed_64_neg(void) { z80_ed_44_neg(); }


x86 assembly (clang, -O0):
<z80_ed_64_neg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <z80_ed_44_neg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<z80_ed_64_neg>:
xor    %eax,%eax
jmp    1030 <z80_ed_44_neg@plt>

LLVM IR (-O0):
define void @z80_ed_64_neg() {
%1 = call i32 (...) @z80_ed_44_neg()
ret void
}

LLVM IR (-O2):
define void @z80_ed_64_neg() {
%1 = tail call i32 (...) @z80_ed_44_neg()
ret void
}
int main(void) {
  char hello[20] = "Hello, ";
  char world[20] = "World!";
  char helend[20] = "o, ";
  char nhelend[20] = "o. ";
  char cmphello[20] = "Helooo?";
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xee6(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xee7(%rip),%eax
mov    %eax,-0x50(%rbp)
mov    0xeed(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xee8(%rip),%eax
mov    %eax,-0x70(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0xee3(%rip),%eax
mov    %eax,-0x90(%rbp)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
@__const.main.hello = [20 x i8] c"Hello, \00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.world = [20 x i8] c"World!\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.helend = [20 x i8] c"o, \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.nhelend = [20 x i8] c"o. \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.cmphello = [20 x i8] c"Helooo?\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
%5 = alloca [20 x i8]
%6 = alloca [20 x i8]
store i32 0, i32* %1
%7 = bitcast [20 x i8]* %2 to i8*
%8 = bitcast [20 x i8]* %3 to i8*
%9 = bitcast [20 x i8]* %4 to i8*
%10 = bitcast [20 x i8]* %5 to i8*
%11 = bitcast [20 x i8]* %6 to i8*
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
bool brw_is_single_value_swizzle(int swiz) {
  return (swiz == (((0) << 0) | ((0) << 2) | ((0) << 4) | ((0) << 6)) ||
          swiz == (((1) << 0) | ((1) << 2) | ((1) << 4) | ((1) << 6)) ||
          swiz == (((2) << 0) | ((2) << 2) | ((2) << 4) | ((2) << 6)) ||
          swiz == (((3) << 0) | ((3) << 2) | ((3) << 4) | ((3) << 6)));
}


x86 assembly (clang, -O0):
<brw_is_single_value_swizzle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <brw_is_single_value_swizzle+0x44>
mov    $0x1,%al
cmpl   $0x55,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <brw_is_single_value_swizzle+0x44>
mov    $0x1,%al
cmpl   $0xaa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <brw_is_single_value_swizzle+0x44>
cmpl   $0xff,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brw_is_single_value_swizzle>:
mov    $0x1,%eax
test   %edi,%edi
je     1121 <brw_is_single_value_swizzle+0x21>
cmp    $0x55,%edi
je     1121 <brw_is_single_value_swizzle+0x21>
cmp    $0xaa,%edi
je     1121 <brw_is_single_value_swizzle+0x21>
xor    %eax,%eax
cmp    $0xff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @brw_is_single_value_swizzle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 85
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 170
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 255
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @brw_is_single_value_swizzle(i32 %0) {
switch i32 %0, label %2 [
i32 170, label %5
i32 85, label %5
i32 0, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 255
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int nmea_cksum(const char *const buf) {
  int x = 0;
  const char *p;
  for (p = buf; *p; p++) {
    x ^= *p;
  }
  return x;
}


x86 assembly (clang, -O0):
<nmea_cksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <nmea_cksum+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <nmea_cksum+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmea_cksum>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <nmea_cksum+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <nmea_cksum+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nmea_cksum(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %16, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i32, i32* %3
%15 = xor i32 %14, %13
store i32 %15, i32* %3
br label %16
16: ; preds = %10
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
br label %6
19: ; preds = %6
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @nmea_cksum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = xor i32 %7, %8
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %14
}
int start_dht() {}


x86 assembly (clang, -O0):
<start_dht>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_dht>:
ret

LLVM IR (-O0):
define i32 @start_dht() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @start_dht() {
ret i32 undef
}
/* Variables and functions */
double boatAreaTest(float, float);
int /*<<< orphan*/ printf(char *, float, float);
int collisionTest(float x, float z) {
  if (boatAreaTest(x, z) < 1.0) {
    return 1;
  } else {
    printf("on the loan, %f, %f\n", x, z);
    return 0;
  }
}


x86 assembly (clang, -O0):
<collisionTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <boatAreaTest@plt>
movaps %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1162 <collisionTest+0x42>
movl   $0x1,-0x4(%rbp)
jmp    117f <collisionTest+0x5f>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collisionTest>:
push   %rax
movss  %xmm0,(%rsp)
movss  %xmm1,0x4(%rsp)
call   1040 <boatAreaTest@plt>
mov    $0x1,%eax
movsd  0xec2(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     115d <collisionTest+0x3d>
lea    0xebd(%rip),%rdi
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"on the loan, %f, %f\0A\00"
define i32 @collisionTest(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = call double @boatAreaTest(float %6, float %7)
%9 = fcmp olt double %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %15
11: ; preds = %2
%12 = load float, float* %4
%13 = load float, float* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %12, float %13)
store i32 0, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [21 x i8] c"on the loan, %f, %f\0A\00"
define i32 @collisionTest(float %0, float %1) {
%3 = tail call double @boatAreaTest(float %0, float %1)
%4 = fcmp olt double %3, 1.000000e+00
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %0, float %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void sig_handler(int signum) {
  printf("capture signal %d and break...\n", signum);
  exit(1);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"capture signal %d and break...\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"capture signal %d and break...\0A\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int u8_wc_nbytes(unsigned int ch) {
  if (ch < 0x80)
    return 1;
  if (ch < 0x800)
    return 2;
  if (ch < 0x10000)
    return 3;
  if (ch < 0x200000)
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<u8_wc_nbytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jae    1120 <u8_wc_nbytes+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1172 <u8_wc_nbytes+0x72>
cmpl   $0x800,-0x8(%rbp)
jae    1139 <u8_wc_nbytes+0x39>
movl   $0x2,-0x4(%rbp)
jmp    1172 <u8_wc_nbytes+0x72>
cmpl   $0x10000,-0x8(%rbp)
jae    1152 <u8_wc_nbytes+0x52>
movl   $0x3,-0x4(%rbp)
jmp    1172 <u8_wc_nbytes+0x72>
cmpl   $0x200000,-0x8(%rbp)
jae    116b <u8_wc_nbytes+0x6b>
movl   $0x4,-0x4(%rbp)
jmp    1172 <u8_wc_nbytes+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_wc_nbytes>:
mov    $0x1,%eax
cmp    $0x80,%edi
jb     1135 <u8_wc_nbytes+0x35>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1135 <u8_wc_nbytes+0x35>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1135 <u8_wc_nbytes+0x35>
xor    %eax,%eax
cmp    $0x200000,%edi
setb   %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @u8_wc_nbytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 2048
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ult i32 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp ult i32 %16, 2097152
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %20
19: ; preds = %15
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @u8_wc_nbytes(i32 %0) {
%2 = icmp ult i32 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 2097152
%9 = select i1 %8, i32 4, i32 0
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("HELLO,WORLD\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"HELLO,WORLD\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"HELLO,WORLD\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int fun416() { return 416; }


x86 assembly (clang, -O0):
<fun416>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun416>:
mov    $0x1a0,%eax
ret

LLVM IR (-O0):
define i32 @fun416() {
ret i32 416
}

LLVM IR (-O2):
define i32 @fun416() {
ret i32 416
}
/* Variables and functions */
int getuid();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("uid: %d\n", getuid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"uid: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getuid()
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"uid: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_write(int, char *, size_t);
int send(int, void const *, size_t, int /*<<< orphan*/);
int c_write(int fd, const void *buf, size_t count) {
  log_write(fd, (char *)buf, count);
  return send(fd, buf, count, 0);
}


x86 assembly (clang, -O0):
<c_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <log_write@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_write>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <log_write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <send@plt>

LLVM IR (-O0):
define i32 @c_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @log_write(i32 %7, i8* %8, i64 %9)
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @send(i32 %11, i8* %12, i64 %13, i32 0)
ret i32 %14
}

LLVM IR (-O2):
define i32 @c_write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @log_write(i32 %0, i8* %1, i64 %2)
%5 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void idle(void) { glutPostRedisplay(); }


x86 assembly (clang, -O0):
<idle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<idle>:
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>

LLVM IR (-O0):
define void @idle() {
%1 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @idle() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int gob_start_struct(char *buf, size_t buf_size) { return 0; }


x86 assembly (clang, -O0):
<gob_start_struct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gob_start_struct>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @gob_start_struct(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @gob_start_struct(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ const *checkret(int /*<<< orphan*/);
const wchar_t *stfl_error() {
  abort();
  return checkret(0);
}


x86 assembly (clang, -O0):
<stfl_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<stfl_error>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32* @stfl_error() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define noalias i32* @stfl_error() {
%1 = tail call i32 (...) @abort()
unreachable
}
void bitmap_set_bit(unsigned long *bitmap, unsigned int bit) {
  bitmap[((bit) / (sizeof(long) * 8))] |=
      (0x1ul << ((bit) % (sizeof(long) * 8)));
}


x86 assembly (clang, -O0):
<bitmap_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x6,%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_set_bit>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%eax
mov    $0x1,%edx
shl    %cl,%rdx
and    $0xfffffff8,%eax
or     %rdx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @bitmap_set_bit(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = zext i32 %5 to i64
%7 = urem i64 %6, 64
%8 = shl i64 1, %7
%9 = load i64*, i64** %3
%10 = load i32, i32* %4
%11 = zext i32 %10 to i64
%12 = udiv i64 %11, 64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load i64, i64* %13
%15 = or i64 %14, %8
store i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @bitmap_set_bit(i64* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = or i64 %8, %5
store i64 %9, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
main() {
  system("ls");
  system("pwd");
  system("cal");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
lea    0xedc(%rip),%rdi
call   1030 <system@plt>
lea    0xed4(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xedf(%rip),%rdi
call   1030 <system@plt>
lea    0xed7(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"pwd\00"
@.str.2 = [4 x i8] c"cal\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"pwd\00"
@.str.2 = [4 x i8] c"cal\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getenv(int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_lstr(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ lua_pushstring(int /*<<< orphan*/);
void io_getenv(void) { lua_pushstring(getenv((luaL_check_lstr((1), NULL)))); }


x86 assembly (clang, -O0):
<io_getenv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <luaL_check_lstr@plt>
mov    %eax,%edi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <lua_pushstring@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_getenv>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <luaL_check_lstr@plt>
mov    %eax,%edi
call   1030 <getenv@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushstring@plt>

LLVM IR (-O0):
define void @io_getenv() {
%1 = call i32 @luaL_check_lstr(i32 1, i32* null)
%2 = call i32 @getenv(i32 %1)
%3 = call i32 @lua_pushstring(i32 %2)
ret void
}

LLVM IR (-O2):
define void @io_getenv() {
%1 = tail call i32 @luaL_check_lstr(i32 1, i32* null)
%2 = tail call i32 @getenv(i32 %1)
%3 = tail call i32 @lua_pushstring(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI_SetupMode(int, int /*<<< orphan*/);
int /*<<< orphan*/ farm_close();
int farm_open();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int farm_fd = 0;
  int adcValue = 0;
  int adcChannel = 1;
  farm_fd = farm_open();
  printf("Farm FD: %d\n", farm_fd);
  SPI_SetupMode(8000000, 0);
  farm_close();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    $0x0,%al
call   1050 <farm_open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7a1200,%edi
xor    %esi,%esi
call   1040 <SPI_SetupMode@plt>
mov    $0x0,%al
call   1060 <farm_close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <farm_open@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x7a1200,%edi
xor    %esi,%esi
call   1040 <SPI_SetupMode@plt>
xor    %eax,%eax
call   1060 <farm_close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Farm FD: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
%5 = call i32 (...) @farm_open()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @SPI_SetupMode(i32 8000000, i32 0)
%9 = call i32 (...) @farm_close()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Farm FD: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @farm_open()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @SPI_SetupMode(i32 8000000, i32 0)
%4 = tail call i32 (...) @farm_close()
ret i32 0
}
/* Variables and functions */
double NAN;
double sqrt(double);
double piemathSqrt(double a) {
  if (a < 0) {
    return NAN;
  }
  return sqrt(a);
}


x86 assembly (clang, -O0):
<piemathSqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1140 <piemathSqrt+0x30>
mov    0x2ec6(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114f <piemathSqrt+0x3f>
movsd  -0x10(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piemathSqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1126 <piemathSqrt+0x16>
mov    0x2ed7(%rip),%rax
movsd  (%rax),%xmm0
ret
ucomisd %xmm1,%xmm0
jb     1131 <piemathSqrt+0x21>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
@NAN = global double 0.000000e+00
define double @piemathSqrt(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* @NAN
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = call double @sqrt(double %9)
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
@NAN = global double 0.000000e+00
define double @piemathSqrt(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load double, double* @NAN
br label %7
5: ; preds = %1
%6 = tail call double @sqrt(double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
/* Variables and functions */
int errno;
int scarab_os_geterr() { return errno; }


x86 assembly (clang, -O0):
<scarab_os_geterr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scarab_os_geterr>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @scarab_os_geterr() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @scarab_os_geterr() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ imprime_cuadrado(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int ancho, alto;
  printf("Ancho: ");
  scanf("%d", &ancho);
  printf("Alto: ");
  scanf("%d", &alto);
  imprime_cuadrado(ancho, alto);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <imprime_cuadrado@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec0(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <imprime_cuadrado@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Ancho: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"Alto: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @imprime_cuadrado(i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Ancho: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"Alto: \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 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 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 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 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 = call i32 @imprime_cuadrado(i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AngleMod(float);
float fabs(int /*<<< orphan*/);
float AngleDiff(float angle1, float angle2) {
  float fTemp;
  fTemp = fabs(AngleMod(angle1 - angle2));
  if (fTemp > 180) {
    fTemp = 360 - fTemp;
  }
  return fTemp;
}


x86 assembly (clang, -O0):
<AngleDiff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1040 <AngleMod@plt>
mov    %eax,%edi
call   1030 <fabs@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xea6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1175 <AngleDiff+0x55>
movss  0xe99(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleDiff>:
push   %rax
subss  %xmm1,%xmm0
call   1040 <AngleMod@plt>
mov    %eax,%edi
call   1030 <fabs@plt>
movss  0xec7(%rip),%xmm2
subss  %xmm0,%xmm2
movss  0xebf(%rip),%xmm1
cmpltss %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @AngleDiff(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
%9 = call i32 @AngleMod(float %8)
%10 = call float @fabs(i32 %9)
store float %10, float* %5
%11 = load float, float* %5
%12 = fcmp ogt float %11, 1.800000e+02
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load float, float* %5
%15 = fsub float 3.600000e+02, %14
store float %15, float* %5
br label %16
16: ; preds = %13, %2
%17 = load float, float* %5
ret float %17
}

LLVM IR (-O2):
define float @AngleDiff(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call i32 @AngleMod(float %3)
%5 = tail call float @fabs(i32 %4)
%6 = fcmp ogt float %5, 1.800000e+02
%7 = fsub float 3.600000e+02, %5
%8 = select i1 %6, float %7, float %5
ret float %8
}
void TMTimerToNano(void) {}


x86 assembly (clang, -O0):
<TMTimerToNano>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TMTimerToNano>:
ret

LLVM IR (-O0):
define void @TMTimerToNano() {
ret void
}

LLVM IR (-O2):
define void @TMTimerToNano() {
ret void
}
/* Variables and functions */
void *malloc(int);
void *realloc(void *, int);
void *moremem(void *old, int n) { return (old ? realloc(old, n) : malloc(n)); }


x86 assembly (clang, -O0):
<moremem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <moremem+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
jmp    115b <moremem+0x3b>
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moremem>:
test   %rdi,%rdi
je     112a <moremem+0xa>
jmp    1040 <realloc@plt>
mov    %esi,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @moremem(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i8* @realloc(i8* %8, i32 %9)
br label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i8* @malloc(i32 %12)
br label %14
14: ; preds = %11, %7
%15 = phi i8* [ %10, %7 ], [ %13, %11 ]
ret i8* %15
}

LLVM IR (-O2):
define i8* @moremem(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @realloc(i8* %0, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @malloc(i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
ret i8* %9
}
void EVP_PKEY_set1_DH(void) {}


x86 assembly (clang, -O0):
<EVP_PKEY_set1_DH>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_PKEY_set1_DH>:
ret

LLVM IR (-O0):
define void @EVP_PKEY_set1_DH() {
ret void
}

LLVM IR (-O2):
define void @EVP_PKEY_set1_DH() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skip_newline(FILE *in) {
  int ch = getc(in);
  if (feof(in)) {
    clearerr(in);
    return;
  }
  if (ch != '\n' && ch != '\r')
    ungetc(ch, in);
}


x86 assembly (clang, -O0):
<skip_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%rax
je     1179 <skip_newline+0x39>
mov    -0x8(%rbp),%rdi
call   1040 <clearerr@plt>
jmp    1199 <skip_newline+0x59>
cmpl   $0xa,-0xc(%rbp)
je     1199 <skip_newline+0x59>
cmpl   $0xd,-0xc(%rbp)
je     1199 <skip_newline+0x59>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_newline>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <feof@plt>
test   %rax,%rax
je     1168 <skip_newline+0x28>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <clearerr@plt>
cmp    $0xa,%ebp
je     1172 <skip_newline+0x32>
cmp    $0xd,%ebp
jne    1179 <skip_newline+0x39>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <ungetc@plt>

LLVM IR (-O0):
define void @skip_newline(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i64 @feof(i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = call i32 @clearerr(i32* %10)
br label %22
12: ; preds = %1
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 13
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = load i32*, i32** %2
%21 = call i32 @ungetc(i32 %19, i32* %20)
br label %22
22: ; preds = %9, %18, %15, %12
ret void
}

LLVM IR (-O2):
define void @skip_newline(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i64 @feof(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @clearerr(i32* %0)
br label %10
7: ; preds = %1
switch i32 %2, label %8 [
i32 13, label %10
i32 10, label %10
]
8: ; preds = %7
%9 = tail call i32 @ungetc(i32 %2, i32* %0)
br label %10
10: ; preds = %8, %7, %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    die("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
float raddec(float rad) { return rad * 180 / 3.141592653589793; }


x86 assembly (clang, -O0):
<raddec>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<raddec>:
mulss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @raddec(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.800000e+02
%5 = fpext float %4 to double
%6 = fdiv double %5, 0x400921FB54442D18
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @raddec(float %0) {
%2 = fmul float %0, 1.800000e+02
%3 = fpext float %2 to double
%4 = fdiv double %3, 0x400921FB54442D18
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
char tolower(char c) { return ((c >= 'A' && c <= 'Z') ? c + 32 : c); }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <tolower+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <tolower+0x33>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <tolower+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @tolower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 32
br label %17
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @tolower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ cprofile_result_print(char *, int);
void cprofile_result_printall(void) { cprofile_result_print("/", 1); }


x86 assembly (clang, -O0):
<cprofile_result_printall>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <cprofile_result_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprofile_result_printall>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <cprofile_result_print@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @cprofile_result_printall() {
%1 = call i32 @cprofile_result_print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @cprofile_result_printall() {
%1 = tail call i32 @cprofile_result_print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __ptr_t;

/* Variables and functions */
int ENOSYS;
int posix_madvise(__ptr_t addr, size_t len, int advice) { return ENOSYS; }


x86 assembly (clang, -O0):
<posix_madvise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_madvise>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @posix_madvise(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
ret i32 %7
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @posix_madvise(i32 %0, i64 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
ret i32 %4
}