xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fgetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseeko(int /*<<< orphan*/ *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ fsetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
uint64_t get_filesize(FILE *fp) {
  uint64_t file_size;
  fpos_t pos, pos_curr;
  fgetpos(fp, &pos_curr);
  fseeko(fp, 0, SEEK_END);
  fgetpos(fp, &pos);
  file_size = *(uint64_t *)&pos;
  fsetpos(fp, &pos_curr);
  return file_size;
}


x86 assembly (clang, -O0):
<get_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <fgetpos@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseeko@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <fgetpos@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <fsetpos@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filesize>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rsi
call   1030 <fgetpos@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseeko@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <fgetpos@plt>
mov    0x8(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <fsetpos@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @get_filesize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @fgetpos(i32* %6, i32* %5)
%8 = load i32*, i32** %2
%9 = load i32, i32* @SEEK_END
%10 = call i32 @fseeko(i32* %8, i32 0, i32 %9)
%11 = load i32*, i32** %2
%12 = call i32 @fgetpos(i32* %11, i32* %4)
%13 = load i32, i32* %4
store i32 %13, i32* %3
%14 = load i32*, i32** %2
%15 = call i32 @fsetpos(i32* %14, i32* %5)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @get_filesize(i32* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @fgetpos(i32* %0, i32* %3)
%7 = load i32, i32* @SEEK_END
%8 = tail call i32 @fseeko(i32* %0, i32 0, i32 %7)
%9 = call i32 @fgetpos(i32* %0, i32* %2)
%10 = load i32, i32* %2
%11 = call i32 @fsetpos(i32* %0, i32* %3)
ret i32 %10
}
/* Type definitions */
typedef int mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int S_IFIFO;
int /*<<< orphan*/ _MKNOD_VER;
int __xmknodat(int /*<<< orphan*/, int, char const *, int,
               int /*<<< orphan*/ *);
int mkfifoat(int fd, const char *file, mode_t mode) {
  dev_t dev = 0;
  return __xmknodat(_MKNOD_VER, fd, file, mode | S_IFIFO, &dev);
}


x86 assembly (clang, -O0):
<mkfifoat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    0x2e95(%rip),%rax
or     (%rax),%ecx
lea    -0x18(%rbp),%r8
call   1030 <__xmknodat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkfifoat>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x0,0x4(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
or     (%rax),%ecx
lea    0x4(%rsp),%r8
call   1030 <__xmknodat@plt>
pop    %rcx
ret

LLVM IR (-O0):
@_MKNOD_VER = global i32 0
@S_IFIFO = global i32 0
define i32 @mkfifoat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* @_MKNOD_VER
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32, i32* @S_IFIFO
%13 = or i32 %11, %12
%14 = call i32 @__xmknodat(i32 %8, i32 %9, i8* %10, i32 %13, i32* %7)
ret i32 %14
}

LLVM IR (-O2):
@_MKNOD_VER = global i32 0
@S_IFIFO = global i32 0
define i32 @mkfifoat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = load i32, i32* @_MKNOD_VER
%7 = load i32, i32* @S_IFIFO
%8 = or i32 %7, %2
%9 = call i32 @__xmknodat(i32 %6, i32 %0, i8* %1, i32 %8, i32* %4)
ret i32 %9
}
int foo(_Bool x) {
  _Bool t = 1;
  _Bool xx = !x;
  _Bool y = xx == t;
  _Bool z = y == x;
  return z ? 1 : 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x2(%rbp)
mov    -0x1(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x2(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x1(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i1 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = zext i1 %0 to i8
store i8 %7, i8* %2
store i8 1, i8* %3
%8 = load i8, i8* %2
%9 = trunc i8 %8 to i1
%10 = xor i1 %9, true
%11 = zext i1 %10 to i8
store i8 %11, i8* %4
%12 = load i8, i8* %4
%13 = trunc i8 %12 to i1
%14 = zext i1 %13 to i32
%15 = load i8, i8* %3
%16 = trunc i8 %15 to i1
%17 = zext i1 %16 to i32
%18 = icmp eq i32 %14, %17
%19 = zext i1 %18 to i8
store i8 %19, i8* %5
%20 = load i8, i8* %5
%21 = trunc i8 %20 to i1
%22 = zext i1 %21 to i32
%23 = load i8, i8* %2
%24 = trunc i8 %23 to i1
%25 = zext i1 %24 to i32
%26 = icmp eq i32 %22, %25
%27 = zext i1 %26 to i8
store i8 %27, i8* %6
%28 = load i8, i8* %6
%29 = trunc i8 %28 to i1
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 1, i32 0
ret i32 %31
}

LLVM IR (-O2):
define i32 @foo(i1 zeroext %0) {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t len) {
  void *ptr;
  len = nmemb * len;
  ptr = malloc(len);
  if (ptr) {
    memset(ptr, 0, len);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <calloc+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t CondSwapToBus32(uint32_t d) { return d; }


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

x86 assembly (clang, -O2):
<CondSwapToBus32>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @CondSwapToBus32(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
char *strstr(char *, char *);
void remover_comentarios(char *inputstring) {
  char *ponto;
  ponto = strstr(inputstring, "#");
  if (ponto) {
    *ponto = '\0';
    inputstring = ponto;
  }
}


x86 assembly (clang, -O0):
<remover_comentarios>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <remover_comentarios+0x3a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remover_comentarios>:
push   %rax
mov    $0x23,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <remover_comentarios+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int setgid(gid_t gid) {
  if (gid == 1)
    return 0;
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<setgid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <setgid+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1136 <setgid+0x36>
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb3(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setgid>:
xor    %eax,%eax
cmp    $0x1,%edi
je     111e <setgid+0x1e>
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    0x2ec9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
define i32 @setgid(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @EPERM
store i32 %4, i32* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ -1, %3 ], [ 0, %1 ]
ret i32 %6
}
void global_destroy() { double rate; }


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

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

LLVM IR (-O0):
define void @global_destroy() {
%1 = alloca double
ret void
}

LLVM IR (-O2):
define void @global_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_SET_BIT(int, int);
void xburst_cgm_gate_pcm() { MIPS_SET_BIT((0xB0000000 + 0x28), 3); }


x86 assembly (clang, -O0):
<xburst_cgm_gate_pcm>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x3,%esi
call   1030 <MIPS_SET_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_gate_pcm>:
mov    $0xb0000028,%edi
mov    $0x3,%esi
jmp    1030 <MIPS_SET_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_gate_pcm() {
%1 = call i32 @MIPS_SET_BIT(i32 -1342177240, i32 3)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_gate_pcm() {
%1 = tail call i32 @MIPS_SET_BIT(i32 -1342177240, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MS_SYNC;
int msync(void *, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void msync_fortran(size_t bytes, int fd, void *map) {
  if (msync(map, bytes, MS_SYNC) == -1) {
    perror("Error syncing the mmap file");
  }
}


x86 assembly (clang, -O0):
<msync_fortran>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
call   1030 <msync@plt>
cmp    $0xffffffff,%eax
jne    115e <msync_fortran+0x3e>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msync_fortran>:
push   %rax
mov    %rdx,%rax
mov    %rdi,%rsi
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%edx
mov    %rax,%rdi
call   1030 <msync@plt>
cmp    $0xffffffff,%eax
je     113f <msync_fortran+0x1f>
pop    %rax
ret
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@MS_SYNC = global i32 0
@.str = [28 x i8] c"Error syncing the mmap file\00"
define void @msync_fortran(i64 %0, i32 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i64, i64* %4
%9 = load i32, i32* @MS_SYNC
%10 = call i32 @msync(i8* %7, i64 %8, i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@MS_SYNC = global i32 0
@.str = [28 x i8] c"Error syncing the mmap file\00"
define void @msync_fortran(i64 %0, i32 %1, i8* %2) {
%4 = load i32, i32* @MS_SYNC
%5 = tail call i32 @msync(i8* %2, i64 %0, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}
unsigned xrop3_74_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S | D;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_74_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_74_0_0>:
shl    $0x8,%edi
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    0xff(%rdi),%eax
and    %ecx,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_74_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_74_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %4, 255
%8 = and i32 %6, %7
%9 = xor i32 %8, 255
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void pidfile_rm(char *pid_file) { unlink(pid_file); }


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

x86 assembly (clang, -O2):
<pidfile_rm>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @pidfile_rm(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
int fun1253() { return 1253; }


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

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

LLVM IR (-O0):
define i32 @fun1253() {
ret i32 1253
}

LLVM IR (-O2):
define i32 @fun1253() {
ret i32 1253
}
void genbnel_out() {}


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

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

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

LLVM IR (-O2):
define void @genbnel_out() {
ret void
}
int validate(int x, int y, int j, int i) {
  if (j > x + 1)
    return (1);
  if (i > y)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<validate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    112d <validate+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    114c <validate+0x4c>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1145 <validate+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <validate+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate>:
add    $0x1,%edi
cmp    %edx,%edi
setl   %al
cmp    %esi,%ecx
setg   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @validate(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %0, 1
%6 = icmp slt i32 %5, %2
%7 = icmp sgt i32 %3, %1
%8 = or i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int __builtin_divwe(int, int);
int div_we(int a, int b) { return __builtin_divwe(a, b); }


x86 assembly (clang, -O0):
<div_we>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__builtin_divwe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_we>:
jmp    1030 <__builtin_divwe@plt>

LLVM IR (-O0):
define i32 @div_we(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 = call i32 @__builtin_divwe(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @div_we(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_divwe(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little16(int /*<<< orphan*/);
uint16_t little2host16(uint16_t n) { return little16(n); }


x86 assembly (clang, -O0):
<little2host16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <little16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little2host16>:
jmp    1030 <little16@plt>

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

LLVM IR (-O2):
define i32 @little2host16(i32 %0) {
%2 = tail call i32 @little16(i32 %0)
ret i32 %2
}
double f1(double x) { return (x + 0.0) + 0.0; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
addsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0.000000e+00
%5 = fadd double %4, 0.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @f1(double %0) {
%2 = fadd double %0, 0.000000e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void child(void) { printf("child\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"child\00"
define void @child() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_66uint16_mem(unsigned short *val) {
  return ((*val) & (0x66 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_66uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x66,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_66uint16_mem>:
testb  $0x66,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_66uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 102
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_66uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 102
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
testAddressOf() {
  int a;
  printf("&a is %d\n", &a);
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"&a is %d\0A\00"
define i32 @testAddressOf() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"&a is %d\0A\00"
define i32 @testAddressOf() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 undef
}
int test_imm_C7int64_highword_reg(long long val) {
  return ((val >> 32) & (0xC7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C7int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xc7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C7int64_highword_reg>:
movabs $0xc700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C7int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 199
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_C7int64_highword_reg(i64 %0) {
%2 = and i64 %0, 854698491904
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void sort(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.sort = [5 x i8] c"sort\00"
define void @sort() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.sort, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.sort = [5 x i8] c"sort\00"
define void @sort() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.sort, i64 0, i64 0))
ret void
}
int wpa_supplicant_get_beacon_ie(void *wpa_s) {
  printf("%s - not implemented\n", __func__);
  return -1;
}


x86 assembly (clang, -O0):
<wpa_supplicant_get_beacon_ie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"%s - not implemented\0A\00"
@__func__.wpa_supplicant_get_beacon_ie = [29 x i8] c"wpa_supplicant_get_beacon_ie\00"
define i32 @wpa_supplicant_get_beacon_ie(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.wpa_supplicant_get_beacon_ie, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s - not implemented\0A\00"
@__func__.wpa_supplicant_get_beacon_ie = [29 x i8] c"wpa_supplicant_get_beacon_ie\00"
define i32 @wpa_supplicant_get_beacon_ie(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.wpa_supplicant_get_beacon_ie, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void befehle() {
  printf("Zum Speichern druecken sie s. \n");
  printf("Zum Auslesen druecken sie a. \n");
  printf("Zum Verlassen druecken sie v.\n");
}


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

x86 assembly (clang, -O2):
<befehle>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Zum Speichern druecken sie s. \0A\00"
@.str.1 = [31 x i8] c"Zum Auslesen druecken sie a. \0A\00"
@.str.2 = [31 x i8] c"Zum Verlassen druecken sie v.\0A\00"
define void @befehle() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"Zum Speichern druecken sie s. \00"
@str.3 = [30 x i8] c"Zum Auslesen druecken sie a. \00"
@str.4 = [30 x i8] c"Zum Verlassen druecken sie v.\00"
define void @befehle() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
double convertFahrenheitToCelsius(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int fTemp;
  printf("Introduzca la temperatura en Fahrenheit: \n", &fTemp);
  scanf("%d", &fTemp);
  printf("La temperatura %d Fahrenheit es equivalente a %-7.2f Celsius.\n",
         fTemp, convertFahrenheitToCelsius(fTemp));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1050 <convertFahrenheitToCelsius@plt>
lea    0xe8f(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Introduzca la temperatura en Fahrenheit: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [63 x i8] c"La temperatura %d Fahrenheit es equivalente a %-7.2f Celsius.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call double @convertFahrenheitToCelsius(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0), i32 %5, double %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [63 x i8] c"La temperatura %d Fahrenheit es equivalente a %-7.2f Celsius.\0A\00"
@str = [42 x i8] c"Introduzca la temperatura en Fahrenheit: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call double @convertFahrenheitToCelsius(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0), i32 %5, double %6)
ret i32 0
}
/* Type definitions */
struct elEventLoop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ elDelFileEvent(struct elEventLoop *, int, int);
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void clientSendFunc(struct elEventLoop *el, int fd, unsigned short mask,
                    void *data) {
  char *reply = "Hello World, too\n";
  send(fd, reply, strlen(reply), 0);
  elDelFileEvent(el, fd, 0x02);
}


x86 assembly (clang, -O0):
<clientSendFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    %rcx,-0x18(%rbp)
lea    0xeaf(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x2,%edx
call   1050 <elDelFileEvent@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clientSendFunc>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xebf(%rip),%r15
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <elDelFileEvent@plt>

LLVM IR (-O0):
%struct.elEventLoop = type { i32 }
@.str = [18 x i8] c"Hello World, too\0A\00"
define void @clientSendFunc(%struct.elEventLoop* %0, i32 %1, i16 zeroext %2, i8* %3) {
%5 = alloca %struct.elEventLoop*
%6 = alloca i32
%7 = alloca i16
%8 = alloca i8*
%9 = alloca i8*
store %struct.elEventLoop* %0, %struct.elEventLoop** %5
store i32 %1, i32* %6
store i16 %2, i16* %7
store i8* %3, i8** %8
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = load i32, i32* %6
%11 = load i8*, i8** %9
%12 = load i8*, i8** %9
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @send(i32 %10, i8* %11, i32 %13, i32 0)
%15 = load %struct.elEventLoop*, %struct.elEventLoop** %5
%16 = load i32, i32* %6
%17 = call i32 @elDelFileEvent(%struct.elEventLoop* %15, i32 %16, i32 2)
ret void
}

LLVM IR (-O2):
%struct.elEventLoop = type { i32 }
@.str = [18 x i8] c"Hello World, too\0A\00"
define void @clientSendFunc(%struct.elEventLoop* %0, i32 %1, i16 zeroext %2, i8* nocapture readnone %3) {
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @send(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5, i32 0)
%7 = tail call i32 @elDelFileEvent(%struct.elEventLoop* %0, i32 %1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vAssertCalled(char *, int);
void FaultISR(void) {
  while (1) {
    vAssertCalled(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/unpsjb-rtsg/slack-freertos/refs/heads/"
        "master/examples/lm3s6965evb/example1/startup.c",
        220);
  }
}


x86 assembly (clang, -O0):
<FaultISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <FaultISR+0x9>
lea    0xee0(%rip),%rdi
mov    $0xdc,%esi
call   1030 <vAssertCalled@plt>
jmp    1119 <FaultISR+0x9>

x86 assembly (clang, -O2):
<FaultISR>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0xdc,%esi
call   1030 <vAssertCalled@plt>
jmp    1120 <FaultISR+0x10>

LLVM IR (-O0):
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/unpsjb-rtsg/slack-freertos/refs/heads/master/examples/lm3s6965evb/example1/startup.c\00"
define void @FaultISR() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @vAssertCalled(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 220)
br label %1
}

LLVM IR (-O2):
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/unpsjb-rtsg/slack-freertos/refs/heads/master/examples/lm3s6965evb/example1/startup.c\00"
define void @FaultISR() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @vAssertCalled(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 220)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ right();
void move_right() { right(); }


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

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

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

LLVM IR (-O2):
define void @move_right() {
%1 = tail call i32 (...) @right()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deviceIf_emptyCbuffer();
void twoDsim_emptyCbuffer(void) { deviceIf_emptyCbuffer(); }


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

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

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

LLVM IR (-O2):
define void @twoDsim_emptyCbuffer() {
%1 = tail call i32 (...) @deviceIf_emptyCbuffer()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ read_64u(int /*<<< orphan*/ const *);
int64_t read_64s(const uint8_t *src) { return (int64_t)read_64u(src); }


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

x86 assembly (clang, -O2):
<read_64s>:
jmp    1030 <read_64u@plt>

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

LLVM IR (-O2):
define i32 @read_64s(i32* %0) {
%2 = tail call i32 @read_64u(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
void trim(char *s) {
  char *lastchar = s;
  while (*s != '\0') {
    if (!isspace(*s))
      lastchar = s;
    s++;
  }
  *(lastchar + 1) = '\0';
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <trim+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1151 <trim+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <trim+0x14>
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     113a <trim+0x2a>
mov    %r14,%rbx
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
cmove  %rbx,%r14
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <trim+0x10>
movb   $0x0,0x1(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @trim(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = tail call i32 @isspace(i8 signext %5)
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* %7, i8* %6
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i8* [ %0, %1 ], [ %10, %4 ]
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 0, i8* %16
ret void
}
char *langRomTypeZenima90() { return "Zenima 90 in 1"; }


x86 assembly (clang, -O0):
<langRomTypeZenima90>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeZenima90>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Zenima 90 in 1\00"
define i8* @langRomTypeZenima90() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"Zenima 90 in 1\00"
define i8* @langRomTypeZenima90() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world.\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 = [14 x i8] c"Hello world.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo564(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo564(i32 %0) {
ret void
}
int serial_to_flash_end() {}


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

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

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

LLVM IR (-O2):
define i32 @serial_to_flash_end() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ writel(int, void *);
void set__PIO_PCx__ALTERNATIVE_BIDIR_OPEN_DRAIN(void *base, int pin) {
  writel(((0x1) & 0x1) << pin, base + (0x24 + (2) * 0x10));
  writel(((0x1) & 0x1) << pin, base + (0x24 + (1) * 0x10));
  writel(((0x1) & 0x1) << pin, base + (0x24 + (0) * 0x10));
}


x86 assembly (clang, -O0):
<set__PIO_PCx__ALTERNATIVE_BIDIR_OPEN_DRAIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
mov    -0x8(%rbp),%rsi
add    $0x44,%rsi
call   1030 <writel@plt>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
mov    -0x8(%rbp),%rsi
add    $0x34,%rsi
call   1030 <writel@plt>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
mov    -0x8(%rbp),%rsi
add    $0x24,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set__PIO_PCx__ALTERNATIVE_BIDIR_OPEN_DRAIN>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ecx
mov    %rdi,%rbx
mov    $0x1,%ebp
shl    %cl,%ebp
lea    0x44(%rdi),%rsi
mov    %ebp,%edi
call   1030 <writel@plt>
lea    0x34(%rbx),%rsi
mov    %ebp,%edi
call   1030 <writel@plt>
add    $0x24,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @set__PIO_PCx__ALTERNATIVE_BIDIR_OPEN_DRAIN(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 = shl i32 1, %5
%7 = load i8*, i8** %3
%8 = getelementptr i8, i8* %7, i64 68
%9 = call i32 @writel(i32 %6, i8* %8)
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = load i8*, i8** %3
%13 = getelementptr i8, i8* %12, i64 52
%14 = call i32 @writel(i32 %11, i8* %13)
%15 = load i32, i32* %4
%16 = shl i32 1, %15
%17 = load i8*, i8** %3
%18 = getelementptr i8, i8* %17, i64 36
%19 = call i32 @writel(i32 %16, i8* %18)
ret void
}

LLVM IR (-O2):
define void @set__PIO_PCx__ALTERNATIVE_BIDIR_OPEN_DRAIN(i8* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = getelementptr i8, i8* %0, i64 68
%5 = tail call i32 @writel(i32 %3, i8* %4)
%6 = getelementptr i8, i8* %0, i64 52
%7 = tail call i32 @writel(i32 %3, i8* %6)
%8 = getelementptr i8, i8* %0, i64 36
%9 = tail call i32 @writel(i32 %3, i8* %8)
ret void
}
char *strcat(char *restrict s, const char *restrict append) {
  char *save = s;
  for (; *s; ++s)
    ;
  while ((*s++ = *append++))
    ;
  return (save);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1137 <strcat+0x37>
jmp    1126 <strcat+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    113c <strcat+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     116b <strcat+0x6b>
jmp    113c <strcat+0x3c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* noalias returned %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}