xunge/DecIR huggingface dataset:
int wps_validate_m6(const struct wpabuf *tlvs) { return 0; }


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

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

LLVM IR (-O0):
%struct.wpabuf = type opaque
define i32 @wps_validate_m6(%struct.wpabuf* %0) {
%2 = alloca %struct.wpabuf*
store %struct.wpabuf* %0, %struct.wpabuf** %2
ret i32 0
}

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_m6(%struct.wpabuf* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_equal() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_equal"
         "\n");
}


x86 assembly (clang, -O0):
<pa_proplist_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_proplist_equal>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_proplist_equal\0A\00"
define i32 @pa_proplist_equal() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_proplist_equal\00"
define i32 @pa_proplist_equal() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
uint8_t mmio_readb(uint8_t *addr) { return *(volatile uint8_t *)addr; }


x86 assembly (clang, -O0):
<mmio_readb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmio_readb>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @mmio_readb(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load volatile i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @mmio_readb(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
void USBEndpointDMAEnable(unsigned long ulBase, unsigned long ulEndpoint,
                          unsigned long ulFlags) {
  if (ulFlags & 0x00002000) {
    (*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) +
                                  0x00000113))) |= 0x00000010;
  }
  if (ulFlags & 0x00001000) {
    (*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) +
                                  0x00000117))) |= 0x00000020;
  }
}


x86 assembly (clang, -O0):
<USBEndpointDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x2000,%rax
cmp    $0x0,%rax
je     1145 <USBEndpointDMAEnable+0x45>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    0x113(%rax),%cl
movzbl %cl,%ecx
or     $0x10,%ecx
mov    %cl,0x113(%rax)
mov    -0x18(%rbp),%rax
and    $0x1000,%rax
cmp    $0x0,%rax
je     117a <USBEndpointDMAEnable+0x7a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    0x117(%rax),%cl
movzbl %cl,%ecx
or     $0x20,%ecx
mov    %cl,0x117(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointDMAEnable>:
test   $0x2000,%edx
jne    1111 <USBEndpointDMAEnable+0x11>
test   $0x1000,%edx
jne    1121 <USBEndpointDMAEnable+0x21>
ret
orb    $0x10,0x103(%rsi,%rdi,1)
10
test   $0x1000,%edx
je     1110 <USBEndpointDMAEnable+0x10>
orb    $0x20,0x107(%rsi,%rdi,1)
20
ret

LLVM IR (-O0):
define void @USBEndpointDMAEnable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = and i64 %7, 8192
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = sub i64 %12, 16
%14 = add i64 %11, %13
%15 = add i64 %14, 275
%16 = inttoptr i64 %15 to i8*
%17 = load volatile i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, 16
%20 = trunc i32 %19 to i8
store volatile i8 %20, i8* %16
br label %21
21: ; preds = %10, %3
%22 = load i64, i64* %6
%23 = and i64 %22, 4096
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %36
25: ; preds = %21
%26 = load i64, i64* %4
%27 = load i64, i64* %5
%28 = sub i64 %27, 16
%29 = add i64 %26, %28
%30 = add i64 %29, 279
%31 = inttoptr i64 %30 to i8*
%32 = load volatile i8, i8* %31
%33 = zext i8 %32 to i32
%34 = or i32 %33, 32
%35 = trunc i32 %34 to i8
store volatile i8 %35, i8* %31
br label %36
36: ; preds = %25, %21
ret void
}

LLVM IR (-O2):
define void @USBEndpointDMAEnable(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %2, 8192
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = add i64 %1, %0
%8 = add i64 %7, 259
%9 = inttoptr i64 %8 to i8*
%10 = load volatile i8, i8* %9
%11 = or i8 %10, 16
store volatile i8 %11, i8* %9
br label %12
12: ; preds = %6, %3
%13 = and i64 %2, 4096
%14 = icmp eq i64 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = add i64 %1, %0
%17 = add i64 %16, 263
%18 = inttoptr i64 %17 to i8*
%19 = load volatile i8, i8* %18
%20 = or i8 %19, 32
store volatile i8 %20, i8* %18
br label %21
21: ; preds = %15, %12
ret void
}
int main(void) {
  volatile int i = 0;
  for (i = 0; i < 100000; i++)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x186a0,%eax
jge    113a <main+0x3a>
jmp    112c <main+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x1869f,%eax
jg     1130 <main+0x30>
nopl   0x0(%rax,%rax,1)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x186a0,%eax
jl     1120 <main+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
store volatile i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, 100000
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, 1
store volatile i32 %9, i32* %2
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp slt i32 %3, 100000
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = icmp slt i32 %8, 100000
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int mt_extractU32();
int32_t mt_minmax(uint32_t min, uint32_t max) {
  return (int32_t)(mt_extractU32() % (max - min) + min);
}


x86 assembly (clang, -O0):
<mt_minmax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <mt_extractU32@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_minmax>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <mt_extractU32@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mt_minmax(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @mt_extractU32()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mt_minmax(i32 %0, i32 %1) {
%3 = tail call i32 (...) @mt_extractU32()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
void main() { int arr[1 << 28]; }


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca [268435456 x i32]
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int rom_present(char *);
int oti067_available() { return rom_present("oti067/bios.bin"); }


x86 assembly (clang, -O0):
<oti067_available>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <rom_present@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<oti067_available>:
lea    0xee9(%rip),%rdi
jmp    1030 <rom_present@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"oti067/bios.bin\00"
define i32 @oti067_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [16 x i8] c"oti067/bios.bin\00"
define i32 @oti067_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int getaxisjoystick(int, int);
int popNumber();
int /*<<< orphan*/ pushNumber(int);
void basGetAxisJoyStick(void) {
  int ret;
  int a, i;
  a = popNumber();
  i = popNumber();
  ret = getaxisjoystick(i, a);
  pushNumber(ret);
}


x86 assembly (clang, -O0):
<basGetAxisJoyStick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <getaxisjoystick@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basGetAxisJoyStick>:
push   %rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <getaxisjoystick@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basGetAxisJoyStick() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @popNumber()
store i32 %4, i32* %2
%5 = call i32 (...) @popNumber()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @getaxisjoystick(i32 %6, i32 %7)
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = call i32 @pushNumber(i32 %9)
ret void
}

LLVM IR (-O2):
define void @basGetAxisJoyStick() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = tail call i32 @getaxisjoystick(i32 %2, i32 %1)
%4 = tail call i32 @pushNumber(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ns2thpoint(float, float, float, float, float, float, int);
void ns2point(float ix, float iy, float iz, float ired, float igreen,
              float iblue) {
  ns2thpoint(ix, iy, iz, ired, igreen, iblue, 1.);
  return;
}


x86 assembly (clang, -O0):
<ns2point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
movss  -0x18(%rbp),%xmm5
mov    $0x1,%edi
call   1030 <ns2thpoint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns2point>:
mov    $0x1,%edi
jmp    1030 <ns2thpoint@plt>

LLVM IR (-O0):
define void @ns2point(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = load float, float* %10
%17 = load float, float* %11
%18 = load float, float* %12
%19 = call i32 @ns2thpoint(float %13, float %14, float %15, float %16, float %17, float %18, i32 1)
ret void
}

LLVM IR (-O2):
define void @ns2point(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call i32 @ns2thpoint(float %0, float %1, float %2, float %3, float %4, float %5, i32 1)
ret void
}
float _Complex add_float_cc(float _Complex a, float _Complex b) {
  return a + b;
}


x86 assembly (clang, -O0):
<add_float_cc>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movlpd %xmm1,-0x18(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x18(%rbp),%xmm3
movss  -0x14(%rbp),%xmm2
addss  %xmm3,%xmm1
addss  %xmm2,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_float_cc>:
addps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @add_float_cc(<2 x float> %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %1, <2 x float>* %7
%8 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%9 = load float, float* %8
%10 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%11 = load float, float* %10
%12 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%13 = load float, float* %12
%14 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%15 = load float, float* %14
%16 = fadd float %9, %13
%17 = fadd float %11, %15
%18 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%19 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %16, float* %18
store float %17, float* %19
%20 = bitcast { float, float }* %3 to <2 x float>*
%21 = load <2 x float>, <2 x float>* %20
ret <2 x float> %21
}

LLVM IR (-O2):
define <2 x float> @add_float_cc(<2 x float> %0, <2 x float> %1) {
%3 = fadd <2 x float> %0, %1
ret <2 x float> %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void mys(int n) {
  n /= 100000;
  printf("%s", "**********" + 9 - n);
}


x86 assembly (clang, -O0):
<mys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
lea    0xeca(%rip),%rsi
add    $0x9,%rsi
add    %rax,%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mys>:
movslq %edi,%rax
imul   $0xffffffffeb074a77,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2d,%rax
add    %ecx,%eax
cltq
lea    0xed3(%rip),%rcx
lea    (%rax,%rcx,1),%rsi
add    $0x9,%rsi
lea    0xec1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"**********\00"
define void @mys(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 100000
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = sub i64 0, %6
%8 = getelementptr inbounds i8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 9), i64 %7
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"**********\00"
define void @mys(i32 %0) {
%2 = sdiv i32 %0, -100000
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 9), i64 %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int rename(const char *old, const char *new) {
  if (old == NULL || new == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <rename+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1150 <rename+0x40>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <rename+0x55>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    %rax,%rcx
test   %rsi,%rsi
je     1127 <rename+0x17>
mov    0x2ec1(%rip),%rcx
test   %rdi,%rdi
cmove  %rax,%rcx
mov    (%rcx),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @rename(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %8, %2
%12 = load i32, i32* @EINVAL
%13 = call i32 @__set_errno(i32 %12)
store i32 -1, i32* %3
br label %17
14: ; preds = %8
%15 = load i32, i32* @ENOSYS
%16 = call i32 @__set_errno(i32 %15)
store i32 -1, i32* %3
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @rename(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
%6 = load i32, i32* @EINVAL
%7 = load i32, i32* @ENOSYS
%8 = select i1 %5, i32 %6, i32 %7
%9 = tail call i32 @__set_errno(i32 %8)
ret i32 -1
}
/* Variables and functions */
int ILibString_LastIndexOfEx(char const *, int, char const *, int, int);
int ILibString_LastIndexOf(const char *inString, int inStringLength,
                           const char *lastIndexOf, int lastIndexOfLength) {
  return (ILibString_LastIndexOfEx(inString, inStringLength, lastIndexOf,
                                   lastIndexOfLength, 1));
}


x86 assembly (clang, -O0):
<ILibString_LastIndexOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <ILibString_LastIndexOfEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibString_LastIndexOf>:
mov    $0x1,%r8d
jmp    1030 <ILibString_LastIndexOfEx@plt>

LLVM IR (-O0):
define i32 @ILibString_LastIndexOf(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @ILibString_LastIndexOfEx(i8* %9, i32 %10, i8* %11, i32 %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
define i32 @ILibString_LastIndexOf(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @ILibString_LastIndexOfEx(i8* %0, i32 %1, i8* %2, i32 %3, i32 1)
ret i32 %5
}
int verify_benchmark(int r) {
  int expected = 9;
  if (r != expected)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_benchmark>:
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @verify_benchmark(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 9, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @verify_benchmark(i32 %0) {
%2 = icmp eq i32 %0, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main() {
  int a = 1;
  foo(&a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = call i32 @foo(i32* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @foo(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a = 0, b = 0;
  while (a < 10) {
    a += b;
    b += 1;
  }
  test_assert(b == 5);
  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)
cmpl   $0xa,-0x8(%rbp)
jge    114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x5,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 5
%16 = zext i1 %15 to i32
%17 = call i32 @test_assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *FerMem_Malloc(size_t size, char *filename, int linenumber) {
  void *ptr;
  ptr = malloc(size);
  return ptr;
}


x86 assembly (clang, -O0):
<FerMem_Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FerMem_Malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @FerMem_Malloc(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @FerMem_Malloc(i64 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i8* @malloc(i64 %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t s2u64(void *s) { return *((uint64_t *)s); }


x86 assembly (clang, -O0):
<s2u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2u64>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @s2u64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @s2u64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x62() {
  Assert_real((isxdigit(98)),
              "/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_isxdigit.c",
              495, ("isxdigit should be 1 for b"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x62>:
push   %rbp
mov    %rsp,%rbp
mov    $0x62,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1ef,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x62>:
push   %rax
mov    $0x62,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x1ef,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for b\00"
define void @t_isxdigit_0x62() {
%1 = call i32 @isxdigit(i32 98)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for b\00"
define void @t_isxdigit_0x62() {
%1 = tail call i32 @isxdigit(i32 98)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
_Bool explicit_unsigned_int_to_bool(unsigned int src) { return (_Bool)src; }


x86 assembly (clang, -O0):
<explicit_unsigned_int_to_bool>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<explicit_unsigned_int_to_bool>:
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define zeroext i1 @explicit_unsigned_int_to_bool(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @explicit_unsigned_int_to_bool(i32 %0) {
%2 = icmp ne i32 %0, 0
ret i1 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
main() {
  long long P = 1, E = 2, T = 5, A = 61, L = 251, N = 3659, R = 271173410,
            G = 1479296389, x[] = {G * R * E * E * T, P * L * A * N * E * T};
  puts((char *)x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movq   $0x1,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x5,-0x18(%rbp)
movq   $0x3d,-0x20(%rbp)
movq   $0xfb,-0x28(%rbp)
movq   $0xe4b,-0x30(%rbp)
movq   $0x1029c722,-0x38(%rbp)
10
movq   $0x582c4585,-0x40(%rbp)
58
mov    -0x40(%rbp),%rax
imul   -0x38(%rbp),%rax
imul   -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x28(%rbp),%rax
imul   -0x20(%rbp),%rax
imul   -0x30(%rbp),%rax
imul   -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca [2 x i64]
store i64 1, i64* %1
store i64 2, i64* %2
store i64 5, i64* %3
store i64 61, i64* %4
store i64 251, i64* %5
store i64 3659, i64* %6
store i64 271173410, i64* %7
store i64 1479296389, i64* %8
%10 = getelementptr inbounds [2 x i64], [2 x i64]* %9, i64 0, i64 0
%11 = load i64, i64* %8
%12 = load i64, i64* %7
%13 = mul nsw i64 %11, %12
%14 = load i64, i64* %2
%15 = mul nsw i64 %13, %14
%16 = load i64, i64* %2
%17 = mul nsw i64 %15, %16
%18 = load i64, i64* %3
%19 = mul nsw i64 %17, %18
store i64 %19, i64* %10
%20 = getelementptr inbounds i64, i64* %10, i64 1
%21 = load i64, i64* %1
%22 = load i64, i64* %5
%23 = mul nsw i64 %21, %22
%24 = load i64, i64* %4
%25 = mul nsw i64 %23, %24
%26 = load i64, i64* %6
%27 = mul nsw i64 %25, %26
%28 = load i64, i64* %2
%29 = mul nsw i64 %27, %28
%30 = load i64, i64* %3
%31 = mul nsw i64 %29, %30
store i64 %31, i64* %20
%32 = getelementptr inbounds [2 x i64], [2 x i64]* %9, i64 0, i64 0
%33 = bitcast i64* %32 to i8*
%34 = call i32 @puts(i8* %33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca <2 x i64>
%2 = bitcast <2 x i64>* %1 to i8*
store <2 x i64> <i64 8022916924116329800, i64 560229490>, <2 x i64>* %1
%3 = call i32 @puts(i8* %2)
ret i32 0
}
void eapol_sm_configure(struct eapol_sm *sm, int heldPeriod, int authPeriod,
                        int startPeriod, int maxStart) {}


x86 assembly (clang, -O0):
<eapol_sm_configure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.eapol_sm = type opaque
define void @eapol_sm_configure(%struct.eapol_sm* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.eapol_sm*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.eapol_sm* %0, %struct.eapol_sm** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.eapol_sm = type opaque
define void @eapol_sm_configure(%struct.eapol_sm* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int get_long(FILE *f) {
  return (fgetc(f) << 24) + (fgetc(f) << 16) + (fgetc(f) << 8) + fgetc(f);
}


x86 assembly (clang, -O0):
<get_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
shl    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_long>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x18,%ebp
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
add    %ebp,%ebx
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
add    %ebx,%ebp
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_long(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fgetc(i32* %3)
%5 = shl i32 %4, 24
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
%8 = shl i32 %7, 16
%9 = add nsw i32 %5, %8
%10 = load i32*, i32** %2
%11 = call i32 @fgetc(i32* %10)
%12 = shl i32 %11, 8
%13 = add nsw i32 %9, %12
%14 = load i32*, i32** %2
%15 = call i32 @fgetc(i32* %14)
%16 = add nsw i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_long(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = shl i32 %2, 24
%4 = tail call i32 @fgetc(i32* %0)
%5 = shl i32 %4, 16
%6 = add nsw i32 %5, %3
%7 = tail call i32 @fgetc(i32* %0)
%8 = shl i32 %7, 8
%9 = add nsw i32 %6, %8
%10 = tail call i32 @fgetc(i32* %0)
%11 = add nsw i32 %9, %10
ret i32 %11
}
/* Variables and functions */
int msgsnd(int, long *, int, int /*<<< orphan*/);
int sendJugadaOrdenador(int queue) {
  long tipo = 5;
  return msgsnd(queue, &tipo, sizeof(long), 0);
}


x86 assembly (clang, -O0):
<sendJugadaOrdenador>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x5,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1030 <msgsnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendJugadaOrdenador>:
push   %rax
movq   $0x5,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1030 <msgsnd@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sendJugadaOrdenador(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 5, i64* %3
%4 = load i32, i32* %2
%5 = call i32 @msgsnd(i32 %4, i64* %3, i32 8, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @sendJugadaOrdenador(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 5, i64* %2
%4 = call i32 @msgsnd(i32 %0, i64* %2, i32 8, i32 0)
ret i32 %4
}
int int_square(int line, int value) { return value * value; }


x86 assembly (clang, -O0):
<int_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_square>:
mov    %esi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @int_square(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @int_square(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memory_pressure_clr();
int /*<<< orphan*/ memory_pressure_set();
void cfs_memory_pressure_restore(int old) {
  if (old)
    memory_pressure_set();
  else
    memory_pressure_clr();
}


x86 assembly (clang, -O0):
<cfs_memory_pressure_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <cfs_memory_pressure_restore+0x21>
mov    $0x0,%al
call   1030 <memory_pressure_set@plt>
jmp    1148 <cfs_memory_pressure_restore+0x28>
mov    $0x0,%al
call   1040 <memory_pressure_clr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_memory_pressure_restore>:
xor    %eax,%eax
test   %edi,%edi
je     112b <cfs_memory_pressure_restore+0xb>
jmp    1030 <memory_pressure_set@plt>
jmp    1040 <memory_pressure_clr@plt>

LLVM IR (-O0):
define void @cfs_memory_pressure_restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @memory_pressure_set()
br label %9
7: ; preds = %1
%8 = call i32 (...) @memory_pressure_clr()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @cfs_memory_pressure_restore(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @memory_pressure_set()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @memory_pressure_clr()
br label %7
7: ; preds = %5, %3
ret void
}
int strcmp(const char *cs, const char *ct) {
  signed char res;
  while (((res = *cs - *ct++) == 0) && (*cs++ != '\0'))
    continue;
  return res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %al,-0x11(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
jne    1156 <strcmp+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1166 <strcmp+0x66>
jmp    116b <strcmp+0x6b>
jmp    110c <strcmp+0xc>
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%edx
mov    %edx,%ecx
sub    (%rsi,%rax,1),%cl
test   %dl,%dl
je     1125 <strcmp+0x25>
add    $0x1,%rax
test   %cl,%cl
je     1110 <strcmp+0x10>
movsbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %26, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %9, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %6
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
%21 = load i8, i8* %19
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br label %24
24: ; preds = %18, %6
%25 = phi i1 [ false, %6 ], [ %23, %18 ]
br i1 %25, label %26, label %27
26: ; preds = %24
br label %6
27: ; preds = %24
%28 = load i8, i8* %5
%29 = sext i8 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %10, %3 ]
%5 = phi i8* [ %0, %2 ], [ %11, %3 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = sub i8 %6, %7
%9 = icmp ne i8 %8, 0
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %6, 0
%13 = or i1 %12, %9
br i1 %13, label %14, label %3
14: ; preds = %3
%15 = sext i8 %8 to i32
ret i32 %15
}
/* Variables and functions */
int __libc_tcdrain(int);
int /*<<< orphan*/ pthread_testcancel();
int tcdrain(int fd) {
  pthread_testcancel();
  return __libc_tcdrain(fd);
}


x86 assembly (clang, -O0):
<tcdrain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pthread_testcancel@plt>
mov    -0x4(%rbp),%edi
call   1040 <__libc_tcdrain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcdrain>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <pthread_testcancel@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <__libc_tcdrain@plt>

LLVM IR (-O0):
define i32 @tcdrain(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_testcancel()
%4 = load i32, i32* %2
%5 = call i32 @__libc_tcdrain(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @tcdrain(i32 %0) {
%2 = tail call i32 (...) @pthread_testcancel()
%3 = tail call i32 @__libc_tcdrain(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("%02d\n", 4);
  printf("%02s\n", "4");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0xeda(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02d\0A\00"
@.str.1 = [6 x i8] c"%02s\0A\00"
@.str.2 = [2 x i8] c"4\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ runVM();
int main() { runVM(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <runVM@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @runVM()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runVM()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BTIC1H_CodecBT1H_Init();
int /*<<< orphan*/ BTIC1H_CodecBT4B_Init();
int BTIC1H_Codec_Init() {
  static int init;
  if (init)
    return (0);
  init = 1;
  BTIC1H_CodecBT1H_Init();
  BTIC1H_CodecBT4B_Init();
  return (1);
}


x86 assembly (clang, -O0):
<BTIC1H_Codec_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f05(%rip)
je     1141 <BTIC1H_Codec_Init+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1160 <BTIC1H_Codec_Init+0x40>
movl   $0x1,0x2ee9(%rip)
mov    $0x0,%al
call   1030 <BTIC1H_CodecBT1H_Init@plt>
mov    $0x0,%al
call   1040 <BTIC1H_CodecBT4B_Init@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BTIC1H_Codec_Init>:
push   %rax
xor    %eax,%eax
cmpb   $0x0,0x2f0a(%rip)
jne    1146 <BTIC1H_Codec_Init+0x26>
movb   $0x1,0x2f01(%rip)
xor    %eax,%eax
call   1030 <BTIC1H_CodecBT1H_Init@plt>
xor    %eax,%eax
call   1040 <BTIC1H_CodecBT4B_Init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@BTIC1H_Codec_Init.init = internal global i32 0
define i32 @BTIC1H_Codec_Init() {
%1 = alloca i32
%2 = load i32, i32* @BTIC1H_Codec_Init.init
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %8
5: ; preds = %0
store i32 1, i32* @BTIC1H_Codec_Init.init
%6 = call i32 (...) @BTIC1H_CodecBT1H_Init()
%7 = call i32 (...) @BTIC1H_CodecBT4B_Init()
store i32 1, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@BTIC1H_Codec_Init.init = internal unnamed_addr global i1 false
define i32 @BTIC1H_Codec_Init() {
%1 = load i1, i1* @BTIC1H_Codec_Init.init
br i1 %1, label %5, label %2
2: ; preds = %0
store i1 true, i1* @BTIC1H_Codec_Init.init
%3 = tail call i32 (...) @BTIC1H_CodecBT1H_Init()
%4 = tail call i32 (...) @BTIC1H_CodecBT4B_Init()
br label %5
5: ; preds = %0, %2
%6 = phi i32 [ 1, %2 ], [ 0, %0 ]
ret i32 %6
}
void reverseStrings(char **a, int length) {
  int halfLen = (length >> 1);
  char **end = a + length;
  char *c;
  while (--halfLen >= 0) {
    c = *a;
    *a++ = *--end;
    *end = c;
  }
}


x86 assembly (clang, -O0):
<reverseStrings>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jl     1179 <reverseStrings+0x79>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x8(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    1127 <reverseStrings+0x27>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseStrings>:
cmp    $0x2,%esi
jl     113c <reverseStrings+0x3c>
mov    %esi,%eax
shr    %esi
lea    (%rdi,%rax,8),%rax
add    $0xfffffffffffffff8,%rax
add    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rdi),%rcx
mov    (%rax),%rdx
mov    %rdx,(%rdi)
add    $0x8,%rdi
mov    %rcx,(%rax)
add    $0xfffffffffffffff8,%rax
add    $0xffffffff,%esi
cmp    $0x1,%esi
ja     1120 <reverseStrings+0x20>
ret

LLVM IR (-O0):
define void @reverseStrings(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
store i8** %0, i8*** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = ashr i32 %8, 1
store i32 %9, i32* %5
%10 = load i8**, i8*** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
store i8** %13, i8*** %6
br label %14
14: ; preds = %18, %2
%15 = load i32, i32* %5
%16 = add nsw i32 %15, -1
store i32 %16, i32* %5
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i8**, i8*** %3
%20 = load i8*, i8** %19
store i8* %20, i8** %7
%21 = load i8**, i8*** %6
%22 = getelementptr inbounds i8*, i8** %21, i32 -1
store i8** %22, i8*** %6
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %3
%25 = getelementptr inbounds i8*, i8** %24, i32 1
store i8** %25, i8*** %3
store i8* %23, i8** %24
%26 = load i8*, i8** %7
%27 = load i8**, i8*** %6
store i8* %26, i8** %27
br label %14
28: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @reverseStrings(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = lshr i32 %1, 1
br label %8
8: ; preds = %4, %8
%9 = phi i8** [ %16, %8 ], [ %0, %4 ]
%10 = phi i8** [ %14, %8 ], [ %6, %4 ]
%11 = phi i32 [ %12, %8 ], [ %7, %4 ]
%12 = add nsw i32 %11, -1
%13 = load i8*, i8** %9
%14 = getelementptr inbounds i8*, i8** %10, i64 -1
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8*, i8** %9, i64 1
store i8* %15, i8** %9
store i8* %13, i8** %14
%17 = icmp ugt i32 %11, 1
br i1 %17, label %8, label %18
18: ; preds = %8, %2
ret void
}