xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sendbyte(int /*<<< orphan*/);
void copy_out(unsigned char *adr, int len) {
  while (len--) {
    sendbyte(*adr++);
  }
}


x86 assembly (clang, -O0):
<copy_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     114f <copy_out+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <sendbyte@plt>
jmp    111f <copy_out+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_out>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <copy_out+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <sendbyte@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <copy_out+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @copy_out(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = zext i8 %12 to i32
%14 = call i32 @sendbyte(i32 %13)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @copy_out(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 @sendbyte(i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("10.1a16");
  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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"10.1a16\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct udphdr {
  int /*<<< orphan*/ len;
};

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t udphdr_len_ntohs(struct udphdr *h) { return ntohs(h->len); }


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

x86 assembly (clang, -O2):
<udphdr_len_ntohs>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.udphdr = type { i32 }
define i32 @udphdr_len_ntohs(%struct.udphdr* %0) {
%2 = alloca %struct.udphdr*
store %struct.udphdr* %0, %struct.udphdr** %2
%3 = load %struct.udphdr*, %struct.udphdr** %2
%4 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.udphdr = type { i32 }
define i32 @udphdr_len_ntohs(%struct.udphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ SSIBaseValid(unsigned long);
void SSIEnable(unsigned long ulBase) {
  DEBUG_ASSERT(SSIBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000004))) |= 0x00000002;
}


x86 assembly (clang, -O0):
<SSIEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     $0x2,%rcx
mov    %rcx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIEnable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
orq    $0x2,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @SSIEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @SSIBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, 2
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @SSIEnable(i64 %0) {
%2 = tail call i32 @SSIBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 2
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UARTD2_SendData(char *, int);
int strlen(char *);
void Display_SW_Version() {
  UARTD2_SendData("Version: V0.01.1    Build date: 2012-07-27",
                  strlen("Version: V0.01.1    Build date: 2012-07-27") *
                      sizeof(char));
  return;
}


x86 assembly (clang, -O0):
<Display_SW_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1040 <UARTD2_SendData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Display_SW_Version>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <UARTD2_SendData@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Version: V0.01.1 Build date: 2012-07-27\00"
define void @Display_SW_Version() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = mul i64 %2, 1
%4 = trunc i64 %3 to i32
%5 = call i32 @UARTD2_SendData(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Version: V0.01.1 Build date: 2012-07-27\00"
define void @Display_SW_Version() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @UARTD2_SendData(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int ssize_t;
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ lseek(int, scalar_t__, int /*<<< orphan*/);
int read(int, void *, size_t);
ssize_t pread(int fd, void *buf, size_t len, off_t off) {
  if (lseek(fd, off, SEEK_SET) == (off_t)-1)
    return -1;
  return read(fd, buf, len);
}


x86 assembly (clang, -O0):
<pread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    $0xffffffffffffffff,%rax
jne    1162 <pread+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <pread+0x55>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pread>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    %rcx,%rsi
call   1030 <lseek@plt>
cmp    $0xffffffffffffffff,%rax
je     1154 <pread+0x34>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <read@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @pread(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
%10 = load i32, i32* %6
%11 = load i64, i64* %9
%12 = load i32, i32* @SEEK_SET
%13 = call i64 @lseek(i32 %10, i64 %11, i32 %12)
%14 = icmp eq i64 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %4
store i32 -1, i32* %5
br label %21
16: ; preds = %4
%17 = load i32, i32* %6
%18 = load i8*, i8** %7
%19 = load i64, i64* %8
%20 = call i32 @read(i32 %17, i8* %18, i64 %19)
store i32 %20, i32* %5
br label %21
21: ; preds = %16, %15
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @pread(i32 %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i64 @lseek(i32 %0, i64 %3, i32 %5)
%7 = icmp eq i64 %6, -1
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ -1, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xfe() {
  Assert_real((islower(254) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1275, ("islower should be 0 for 0xfe"));
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo459(i32 %0) {
ret void
}
int qsort_cmp__VEC_VAL(const void *x, const void *y) {
  if (*((double *)x) > *((double *)y))
    return (-1);
  else
    return (*((double *)x) < *((double *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp__VEC_VAL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112e <qsort_cmp__VEC_VAL+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <qsort_cmp__VEC_VAL+0x4d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp__VEC_VAL>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qsort_cmp__VEC_VAL(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 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp ogt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp olt double %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @qsort_cmp__VEC_VAL(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int strcmp(char *, char *);
int compara_palavras(void *p1, void *p2) {
  char *s1 = p1, *s2 = p2;
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<compara_palavras>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compara_palavras(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int buf_add_mem(struct buffer *, char *, int);
int /*<<< orphan*/ exit(int);
void buf_null_terminate(struct buffer *buf) {
  if (buf_add_mem(buf, "\0", 1) == -1)
    exit(1);
}


x86 assembly (clang, -O0):
<buf_null_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x1,%edx
call   1030 <buf_add_mem@plt>
cmp    $0xffffffff,%eax
jne    1154 <buf_null_terminate+0x34>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_null_terminate>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edx
call   1030 <buf_add_mem@plt>
cmp    $0xffffffff,%eax
je     1139 <buf_null_terminate+0x19>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
@.str = [2 x i8] zeroinitializer
define void @buf_null_terminate(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
store %struct.buffer* %0, %struct.buffer** %2
%3 = load %struct.buffer*, %struct.buffer** %2
%4 = call i32 @buf_add_mem(%struct.buffer* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
@.str = [2 x i8] zeroinitializer
define void @buf_null_terminate(%struct.buffer* %0) {
%2 = tail call i32 @buf_add_mem(%struct.buffer* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strLength(char *);
int main() {
  char msg[] = "hello";
  char *msg1 = "hello";
  int l = strLength(msg1);
  printf("the length is %d \n", l);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strLength@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.msg = [6 x i8] c"hello\00"
@.str = [6 x i8] c"hello\00"
@.str.1 = [19 x i8] c"the length is %d \0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca i8*
%3 = alloca i32
%4 = bitcast [6 x i8]* %1 to i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strLength(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [19 x i8] c"the length is %d \0A\00"
define i32 @main() {
%1 = tail call i32 @strLength(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ __cmpdf2(float, float);
int __ltdf2(double a1, double a2) {
  return -(__cmpdf2((float)a1, (float)a2) < 0);
}


x86 assembly (clang, -O0):
<__ltdf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <__cmpdf2@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltdf2>:
push   %rax
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
call   1030 <__cmpdf2@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__ltdf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptrunc double %5 to float
%7 = load double, double* %4
%8 = fptrunc double %7 to float
%9 = call i64 @__cmpdf2(float %6, float %8)
%10 = icmp slt i64 %9, 0
%11 = zext i1 %10 to i32
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @__ltdf2(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = tail call i64 @__cmpdf2(float %3, float %4)
%6 = ashr i64 %5, 63
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Type definitions */
struct DEMO {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct DEMO *);
void demo_free(struct DEMO *a) { free(a); }


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

x86 assembly (clang, -O2):
<demo_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.DEMO = type { i32 }
define void @demo_free(%struct.DEMO* %0) {
%2 = alloca %struct.DEMO*
store %struct.DEMO* %0, %struct.DEMO** %2
%3 = load %struct.DEMO*, %struct.DEMO** %2
%4 = call i32 @free(%struct.DEMO* %3)
ret void
}

LLVM IR (-O2):
%struct.DEMO = type { i32 }
define void @demo_free(%struct.DEMO* nocapture %0) {
%2 = tail call i32 @free(%struct.DEMO* %0)
ret void
}
void logging_init() {}


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

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

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

LLVM IR (-O2):
define void @logging_init() {
ret void
}
void avcodec_dct_init() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_dct_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CPROVER_isinf(float);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main() {
  float temp;
  temp = 1.8e307f + 1.5e50f;
  assert(__CPROVER_isinf(temp));
  float x;
  x = temp - temp;
  assert(__CPROVER_isinf(temp));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <__CPROVER_isinf@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movss  -0x4(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <__CPROVER_isinf@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1040 <__CPROVER_isinf@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movss  0xec3(%rip),%xmm0
call   1040 <__CPROVER_isinf@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca float
store float 0x7FF0000000000000, float* %1
%3 = load float, float* %1
%4 = call i32 @__CPROVER_isinf(float %3)
%5 = call i32 @assert(i32 %4)
%6 = load float, float* %1
%7 = load float, float* %1
%8 = fsub float %6, %7
store float %8, float* %2
%9 = load float, float* %1
%10 = call i32 @__CPROVER_isinf(float %9)
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__CPROVER_isinf(float 0x7FF0000000000000)
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @__CPROVER_isinf(float 0x7FF0000000000000)
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
OP(dd, c6) {
  illegal_1();
  op_c6();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_c6@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_c6()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_c6()
ret i32 undef
}
int emac2_aoctetsreceivedok_set(unsigned int dev_id,
                                union emac2_aoctetsreceivedok_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_aoctetsreceivedok_u = type opaque
define i32 @emac2_aoctetsreceivedok_set(i32 %0, %union.emac2_aoctetsreceivedok_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_aoctetsreceivedok_u*
store i32 %0, i32* %3
store %union.emac2_aoctetsreceivedok_u* %1, %union.emac2_aoctetsreceivedok_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_aoctetsreceivedok_u = type opaque
define i32 @emac2_aoctetsreceivedok_set(i32 %0, %union.emac2_aoctetsreceivedok_u* nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
struct timeval {
  int tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ panic(char *);
unsigned long long sysutime() {
  struct timeval tv;
  if (gettimeofday(&tv, NULL) < 0) {
    panic("Unable to get system time!");
  }
  return tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<sysutime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    114b <sysutime+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <panic@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysutime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
jns    1141 <sysutime+0x21>
lea    0xec4(%rip),%rdi
call   1040 <panic@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@.str = [27 x i8] c"Unable to get system time!\00"
define i64 @sysutime() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @panic(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000000
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@.str = [27 x i8] c"Unable to get system time!\00"
define i64 @sysutime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @panic(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000000
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = add i64 %13, %11
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void vnetlib_close(void *h) {
  if (h) {
    dlclose(h);
  }
}


x86 assembly (clang, -O0):
<vnetlib_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <vnetlib_close+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <dlclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnetlib_close>:
test   %rdi,%rdi
je     111a <vnetlib_close+0xa>
jmp    1030 <dlclose@plt>
ret

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

LLVM IR (-O2):
define void @vnetlib_close(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @dlclose(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t EMACVLANHashFilterGet(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x400EC000);
  return ((*((volatile uint32_t *)(ui32Base + 0x00000588))));
}


x86 assembly (clang, -O0):
<EMACVLANHashFilterGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x400ec000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x588,%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACVLANHashFilterGet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x400ec000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x588(%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @EMACVLANHashFilterGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074708480
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1416
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @EMACVLANHashFilterGet(i32 %0) {
%2 = icmp eq i32 %0, 1074708480
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 1416
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}
/* Type definitions */
typedef int key_t;

/* Variables and functions */
int ftok(char const *, int);
int shmget(int, int /*<<< orphan*/, int /*<<< orphan*/);
int qshm_getid(const char *keyfile, int keyid) {
  int shmid;
  key_t semkey = ftok(keyfile, keyid);
  if (semkey == -1)
    return -1;
  if ((shmid = shmget(semkey, 0, 0)) == -1)
    return -1;
  return shmid;
}


x86 assembly (clang, -O0):
<qshm_getid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <ftok@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1154 <qshm_getid+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <qshm_getid+0x5e>
mov    -0x1c(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <shmget@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1178 <qshm_getid+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <qshm_getid+0x5e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qshm_getid>:
push   %rax
call   1040 <ftok@plt>
cmp    $0xffffffff,%eax
je     1137 <qshm_getid+0x17>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <shmget@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @qshm_getid(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @ftok(i8* %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %21
14: ; preds = %2
%15 = load i32, i32* %7
%16 = call i32 @shmget(i32 %15, i32 0, i32 0)
store i32 %16, i32* %6
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 -1, i32* %3
br label %21
19: ; preds = %14
%20 = load i32, i32* %6
store i32 %20, i32* %3
br label %21
21: ; preds = %19, %18, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @qshm_getid(i8* %0, i32 %1) {
%3 = tail call i32 @ftok(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @shmget(i32 %3, i32 0, i32 0)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ -1, %2 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i;
  printf("\nDigite as horas : %d");
  printf("\nDigite as horas : %d", 12);
  printf("\nDigite as horas :");
  scanf("%d", &i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"\0ADigite as horas : %d\00"
@.str.1 = [19 x i8] c"\0ADigite as horas :\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 12)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
ret i32 0
}
char read08(unsigned long reg1) {
  unsigned long *reg;
  signed char val;
  reg = reg1;
  val = (char)(*reg);
  return val;
}


x86 assembly (clang, -O0):
<read08>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read08>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @read08(i64 %0) {
%2 = alloca i64
%3 = alloca i64*
%4 = alloca i8
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = inttoptr i64 %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i8
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @read08(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
char const *getenv(char const *);
const char *my_getenv(const char *name) { return getenv(name); }


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

x86 assembly (clang, -O2):
<my_getenv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @my_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
long long int cpucycles(void) {
  unsigned long long result;
  __asm__ volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax"
                   : "=a"(result)::"%rdx");
  return result;
}


x86 assembly (clang, -O0):
<cpucycles>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpucycles>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @cpucycles() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @cpucycles() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
int __parent(const int idx) { return (idx - 1) / 2; }


x86 assembly (clang, -O0):
<__parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__parent>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @__parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @__parent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int *malloc(size_t);
void bug(size_t size) {
  int *array = malloc(size);
  array[4] = 0;
}


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

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

LLVM IR (-O0):
define void @bug(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32* @malloc(i64 %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 4
store i32 0, i32* %7
ret void
}

LLVM IR (-O2):
define void @bug(i64 %0) {
%2 = tail call i32* @malloc(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void printTimingStart(const char *platformName, const char *routineName) {
  printf("Start timing measurement for function ' %s ' in platform ' %s '...\n",
         routineName, platformName);
}


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

x86 assembly (clang, -O2):
<printTimingStart>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"Start timing measurement for function ' %s ' in platform ' %s '...\0A\00"
define void @printTimingStart(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"Start timing measurement for function ' %s ' in platform ' %s '...\0A\00"
define void @printTimingStart(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func2(int);
int main() {
  int a, b, c, d, e, f, g, h, j, k, x, y;
  func2(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    -0x4(%rbp),%edi
call   1030 <func2@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func2(i32 undef)
ret i32 0
}
/* Variables and functions */
int maxProfit(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  int prices[6] = {7, 1, 5, 3, 6, 4};
  int res = maxProfit(prices, 6);
  printf("最大利润结果:%d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xee5(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xedf(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
call   1040 <maxProfit@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
mov    0xec9(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1050 <maxProfit@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@__const.main.prices = [6 x i32] [i32 7, i32 1, i32 5, i32 3, i32 6, i32 4]
@.str.1 = [23 x i8] c"\E6\9C\80\E5\A4\A7\E5\88\A9\E6\B6\A6\E7\BB\93\E6\9E\9C:%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = bitcast [6 x i32]* %6 to i8*
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%11 = call i32 @maxProfit(i32* %10, i32 6)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.prices = [6 x i32] [i32 7, i32 1, i32 5, i32 3, i32 6, i32 4]
@.str.1 = [23 x i8] c"\E6\9C\80\E5\A4\A7\E5\88\A9\E6\B6\A6\E7\BB\93\E6\9E\9C:%d\0A\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = bitcast [6 x i32]* %3 to i8*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%7 = call i32 @maxProfit(i32* %6, i32 6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() { int a = __VERIFIER_nondet_int(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void the_function(void) {
  printf("At start of the_function\n");
woops:
  __asm__ volatile("int3");
  printf("At end of the_function\n");
  printf("The faulting address should have been 0x%08lx\n",
         (unsigned long)&&woops);
}


x86 assembly (clang, -O0):
<the_function>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
int3
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
xor    %eax,%eax
lea    -0x1f(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<the_function>:
push   %rax
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
int3
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
lea    -0x1b(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"At start of the_function\0A\00"
@.str.1 = [24 x i8] c"At end of the_function\0A\00"
@.str.2 = [47 x i8] c"The faulting address should have been 0x%08lx\0A\00"
define void @the_function() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %5, %0
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@the_function, %2) to i64))
ret void
5: ; No predecessors!
indirectbr i8* undef, [label %2]
}

LLVM IR (-O2):
@.str.2 = [47 x i8] c"The faulting address should have been 0x%08lx\0A\00"
@str = [25 x i8] c"At start of the_function\00"
@str.3 = [23 x i8] c"At end of the_function\00"
define void @the_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0
tail call void asm sideeffect "int3", "~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@the_function, %2) to i64))
ret void
}
/* Type definitions */
struct ptr_list {
  int dummy;
};
struct instruction_list {
  int dummy;
};
struct instruction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete_ptr_list_entry(struct ptr_list **,
                                         struct instruction *, int);
void remove_instruction(struct instruction_list **list,
                        struct instruction *insn, int count) {
  delete_ptr_list_entry((struct ptr_list **)list, insn, count);
}


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

x86 assembly (clang, -O2):
<remove_instruction>:
jmp    1030 <delete_ptr_list_entry@plt>

LLVM IR (-O0):
%struct.instruction_list = type { i32 }
%struct.instruction = type { i32 }
%struct.ptr_list = type { i32 }
define void @remove_instruction(%struct.instruction_list** %0, %struct.instruction* %1, i32 %2) {
%4 = alloca %struct.instruction_list**
%5 = alloca %struct.instruction*
%6 = alloca i32
store %struct.instruction_list** %0, %struct.instruction_list*** %4
store %struct.instruction* %1, %struct.instruction** %5
store i32 %2, i32* %6
%7 = load %struct.instruction_list**, %struct.instruction_list*** %4
%8 = bitcast %struct.instruction_list** %7 to %struct.ptr_list**
%9 = load %struct.instruction*, %struct.instruction** %5
%10 = load i32, i32* %6
%11 = call i32 @delete_ptr_list_entry(%struct.ptr_list** %8, %struct.instruction* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.instruction_list = type { i32 }
%struct.instruction = type { i32 }
%struct.ptr_list = type { i32 }
define void @remove_instruction(%struct.instruction_list** %0, %struct.instruction* %1, i32 %2) {
%4 = bitcast %struct.instruction_list** %0 to %struct.ptr_list**
%5 = tail call i32 @delete_ptr_list_entry(%struct.ptr_list** %4, %struct.instruction* %1, i32 %2)
ret void
}