xunge/DecIR huggingface dataset:
__attribute__((always_)) unsigned short inw_p(unsigned short port) {
  unsigned short _v;
  asm volatile("in"
               "w"
               " %"
               "w"
               "1,%"
               ""
               "0"
               : "=a"(_v)
               : "Nd"(port));
  slow_down_io();
  return _v;
}


x86 assembly (clang, -O0):
<inw_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
movzwl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw_p>:
push   %rbx
mov    %edi,%edx
in     (%dx),%ax
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <slow_down_io@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = call i32 (...) @slow_down_io()
%7 = load i16, i16* %3
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = tail call i32 (...) @slow_down_io()
ret i16 %2
}
void genc_lt_s() {}


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

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

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

LLVM IR (-O2):
define void @genc_lt_s() {
ret void
}
void SPIIntFlagClear(unsigned long ulBase) {

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<SPIIntFlagClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIIntFlagClear>:
orq    $0x10,0x8(%rdi)
ret

LLVM IR (-O0):
define void @SPIIntFlagClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 16
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @SPIIntFlagClear(i64 %0) {
%2 = add i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 16
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func2();
int /*<<< orphan*/ func3();
int /*<<< orphan*/ func4();
void app_main(void) {
  func2();
  func3();
  func4();
}


x86 assembly (clang, -O0):
<app_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <func2@plt>
mov    $0x0,%al
call   1030 <func3@plt>
mov    $0x0,%al
call   1040 <func4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<app_main>:
push   %rax
xor    %eax,%eax
call   1050 <func2@plt>
xor    %eax,%eax
call   1030 <func3@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <func4@plt>

LLVM IR (-O0):
define void @app_main() {
%1 = call i32 (...) @func2()
%2 = call i32 (...) @func3()
%3 = call i32 (...) @func4()
ret void
}

LLVM IR (-O2):
define void @app_main() {
%1 = tail call i32 (...) @func2()
%2 = tail call i32 (...) @func3()
%3 = tail call i32 (...) @func4()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emsSetc(char const *, char const *);
void msgSetc(const char *token, const char *cvalue) { emsSetc(token, cvalue); }


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

x86 assembly (clang, -O2):
<msgSetc>:
jmp    1030 <emsSetc@plt>

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

LLVM IR (-O2):
define void @msgSetc(i8* %0, i8* %1) {
%3 = tail call i32 @emsSetc(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
overflo() {
  fprintf(stderr, "wordlist too large\n");
  exit(2);
}


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

x86 assembly (clang, -O2):
<overflo>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"wordlist too large\0A\00"
define i32 @overflo() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"wordlist too large\0A\00"
define i32 @overflo() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
float dtanh(float z) { return 1.0 - z * z; }


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

x86 assembly (clang, -O2):
<dtanh>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @dtanh(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fsub double 1.000000e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @dtanh(float %0) {
%2 = fmul float %0, %0
%3 = fsub float 1.000000e+00, %2
ret float %3
}
int XiuWuDuanHun_cost(struct Ability *self) { return 80; }


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

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

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

LLVM IR (-O2):
%struct.Ability = type opaque
define i32 @XiuWuDuanHun_cost(%struct.Ability* nocapture readnone %0) {
ret i32 80
}
void find_avgtime_nstates() {}


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

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

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

LLVM IR (-O2):
define void @find_avgtime_nstates() {
ret void
}
int FLAC_plugin__charset_test_conversion(char *from, char *to) {
  (void)from, (void)to;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @FLAC_plugin__charset_test_conversion(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
int network_handle(struct connection *conn) {
  int state = 500;
  printf(
      "%s %d: %s()\n",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/jammy-code/httpd/refs/heads/master/src/main.c",
      99, __func__);
  return state;
}


x86 assembly (clang, -O0):
<network_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1f4,-0xc(%rbp)
lea    0xed6(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x63,%edx
lea    0xf58(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_handle>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    $0x63,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1f4,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.connection = type opaque
@.str = [13 x i8] c"%s %d: %s()\0A\00"
@.str.1 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jammy-code/httpd/refs/heads/master/src/main.c\00"
@__func__.network_handle = [15 x i8] c"network_handle\00"
define i32 @network_handle(%struct.connection* %0) {
%2 = alloca %struct.connection*
%3 = alloca i32
store %struct.connection* %0, %struct.connection** %2
store i32 500, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.1, i64 0, i64 0), i32 99, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.network_handle, i64 0, i64 0))
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
%struct.connection = type opaque
@.str = [13 x i8] c"%s %d: %s()\0A\00"
@.str.1 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jammy-code/httpd/refs/heads/master/src/main.c\00"
@__func__.network_handle = [15 x i8] c"network_handle\00"
define i32 @network_handle(%struct.connection* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.1, i64 0, i64 0), i32 99, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.network_handle, i64 0, i64 0))
ret i32 500
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int __lxstat(int vers, const char *name, struct stat *buf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<__lxstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lxstat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @__lxstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat* %2, %struct.stat** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @__lxstat(i32 %0, i8* nocapture readnone %1, %struct.stat* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ PROXY_POLICY;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PROXY_POLICY_it;
void PROXY_POLICY_free(PROXY_POLICY *a) {
  ASN1_item_free((ASN1_VALUE *)a, &PROXY_POLICY_it);
}


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

x86 assembly (clang, -O2):
<PROXY_POLICY_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@PROXY_POLICY_it = global i32 0
define void @PROXY_POLICY_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @PROXY_POLICY_it)
ret void
}

LLVM IR (-O2):
@PROXY_POLICY_it = global i32 0
define void @PROXY_POLICY_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @PROXY_POLICY_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(int);
int /*<<< orphan*/ printf(char *);
void *_create_ll_node(int size) {
  void *head = NULL;
  head = malloc(size);
  if (!head) {
    printf("\nMalloc failed .. exiting ...");
    exit(-1);
  }
  return head;
}


x86 assembly (clang, -O0):
<_create_ll_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <_create_ll_node+0x40>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_create_ll_node>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <_create_ll_node+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0AMalloc failed .. exiting ...\00"
define i8* @_create_ll_node(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0AMalloc failed .. exiting ...\00"
define noalias i8* @_create_ll_node(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ gf2_matrix_times(int /*<<< orphan*/ *, int /*<<< orphan*/);
void gf2_matrix_square(uint64_t *square, uint64_t *mat) {
  unsigned n;
  for (n = 0; n < 64; n++)
    square[n] = gf2_matrix_times(mat, mat[n]);
}


x86 assembly (clang, -O0):
<gf2_matrix_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jae    115e <gf2_matrix_square+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
call   1030 <gf2_matrix_times@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <gf2_matrix_square+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf2_matrix_square>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r15,%rbx,4),%esi
mov    %r15,%rdi
call   1030 <gf2_matrix_times@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1120 <gf2_matrix_square+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @gf2_matrix_square(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = icmp ult i32 %7, 64
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32*, i32** %4
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @gf2_matrix_times(i32* %10, i32 %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 %16, i32* %20
br label %21
21: ; preds = %9
%22 = load i32, i32* %5
%23 = add i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @gf2_matrix_square(i32* nocapture writeonly %0, i32* %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @gf2_matrix_times(i32* %1, i32 %6)
%8 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %7, i32* %8
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 64
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
signed char signedchar_ignoring_signedlong(signed char x, signed long y) {
  return x;
}


x86 assembly (clang, -O0):
<signedchar_ignoring_signedlong>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @signedchar_ignoring_signedlong(i8 returned signext %0, i64 %1) {
ret i8 %0
}
void TEMP_function() {}


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

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

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

LLVM IR (-O2):
define void @TEMP_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int vetor[4][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}};
  printf("%d", vetor[1][0] + 1 + vetor[3][0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
add    -0xc(%rbp),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.vetor = [4 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 7, i32 8, i32 9], [3 x i32] [i32 10, i32 11, i32 12]]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [4 x [3 x i32]]
%2 = bitcast [4 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [4 x [3 x i32]], [4 x [3 x i32]]* %1, i64 0, i64 1
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
%7 = getelementptr inbounds [4 x [3 x i32]], [4 x [3 x i32]]* %1, i64 0, i64 3
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%9 = load i32, i32* %8
%10 = add nsw i32 %6, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
int cmp_dir(const char *dirname, void *priv) {
  return (dirname && !strcmp(dirname, (char *)priv));
}


x86 assembly (clang, -O0):
<cmp_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1148 <cmp_dir+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_dir>:
test   %rdi,%rdi
je     1129 <cmp_dir+0x19>
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_dir(i8* %0, i8* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(1) %1)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
main() {
  double variable = -48291.24142;
  printf("valor de variable: %6.5f", variable);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"valor de variable: %6.5f\00"
define i32 @main() {
%1 = alloca double
store double 0xC0E79467B9B66F93, double* %1
%2 = load double, double* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"valor de variable: %6.5f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 0xC0E79467B9B66F93)
ret i32 0
}
int isAlphaRex(char ch) {
  return ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'));
}


x86 assembly (clang, -O0):
<isAlphaRex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <isAlphaRex+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <isAlphaRex+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <isAlphaRex+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlphaRex>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isAlphaRex(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int rom_present(char *);
int lcs6821n_available(void) {
  return (rom_present(
      L"roms/scsi/ncr5380/Longshine LCS-6821N - BIOS version 1.04.bin"));
}


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

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

LLVM IR (-O0):
@.str = [62 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 99, i32 115, i32 105, i32 47, i32 110, i32 99, i32 114, i32 53, i32 51, i32 56, i32 48, i32 47, i32 76, i32 111, i32 110, i32 103, i32 115, i32 104, i32 105, i32 110, i32 101, i32 32, i32 76, i32 67, i32 83, i32 45, i32 54, i32 56, i32 50, i32 49, i32 78, i32 32, i32 45, i32 32, i32 66, i32 73, i32 79, i32 83, i32 32, i32 118, i32 101, i32 114, i32 115, i32 105, i32 111, i32 110, i32 32, i32 49, i32 46, i32 48, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @lcs6821n_available() {
%1 = call i32 @rom_present(i8* bitcast ([62 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [62 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 99, i32 115, i32 105, i32 47, i32 110, i32 99, i32 114, i32 53, i32 51, i32 56, i32 48, i32 47, i32 76, i32 111, i32 110, i32 103, i32 115, i32 104, i32 105, i32 110, i32 101, i32 32, i32 76, i32 67, i32 83, i32 45, i32 54, i32 56, i32 50, i32 49, i32 78, i32 32, i32 45, i32 32, i32 66, i32 73, i32 79, i32 83, i32 32, i32 118, i32 101, i32 114, i32 115, i32 105, i32 111, i32 110, i32 32, i32 49, i32 46, i32 48, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @lcs6821n_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([62 x i32]* @.str to i8*))
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateBatCheckStart(void) {
  (*((volatile uint32_t *)(0x400FC010))) |= 0x00000400;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateBatCheckStart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%ecx
or     $0x400,%ecx
mov    $0x400fc010,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateBatCheckStart>:
orl    $0x400,0x400fc010
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateBatCheckStart() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = or i32 %1, 1024
store volatile i32 %2, i32* inttoptr (i64 1074774032 to i32*)
%3 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateBatCheckStart() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = or i32 %1, 1024
store volatile i32 %2, i32* inttoptr (i64 1074774032 to i32*)
%3 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
long syscall3(int num, long a1, long a2, long a3) {
  long ret;
  __asm__ __volatile__("syscall"
                       : "=a"(ret)
                       : "a"(num), "D"(a1), "S"(a2), "d"(a3)
                       :);
  return ret;
}


x86 assembly (clang, -O0):
<syscall3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
syscall
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall3>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
syscall
ret

LLVM IR (-O0):
define i64 @syscall3(i32 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i32, i32* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %10, i64 %11, i64 %12, i64 %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @syscall3(i32 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i64 %1, i64 %2, i64 %3)
ret i64 %5
}
unsigned long long ones(int nbytes) {
  unsigned long long v;
  for (v = 0; nbytes--; v |= 255)
    v <<= 8;
  return v;
}


x86 assembly (clang, -O0):
<ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1142 <ones+0x42>
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0xff,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <ones+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones>:
test   %edi,%edi
je     1119 <ones+0x19>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111c <ones+0x1c>
xor    %eax,%eax
test   %ecx,%ecx
jne    1130 <ones+0x30>
jmp    1140 <ones+0x40>
xor    %eax,%eax
ret
and    $0xfffffff8,%edi
nop
add    $0xfffffff8,%edi
jne    1120 <ones+0x20>
mov    $0xffffffffffffffff,%rax
test   %ecx,%ecx
je     1140 <ones+0x40>
shl    $0x8,%rax
or     $0xff,%rax
add    $0xffffffff,%ecx
jne    1130 <ones+0x30>
ret
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @ones(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 0, i64* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i64, i64* %3
%10 = shl i64 %9, 8
store i64 %10, i64* %3
br label %11
11: ; preds = %8
%12 = load i64, i64* %3
%13 = or i64 %12, 255
store i64 %13, i64* %3
br label %4
14: ; preds = %4
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @ones(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %23, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 0, %7 ], [ %11, %9 ]
%11 = add i32 %10, 8
%12 = icmp eq i32 %11, %8
br i1 %12, label %13, label %9
13: ; preds = %9, %3
%14 = phi i64 [ 0, %3 ], [ -1, %9 ]
%15 = icmp eq i32 %5, 0
br i1 %15, label %23, label %16
16: ; preds = %13, %16
%17 = phi i64 [ %20, %16 ], [ %14, %13 ]
%18 = phi i32 [ %21, %16 ], [ 0, %13 ]
%19 = shl i64 %17, 8
%20 = or i64 %19, 255
%21 = add i32 %18, 1
%22 = icmp eq i32 %21, %5
br i1 %22, label %23, label %16
23: ; preds = %13, %16, %1
%24 = phi i64 [ 0, %1 ], [ -1, %13 ], [ %20, %16 ]
ret i64 %24
}
void BSP_TouchScreen_InterruptInit(void) {
  (*(volatile unsigned *)0x4a000008) &= ~(0x1 << 31);
  (*(volatile unsigned *)0x4a00001c) &= ~((0x1 << 9));
}


x86 assembly (clang, -O0):
<BSP_TouchScreen_InterruptInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4a000008,%eax
mov    (%rax),%ecx
and    $0x7fffffff,%ecx
mov    $0x4a000008,%eax
mov    %ecx,(%rax)
mov    $0x4a00001c,%eax
mov    (%rax),%ecx
and    $0xfffffdff,%ecx
mov    $0x4a00001c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_TouchScreen_InterruptInit>:
andl   $0x7fffffff,0x4a000008
ff ff ff 7f
andl   $0xfffffdff,0x4a00001c
ff fd ff ff
ret

LLVM IR (-O0):
define void @BSP_TouchScreen_InterruptInit() {
%1 = load volatile i32, i32* inttoptr (i64 1241513992 to i32*)
%2 = and i32 %1, 2147483647
store volatile i32 %2, i32* inttoptr (i64 1241513992 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1241514012 to i32*)
%4 = and i32 %3, -513
store volatile i32 %4, i32* inttoptr (i64 1241514012 to i32*)
ret void
}

LLVM IR (-O2):
define void @BSP_TouchScreen_InterruptInit() {
%1 = load volatile i32, i32* inttoptr (i64 1241513992 to i32*)
%2 = and i32 %1, 2147483647
store volatile i32 %2, i32* inttoptr (i64 1241513992 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1241514012 to i32*)
%4 = and i32 %3, -513
store volatile i32 %4, i32* inttoptr (i64 1241514012 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t sz) {
  void *p = malloc(sz);
  if (!p) {
    perror("malloc");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <xmalloc+0x3a>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
int sys_killpg(tcp)
struct tcb *tcp;
{
  return sys_kill(tcp);
}


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @sys_killpg(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @sys_kill to i32 (%struct.tcb*, ...)*)(%struct.tcb* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_killpg(%struct.tcb* %0) {
%2 = tail call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @sys_kill to i32 (%struct.tcb*, ...)*)(%struct.tcb* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zfree(void *data, void *addr) { free(addr); }


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

x86 assembly (clang, -O2):
<zfree>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @zfree(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 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @zfree(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void sync_alphabet(void) {}


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

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

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

LLVM IR (-O2):
define void @sync_alphabet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_syntax() { printf("create_initrd <root dir> <destination>\n"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"create_initrd <root dir> <destination>\0A\00"
define void @print_syntax() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"create_initrd <root dir> <destination>\00"
define void @print_syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long long __tzcnt_u64(unsigned long long);
unsigned long long func_tzcnt64(unsigned long long X) { return __tzcnt_u64(X); }


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

x86 assembly (clang, -O2):
<func_tzcnt64>:
jmp    1030 <__tzcnt_u64@plt>

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

LLVM IR (-O2):
define i64 @func_tzcnt64(i64 %0) {
%2 = tail call i64 @__tzcnt_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int **malloc(int);
void main() {
  int **y = malloc(sizeof(int *));
  *y = 0;
  int *z = 0;
  return;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x8,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32**
%2 = alloca i32*
%3 = call i32** @malloc(i32 8)
store i32** %3, i32*** %1
%4 = load i32**, i32*** %1
store i32* null, i32** %4
store i32* null, i32** %2
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32** @malloc(i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StringParseError();
int /*<<< orphan*/ SyntaxError(char const *);
void yyerror(const char *msg) {
  StringParseError();
  SyntaxError(msg);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <StringParseError@plt>
mov    -0x8(%rbp),%rdi
call   1030 <SyntaxError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <StringParseError@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <SyntaxError@plt>

LLVM IR (-O0):
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @StringParseError()
%4 = load i8*, i8** %2
%5 = call i32 @SyntaxError(i8* %4)
ret void
}

LLVM IR (-O2):
define void @yyerror(i8* %0) {
%2 = tail call i32 (...) @StringParseError()
%3 = tail call i32 @SyntaxError(i8* %0)
ret void
}
int test_imm_12uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x12 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_12uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 18
%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_12uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 77309411328
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar(int *);
void foo(void) {
  int x[8] __attribute__((aligned(128))) = {1, 1, 1, 1, 1, 1, 1, 1};
  bar(x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffff80,%rsp
sub    $0x80,%rsp
mov    0xeda(%rip),%rax
mov    %rax,(%rsp)
mov    0xed7(%rip),%rax
mov    %rax,0x8(%rsp)
mov    0xed3(%rip),%rax
mov    %rax,0x10(%rsp)
mov    0xecf(%rip),%rax
mov    %rax,0x18(%rsp)
mov    %rsp,%rdi
call   1030 <bar@plt>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffff80,%rsp
sub    $0x80,%rsp
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <bar@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@__const.foo.x = [8 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
define void @foo() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @bar(i32* %3)
ret void
}

LLVM IR (-O2):
@__const.foo.x = [8 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
define void @foo() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @bar(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tetris_send_delete();
void send_deletes(int deletes) {
  for (int i = 0; i < deletes; i++) {
    tetris_send_delete();
  }
}


x86 assembly (clang, -O0):
<send_deletes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <send_deletes+0x33>
mov    $0x0,%al
call   1030 <tetris_send_delete@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <send_deletes+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_deletes>:
push   %rbx
test   %edi,%edi
jle    112c <send_deletes+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <tetris_send_delete@plt>
add    $0xffffffff,%ebx
jne    1120 <send_deletes+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @send_deletes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @tetris_send_delete()
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @send_deletes(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @tetris_send_delete()
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
void multi_s() { register int out0 = 0; }


x86 assembly (clang, -O0):
<multi_s>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @multi_s() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Tut_ErrorExit(char *);
void *calloc(size_t, size_t);
void *Tut_Calloc(size_t num, size_t size) {
  void *mem = calloc(num, size);
  if (!mem)
    Tut_ErrorExit("Out of memory!\n");
  return mem;
}


x86 assembly (clang, -O0):
<Tut_Calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <Tut_Calloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <Tut_ErrorExit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @Tut_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 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @Tut_ErrorExit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory!\0A\00"
define noalias i8* @Tut_Calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Tut_ErrorExit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef unsigned long long uint16_t;

/* Variables and functions */
uint16_t be_sget(const uint8_t *addr) {
  uint16_t val = 0;
  val += ((unsigned long long)(addr[0]) << ((0) * 8));
  val += ((unsigned long long)(addr[1]) << ((1) * 8));
  return val;
}


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

x86 assembly (clang, -O2):
<be_sget>:
mov    0x8(%rdi),%rax
shl    $0x8,%rax
add    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @be_sget(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
store i64 0, i64* %3
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = shl i64 %6, 0
%8 = load i64, i64* %3
%9 = add i64 %8, %7
store i64 %9, i64* %3
%10 = load i64*, i64** %2
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = shl i64 %12, 8
%14 = load i64, i64* %3
%15 = add i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @be_sget(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = getelementptr inbounds i64, i64* %0, i64 1
%4 = load i64, i64* %3
%5 = shl i64 %4, 8
%6 = add i64 %5, %2
ret i64 %6
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
void WriteLong(unsigned char *buf, u_int32_t value) {
  buf[0] = (unsigned char)(value >> 24);
  buf[1] = (unsigned char)(value >> 16);
  buf[2] = (unsigned char)(value >> 8);
  buf[3] = (unsigned char)value;
}


x86 assembly (clang, -O0):
<WriteLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLong>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @WriteLong(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i32, i32* %4
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @WriteLong(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}