xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ SPI_write(int, void *, int);
void AD7390_setValue(int spi_fd, uint16_t value) {
  SPI_write(spi_fd, (void *)&value, 1);
}


x86 assembly (clang, -O0):
<AD7390_setValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <SPI_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AD7390_setValue>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <SPI_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @AD7390_setValue(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = bitcast i32* %4 to i8*
%7 = call i32 @SPI_write(i32 %5, i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @AD7390_setValue(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @SPI_write(i32 %0, i8* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_scilab_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("scilab", " //comment"),
                            "comment", "//comment");
}


x86 assembly (clang, -O0):
<test_scilab_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xeca(%rip),%rsi
lea    0xec1(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scilab_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecf(%rip),%rsi
lea    0xec6(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"scilab\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [10 x i8] c"//comment\00"
define void @test_scilab_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"scilab\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [10 x i8] c"//comment\00"
define void @test_scilab_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void fast_clock() {
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x30) =
      (0x03 | (((2) & 7) << 2));
  do {
  } while (!(*(volatile unsigned long *)((void *)0xfffffc00 + 0x68) & 0x08));
}


x86 assembly (clang, -O0):
<fast_clock>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffc00,%eax
movq   $0xb,0x30(%rax)
jmp    1116 <fast_clock+0x16>
mov    $0xfffffc00,%eax
mov    0x68(%rax),%rax
and    $0x8,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1111 <fast_clock+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_clock>:
mov    $0xfffffc30,%eax
movq   $0xb,(%rax)
nopl   0x0(%rax)
testq  $0x8,0x38(%rax)
je     1110 <fast_clock+0x10>
ret

LLVM IR (-O0):
define void @fast_clock() {
store volatile i64 11, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 48) to i64*)
br label %1
1: ; preds = %2, %0
br label %2
2: ; preds = %1
%3 = load volatile i64, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 104) to i64*)
%4 = and i64 %3, 8
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %1, label %7
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @fast_clock() {
store volatile i64 11, i64* inttoptr (i64 4294966320 to i64*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 4294966376 to i64*)
%3 = and i64 %2, 8
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __bzero(void *, size_t);
void __aeabi_memclr(void *dest, size_t n) { __bzero(dest, n); }


x86 assembly (clang, -O0):
<__aeabi_memclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__bzero@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memclr>:
jmp    1030 <__bzero@plt>

LLVM IR (-O0):
define void @__aeabi_memclr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @__bzero(i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @__aeabi_memclr(i8* %0, i64 %1) {
%3 = tail call i32 @__bzero(i8* %0, i64 %1)
ret void
}
int exsign(unsigned int v, int bits) {
  return (int)(v & (1 << (bits - 1)) ? v | (~0u << bits) : v);
}


x86 assembly (clang, -O0):
<exsign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1140 <exsign+0x40>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <exsign+0x46>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exsign>:
mov    %esi,%ecx
lea    -0x1(%rcx),%eax
movzbl %al,%edx
mov    $0xffffffff,%esi
shl    %cl,%esi
xor    %eax,%eax
bt     %edx,%edi
cmovb  %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @exsign(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = shl i32 1, %7
%9 = and i32 %5, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = shl i32 -1, %13
%15 = or i32 %12, %14
br label %18
16: ; preds = %2
%17 = load i32, i32* %3
br label %18
18: ; preds = %16, %11
%19 = phi i32 [ %15, %11 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @exsign(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = shl nsw i32 -1, %1
%8 = select i1 %6, i32 0, i32 %7
%9 = or i32 %8, %0
ret i32 %9
}
unsigned int fn6(unsigned int a) { return a >> 0xff03; }


x86 assembly (clang, -O0):
<fn6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xff03,%ecx
shr    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn6(i32 %0) {
ret i32 poison
}
int test9u(unsigned int x) { return x / 10U > 2; }


x86 assembly (clang, -O0):
<test9u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x2,%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9u>:
xor    %eax,%eax
cmp    $0x1e,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @test9u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 %3, 10
%5 = icmp ugt i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test9u(i32 %0) {
%2 = icmp ugt i32 %0, 29
%3 = zext i1 %2 to i32
ret i32 %3
}
void XBaseFontNameListOfFontSet() {}


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

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

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

LLVM IR (-O2):
define void @XBaseFontNameListOfFontSet() {
ret void
}
map(int i) {
  switch (i) {
  case 1 ... 3:
    return 1;
  case 4:
    return 2;
  default:
    return 3;
  }
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x3,%eax
jb     112f <map+0x2f>
jmp    111e <map+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     113b <map+0x3b>
jmp    1147 <map+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <map+0x4e>
movl   $0x2,-0x4(%rbp)
jmp    114e <map+0x4e>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
add    $0xffffffff,%edi
mov    $0x3,%eax
cmp    $0x3,%edi
ja     111a <map+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @map(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %5
i32 3, label %5
i32 4, label %6
]
5: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
6: ; preds = %1
store i32 2, i32* %2
br label %8
7: ; preds = %1
store i32 3, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.map = [4 x i32] [i32 1, i32 1, i32 1, i32 2]
define i32 @map(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.map, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 3, %1 ]
ret i32 %9
}
void ctohex(buf, c) register char *buf;
register int c;
{
  static char hex[] = "0123456789abcdef";
  *buf++ = hex[c >> 4];
  *buf = hex[c & 0xf];
}


x86 assembly (clang, -O0):
<ctohex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0x2f15(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2ef1(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctohex>:
mov    %esi,%eax
sar    $0x4,%eax
cltq
lea    0xef2(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,(%rdi)
and    $0xf,%esi
mov    (%rsi,%rcx,1),%al
mov    %al,0x1(%rdi)
ret

LLVM IR (-O0):
@ctohex.hex = internal global [17 x i8] c"0123456789abcdef\00"
define void @ctohex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @ctohex.hex, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8 %9, i8* %10
%12 = load i32, i32* %4
%13 = and i32 %12, 15
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [17 x i8], [17 x i8]* @ctohex.hex, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = load i8*, i8** %3
store i8 %16, i8* %17
ret void
}

LLVM IR (-O2):
@ctohex.hex = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define void @ctohex(i8* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @ctohex.hex, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %0
%8 = and i32 %1, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @ctohex.hex, i64 0, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %7
ret void
}
void memzero(void *a, unsigned long n) {
  char *p = (char *)a;
  char *e = p + n;
  while (p < e)
    *p++ = 0;
}


x86 assembly (clang, -O0):
<memzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1145 <memzero+0x45>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1120 <memzero+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memzero>:
test   %rsi,%rsi
jle    1135 <memzero+0x25>
push   %rax
mov    %rsi,%rdx
add    %rdi,%rdx
lea    0x1(%rdi),%rax
cmp    %rax,%rdx
cmovbe %rax,%rdx
sub    %rdi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @memzero(i8* writeonly %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = add i64 %3, %1
%7 = add i64 %3, 1
%8 = call i64 @llvm.umax.i64(i64 %6, i64 %7)
%9 = sub i64 %8, %3
br label %10
10: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
void int16Clear(int16_t *data) { *data = 0; }


x86 assembly (clang, -O0):
<int16Clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int16Clear>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @int16Clear(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
store i64 0, i64* %3
ret void
}

LLVM IR (-O2):
define void @int16Clear(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Test Executable Sucessfully Built!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [36 x i8] c"Test Executable Sucessfully Built!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Test Executable Sucessfully Built!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int getCellSize() { return 1; }


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

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

LLVM IR (-O0):
define i32 @getCellSize() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getCellSize() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ errorMemoria();
int /*<<< orphan*/ sprintf(char *, char *, int, int);
scalar_t__ validarMemoria(void **, int);
char *GenerarNombre(int dimension) {
  char *nombre = NULL;
  if (validarMemoria((void **)(&nombre), 6))
    errorMemoria();
  sprintf(nombre, "%dx%d", dimension, dimension);
  return nombre;
}


x86 assembly (clang, -O0):
<GenerarNombre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1030 <validarMemoria@plt>
cmp    $0x0,%rax
je     1162 <GenerarNombre+0x32>
mov    $0x0,%al
call   1050 <errorMemoria@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xe8d(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenerarNombre>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x6,%esi
call   1030 <validarMemoria@plt>
test   %rax,%rax
je     115b <GenerarNombre+0x2b>
xor    %eax,%eax
call   1050 <errorMemoria@plt>
mov    0x8(%rsp),%rdi
lea    0xe99(%rip),%rsi
mov    %ebx,%edx
mov    %ebx,%ecx
call   1040 <sprintf@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%dx%d\00"
define i8* @GenerarNombre(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = call i64 @validarMemoria(i8** %3, i32 6)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @errorMemoria()
br label %8
8: ; preds = %6, %1
%9 = load i8*, i8** %3
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"%dx%d\00"
define i8* @GenerarNombre(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i64 @validarMemoria(i8** %2, i32 6)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (...) @errorMemoria()
br label %8
8: ; preds = %6, %1
%9 = load i8*, i8** %2
%10 = call i32 @sprintf(i8* dereferenceable(1) %9, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %0)
%11 = load i8*, i8** %2
ret i8* %11
}
/* Type definitions */
struct ib_hash_map {
  int dummy;
};
struct ib_hash_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ib_map_erase(struct ib_hash_map *, struct ib_hash_entry *);
struct ib_hash_entry *ib_map_find(struct ib_hash_map *, void const *);
int ib_map_remove(struct ib_hash_map *hm, const void *key) {
  struct ib_hash_entry *entry;
  entry = ib_map_find(hm, key);
  if (entry == NULL) {
    return -1;
  }
  ib_map_erase(hm, entry);
  return 0;
}


x86 assembly (clang, -O0):
<ib_map_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ib_map_find@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1158 <ib_map_remove+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <ib_map_remove+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <ib_map_erase@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ib_map_remove>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ib_map_find@plt>
test   %rax,%rax
je     113d <ib_map_remove+0x1d>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <ib_map_erase@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ib_hash_map = type { i32 }
%struct.ib_hash_entry = type { i32 }
define i32 @ib_map_remove(%struct.ib_hash_map* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.ib_hash_map*
%5 = alloca i8*
%6 = alloca %struct.ib_hash_entry*
store %struct.ib_hash_map* %0, %struct.ib_hash_map** %4
store i8* %1, i8** %5
%7 = load %struct.ib_hash_map*, %struct.ib_hash_map** %4
%8 = load i8*, i8** %5
%9 = call %struct.ib_hash_entry* @ib_map_find(%struct.ib_hash_map* %7, i8* %8)
store %struct.ib_hash_entry* %9, %struct.ib_hash_entry** %6
%10 = load %struct.ib_hash_entry*, %struct.ib_hash_entry** %6
%11 = icmp eq %struct.ib_hash_entry* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %17
13: ; preds = %2
%14 = load %struct.ib_hash_map*, %struct.ib_hash_map** %4
%15 = load %struct.ib_hash_entry*, %struct.ib_hash_entry** %6
%16 = call i32 @ib_map_erase(%struct.ib_hash_map* %14, %struct.ib_hash_entry* %15)
store i32 0, i32* %3
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.ib_hash_map = type { i32 }
%struct.ib_hash_entry = type { i32 }
define i32 @ib_map_remove(%struct.ib_hash_map* %0, i8* %1) {
%3 = tail call %struct.ib_hash_entry* @ib_map_find(%struct.ib_hash_map* %0, i8* %1)
%4 = icmp eq %struct.ib_hash_entry* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @ib_map_erase(%struct.ib_hash_map* %0, %struct.ib_hash_entry* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int maior(int *inteiros, size_t quantos) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @maior(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_base(int, int, char *);
int /*<<< orphan*/ printf(char *);
void print_decimal(int num) {
  static char map[] = {
      '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  };
  printf("Decimal: ");
  print_base(num, 10, map);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
lea    0x2eea(%rip),%rdx
call   1040 <print_base@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_decimal>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0x2ef2(%rip),%rdx
mov    %ebx,%edi
mov    $0xa,%esi
call   1050 <print_base@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@print_decimal.map = internal global [10 x i8] c"0123456789"
@.str = [10 x i8] c"Decimal: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_decimal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @print_base(i32 %4, i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @print_decimal.map, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@print_decimal.map = internal global [10 x i8] c"0123456789"
@.str = [10 x i8] c"Decimal: \00"
define void @print_decimal(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_base(i32 %0, i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @print_decimal.map, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ find_wildcard(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *expand_filename(const char *string) {
  char *filename = NULL;
  if (find_wildcard(string, strlen(string))) {
  }
  return filename;
}


x86 assembly (clang, -O0):
<expand_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <find_wildcard@plt>
cmp    $0x0,%rax
je     115f <expand_filename+0x3f>
jmp    115f <expand_filename+0x3f>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_filename>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <find_wildcard@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @expand_filename(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 @find_wildcard(i8* %0, i32 %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ addToBuffer();
int /*<<< orphan*/ timerTick();
void irqDispatcher(int irq) {
  switch (irq) {
  case 0:
    timerTick();
    break;
  case 1:
    addToBuffer();
    break;
  }
  return;
}


x86 assembly (clang, -O0):
<irqDispatcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     114f <irqDispatcher+0x2f>
jmp    113e <irqDispatcher+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     115b <irqDispatcher+0x3b>
jmp    1162 <irqDispatcher+0x42>
mov    $0x0,%al
call   1030 <timerTick@plt>
jmp    1162 <irqDispatcher+0x42>
mov    $0x0,%al
call   1040 <addToBuffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irqDispatcher>:
cmp    $0x1,%edi
je     1130 <irqDispatcher+0x10>
test   %edi,%edi
jne    1137 <irqDispatcher+0x17>
xor    %eax,%eax
jmp    1030 <timerTick@plt>
xor    %eax,%eax
jmp    1040 <addToBuffer@plt>
ret

LLVM IR (-O0):
define void @irqDispatcher(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 0, label %4
i32 1, label %6
]
4: ; preds = %1
%5 = call i32 (...) @timerTick()
br label %8
6: ; preds = %1
%7 = call i32 (...) @addToBuffer()
br label %8
8: ; preds = %1, %6, %4
ret void
}

LLVM IR (-O2):
define void @irqDispatcher(i32 %0) {
switch i32 %0, label %6 [
i32 0, label %2
i32 1, label %4
]
2: ; preds = %1
%3 = tail call i32 (...) @timerTick()
br label %6
4: ; preds = %1
%5 = tail call i32 (...) @addToBuffer()
br label %6
6: ; preds = %1, %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int str_len(char *f_str) {
  int count;
  for (count = 0; *(f_str + count) != '\0'; count++)
    ;
  printf("%d\n", count);
  return count - 1;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114b <str_len+0x3b>
jmp    113d <str_len+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <str_len+0x13>
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
push   %rbx
mov    $0xfffffffe,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <str_len+0x10>
lea    0x1(%rbx),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @str_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 1
ret i32 %20
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nsw i32 %9, -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ my_fprintf(char *);
int /*<<< orphan*/ my_fscanf(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(void) {
  my_fprintf("05.txt");
  my_fscanf("05.txt");
  printf("\n");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <my_fprintf@plt>
lea    0xe9e(%rip),%rdi
call   1060 <my_fscanf@plt>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <my_fprintf@plt>
mov    %rbx,%rdi
call   1060 <my_fscanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9e(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"05.txt\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 @my_fprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @my_fscanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int linkat(int /*<<< orphan*/, char const *, int /*<<< orphan*/, char const *,
           int /*<<< orphan*/);
int link(const char *oldpath, const char *newpath) {
  return linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0);
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <linkat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    %edi,%edx
xor    %r8d,%r8d
jmp    1030 <linkat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @AT_FDCWD
%6 = load i8*, i8** %3
%7 = load i32, i32* @AT_FDCWD
%8 = load i8*, i8** %4
%9 = call i32 @linkat(i32 %5, i8* %6, i32 %7, i8* %8, i32 0)
ret i32 %9
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = tail call i32 @linkat(i32 %3, i8* %0, i32 %3, i8* %1, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ktime_get();
unsigned long long ktime_to_ns(int /*<<< orphan*/);
unsigned long long casio_clock(void) { return ktime_to_ns(ktime_get()); }


x86 assembly (clang, -O0):
<casio_clock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ktime_get@plt>
mov    %eax,%edi
call   1040 <ktime_to_ns@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<casio_clock>:
push   %rax
xor    %eax,%eax
call   1030 <ktime_get@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ktime_to_ns@plt>

LLVM IR (-O0):
define i64 @casio_clock() {
%1 = call i32 (...) @ktime_get()
%2 = call i64 @ktime_to_ns(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
define i64 @casio_clock() {
%1 = tail call i32 (...) @ktime_get()
%2 = tail call i64 @ktime_to_ns(i32 %1)
ret i64 %2
}
int dfn_ri() { return 3; }


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

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

LLVM IR (-O0):
define i32 @dfn_ri() {
ret i32 3
}

LLVM IR (-O2):
define i32 @dfn_ri() {
ret i32 3
}
/* Variables and functions */
int ENOSYS;
int splash_display(void) { return -ENOSYS; }


x86 assembly (clang, -O0):
<splash_display>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2edb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<splash_display>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @splash_display() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @splash_display() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}
int main(void) {
  float f = 4.3;
  float *ff = &f;
  !ff;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca float*
store float 0x4011333340000000, float* %1
store float* %1, float** %2
%3 = load float*, float** %2
%4 = icmp ne float* %3, null
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int termios_tcflushi(int fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @termios_tcflushi(i32 %0) {
ret i32 1
}
void exm_log_init(void) {}


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

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

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

LLVM IR (-O2):
define void @exm_log_init() {
ret void
}
/* Variables and functions */
int unsetenv(char const *);
int octave_unsetenv_wrapper(const char *name) { return unsetenv(name); }


x86 assembly (clang, -O0):
<octave_unsetenv_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unsetenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_unsetenv_wrapper>:
jmp    1030 <unsetenv@plt>

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

LLVM IR (-O2):
define i32 @octave_unsetenv_wrapper(i8* nocapture %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret i32 %2
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_ext(char *fspec) {
  char *e = strrchr(fspec, '.');
  if (e == NULL)
    e = "";
  return e;
}


x86 assembly (clang, -O0):
<get_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <get_ext+0x34>
lea    0xec0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ext>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
lea    0xedb(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void XMLDB_Generate_End_Preformatted(FILE *dest_doc) {
  fprintf(dest_doc, "%s", "</literallayout>\n");
}


x86 assembly (clang, -O0):
<XMLDB_Generate_End_Preformatted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed5(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XMLDB_Generate_End_Preformatted>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [18 x i8] c"</literallayout>\0A\00"
define void @XMLDB_Generate_End_Preformatted(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"</literallayout>\0A\00"
define void @XMLDB_Generate_End_Preformatted(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 17, i64 1, i32* %0)
ret void
}
int ff_load_parameters(struct ff *ff, const char *path) {
  (void)ff;
  (void)path;
  return (0);
}


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

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

LLVM IR (-O0):
%struct.ff = type opaque
define i32 @ff_load_parameters(%struct.ff* %0, i8* %1) {
%3 = alloca %struct.ff*
%4 = alloca i8*
store %struct.ff* %0, %struct.ff** %3
store i8* %1, i8** %4
%5 = load %struct.ff*, %struct.ff** %3
%6 = load i8*, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.ff = type opaque
define i32 @ff_load_parameters(%struct.ff* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_metadata_array_get_key() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_metadata_array_get_key>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_metadata_array_get_key>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_get_key() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_get_key() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _xend();
scalar_t__ _xtest();
__attribute__((always_)) void tx_end(void) {
  if (_xtest())
    _xend();
}


x86 assembly (clang, -O0):
<tx_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_xtest@plt>
cmp    $0x0,%rax
je     113c <tx_end+0x1c>
mov    $0x0,%al
call   1040 <_xend@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx_end>:
push   %rax
xor    %eax,%eax
call   1030 <_xtest@plt>
test   %rax,%rax
je     1135 <tx_end+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_xend@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @tx_end() {
%1 = call i64 (...) @_xtest()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @_xend()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @tx_end() {
%1 = tail call i64 (...) @_xtest()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @_xend()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ div_const2(int);
void minmax_div_const2_Good() {
  div_const2(-1);
  div_const2(0);
}


x86 assembly (clang, -O0):
<minmax_div_const2_Good>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <div_const2@plt>
xor    %edi,%edi
call   1030 <div_const2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<minmax_div_const2_Good>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <div_const2@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <div_const2@plt>

LLVM IR (-O0):
define void @minmax_div_const2_Good() {
%1 = call i32 @div_const2(i32 -1)
%2 = call i32 @div_const2(i32 0)
ret void
}

LLVM IR (-O2):
define void @minmax_div_const2_Good() {
%1 = tail call i32 @div_const2(i32 -1)
%2 = tail call i32 @div_const2(i32 0)
ret void
}
/* Variables and functions */
int vprintf(char *, void **);
int puts(const char *str) {
  void *valist[1];
  valist[0] = str;
  return vprintf("%s\n", valist);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <vprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
mov    %rdi,(%rsp)
lea    0xee4(%rip),%rdi
mov    %rsp,%rsi
call   1030 <vprintf@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @puts(i8* %0) {
%2 = alloca [1 x i8*]
%3 = bitcast [1 x i8*]* %2 to i8*
%4 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
store i8* %0, i8** %4
%5 = call i32 @vprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %4)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;
struct serializer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ s_w8(struct serializer *, int);
void s_wb16(struct serializer *s, uint16_t u16) {
  s_w8(s, u16 >> 8);
  s_w8(s, (uint8_t)u16);
  return;
}


x86 assembly (clang, -O0):
<s_wb16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
call   1030 <s_w8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <s_w8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_wb16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
sar    $0x8,%esi
call   1030 <s_w8@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <s_w8@plt>

LLVM IR (-O0):
%struct.serializer = type { i32 }
define void @s_wb16(%struct.serializer* %0, i32 %1) {
%3 = alloca %struct.serializer*
%4 = alloca i32
store %struct.serializer* %0, %struct.serializer** %3
store i32 %1, i32* %4
%5 = load %struct.serializer*, %struct.serializer** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 8
%8 = call i32 @s_w8(%struct.serializer* %5, i32 %7)
%9 = load %struct.serializer*, %struct.serializer** %3
%10 = load i32, i32* %4
%11 = call i32 @s_w8(%struct.serializer* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.serializer = type { i32 }
define void @s_wb16(%struct.serializer* %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = tail call i32 @s_w8(%struct.serializer* %0, i32 %3)
%5 = tail call i32 @s_w8(%struct.serializer* %0, i32 %1)
ret void
}
/* Type definitions */
struct esp_rest {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ esp_rest_request(struct esp_rest *, char const *, char *,
                                    char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void esp_rest_get(struct esp_rest *er, const char *path, const char *data) {
  esp_rest_request(er, path, "GET", data, strlen(data));
}


x86 assembly (clang, -O0):
<esp_rest_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
lea    0xe95(%rip),%rdx
call   1030 <esp_rest_request@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp_rest_get>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
lea    0xec3(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rcx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <esp_rest_request@plt>

LLVM IR (-O0):
%struct.esp_rest = type { i32 }
@.str = [4 x i8] c"GET\00"
define void @esp_rest_get(%struct.esp_rest* %0, i8* %1, i8* %2) {
%4 = alloca %struct.esp_rest*
%5 = alloca i8*
%6 = alloca i8*
store %struct.esp_rest* %0, %struct.esp_rest** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.esp_rest*, %struct.esp_rest** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @esp_rest_request(%struct.esp_rest* %7, i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.esp_rest = type { i32 }
@.str = [4 x i8] c"GET\00"
define void @esp_rest_get(%struct.esp_rest* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @esp_rest_request(%struct.esp_rest* %0, i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %4)
ret void
}
/* Variables and functions */
int mode_index(int /*<<< orphan*/);
int /*<<< orphan*/ video_current_mode();
unsigned video_index(void) { return mode_index(video_current_mode()); }


x86 assembly (clang, -O0):
<video_index>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <video_current_mode@plt>
mov    %eax,%edi
call   1040 <mode_index@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_index>:
push   %rax
xor    %eax,%eax
call   1030 <video_current_mode@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <mode_index@plt>

LLVM IR (-O0):
define i32 @video_index() {
%1 = call i32 (...) @video_current_mode()
%2 = call i32 @mode_index(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @video_index() {
%1 = tail call i32 (...) @video_current_mode()
%2 = tail call i32 @mode_index(i32 %1)
ret i32 %2
}