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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *myFile;
  myFile = fopen("junk", "w");
  fprintf(myFile, "Hello world\n");
  fprintf(myFile, "All done ... goodbye.\n");
  fclose(myFile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xeb9(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
lea    0xead(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"junk\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"Hello world\0A\00"
@.str.3 = [23 x i8] c"All done ... goodbye.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = call i32 @fclose(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"junk\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"Hello world\0A\00"
@.str.3 = [23 x i8] c"All done ... goodbye.\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %1)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 22, i64 1, i32* %1)
%4 = tail call i32 @fclose(i32* %1)
ret i32 0
}
int neededSectors(int charactersToStore) {
  int rem = 0;
  if (charactersToStore % 512 != 0) {
    rem = 1;
  }
  return (charactersToStore / 512) + rem;
}


x86 assembly (clang, -O0):
<neededSectors>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1129 <neededSectors+0x29>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neededSectors>:
mov    %edi,%ecx
and    $0x1ff,%ecx
lea    0x1ff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x9,%eax
cmp    $0x1,%ecx
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @neededSectors(i32 %0) {
%2 = and i32 %0, 511
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = sdiv i32 %0, 512
%6 = add nsw i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int quaddobl_witness_set_to_system_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(667, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<quaddobl_witness_set_to_system_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x29b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_witness_set_to_system_container>:
mov    $0x29b,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @quaddobl_witness_set_to_system_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 667, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @quaddobl_witness_set_to_system_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 667, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void xxx_free(void *obj) {}


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

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

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

LLVM IR (-O2):
define void @xxx_free(i8* nocapture %0) {
ret void
}
char *mpc_event_api_name(void) { return "epoll"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"epoll\00"
define i8* @mpc_event_api_name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"epoll\00"
define i8* @mpc_event_api_name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
unsigned ZWRAP_isLittleEndian(void) {
  const union {
    unsigned u;
    char c[4];
  } one = {1};
  return one.c[0];
}


x86 assembly (clang, -O0):
<ZWRAP_isLittleEndian>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
@__const.ZWRAP_isLittleEndian.one = %union.anon { i32 1 }
define i32 @ZWRAP_isLittleEndian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ZWRAP_isLittleEndian() {
ret i32 1
}
/* Type definitions */
struct mcs {
  int dummy;
};

/* Variables and functions */
bool mcs_islocked(struct mcs *l) { return l != NULL; }


x86 assembly (clang, -O0):
<mcs_islocked>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcs_islocked>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
%struct.mcs = type { i32 }
define i32 @mcs_islocked(%struct.mcs* %0) {
%2 = alloca %struct.mcs*
store %struct.mcs* %0, %struct.mcs** %2
%3 = load %struct.mcs*, %struct.mcs** %2
%4 = icmp ne %struct.mcs* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.mcs = type { i32 }
define i32 @mcs_islocked(%struct.mcs* readnone %0) {
%2 = icmp ne %struct.mcs* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setuid(0);
  system("sudo ntpdate -s us.pool.ntp.org");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xec3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"sudo ntpdate -s us.pool.ntp.org\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"sudo ntpdate -s us.pool.ntp.org\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRA7_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRA7_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRA7_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS7_ENC_CONTENT;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS7_ENC_CONTENT_it;
int i2d_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &PKCS7_ENC_CONTENT_it);
}


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

x86 assembly (clang, -O2):
<i2d_PKCS7_ENC_CONTENT>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@PKCS7_ENC_CONTENT_it = global i32 0
define i32 @i2d_PKCS7_ENC_CONTENT(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @PKCS7_ENC_CONTENT_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void _Exit(int status) { bar(status); }


x86 assembly (clang, -O0):
<_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bar@plt>

x86 assembly (clang, -O2):
<_Exit>:
push   %rax
call   1030 <bar@plt>

LLVM IR (-O0):
define void @_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bar(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_Exit(i32 %0) {
%2 = tail call i32 @bar(i32 %0)
unreachable
}
/* Type definitions */
struct mloop_socket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mloop__ref_any(struct mloop_socket *);
__attribute__((visibility("default"))) void
mloop_socket_ref(struct mloop_socket *self) {
  mloop__ref_any(self);
}


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

x86 assembly (clang, -O2):
<mloop_socket_ref>:
jmp    1030 <mloop__ref_any@plt>

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

LLVM IR (-O2):
%struct.mloop_socket = type { i32 }
define void @mloop_socket_ref(%struct.mloop_socket* %0) {
%2 = tail call i32 @mloop__ref_any(%struct.mloop_socket* %0)
ret void
}
int b2s23(int cell, int neighbors) {
  if ((cell == 1 && ((neighbors < 2) || (neighbors > 3)))) {
    return 0;
  }
  if ((cell == 1 && (neighbors == 2 || neighbors == 3))) {
    return 1;
  }
  if ((cell == 0 && neighbors == 3)) {
    return 1;
  }
  return cell;
}


x86 assembly (clang, -O0):
<b2s23>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1134 <b2s23+0x34>
cmpl   $0x2,-0xc(%rbp)
jl     1128 <b2s23+0x28>
cmpl   $0x3,-0xc(%rbp)
jle    1134 <b2s23+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1184 <b2s23+0x84>
cmpl   $0x1,-0x8(%rbp)
jne    115e <b2s23+0x5e>
cmpl   $0x2,-0xc(%rbp)
je     1152 <b2s23+0x52>
cmpl   $0x3,-0xc(%rbp)
jne    115e <b2s23+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1184 <b2s23+0x84>
cmpl   $0x0,-0x8(%rbp)
jne    117e <b2s23+0x7e>
cmpl   $0x3,-0xc(%rbp)
jne    117e <b2s23+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    1184 <b2s23+0x84>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b2s23>:
cmp    $0x1,%edi
jne    1110 <b2s23+0x10>
lea    -0x4(%rsi),%ecx
xor    %eax,%eax
cmp    $0xfffffffe,%ecx
jae    1110 <b2s23+0x10>
ret
cmp    $0x1,%edi
jne    1124 <b2s23+0x24>
mov    %esi,%ecx
and    $0xfffffffe,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
je     110f <b2s23+0xf>
xor    $0x3,%esi
or     %edi,%esi
mov    $0x1,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @b2s23(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 2
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %5
%13 = icmp sgt i32 %12, 3
br i1 %13, label %14, label %15
14: ; preds = %11, %8
store i32 0, i32* %3
br label %34
15: ; preds = %11, %2
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i32, i32* %5
%20 = icmp eq i32 %19, 2
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 3
br i1 %23, label %24, label %25
24: ; preds = %21, %18
store i32 1, i32* %3
br label %34
25: ; preds = %21, %15
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %5
%30 = icmp eq i32 %29, 3
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 1, i32* %3
br label %34
32: ; preds = %28, %25
%33 = load i32, i32* %4
store i32 %33, i32* %3
br label %34
34: ; preds = %32, %31, %24, %14
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @b2s23(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = add i32 %1, -4
%5 = icmp ult i32 %4, -2
%6 = and i1 %3, %5
br i1 %6, label %16, label %7
7: ; preds = %2
%8 = and i32 %1, -2
%9 = icmp eq i32 %8, 2
%10 = and i1 %3, %9
br i1 %10, label %16, label %11
11: ; preds = %7
%12 = icmp eq i32 %0, 0
%13 = icmp eq i32 %1, 3
%14 = and i1 %12, %13
%15 = select i1 %14, i32 1, i32 %0
br label %16
16: ; preds = %11, %7, %2
%17 = phi i32 [ 0, %2 ], [ 1, %7 ], [ %15, %11 ]
ret i32 %17
}
/* Type definitions */
struct Cyc_Tcenv_Genv {
  int dummy;
};
struct Cyc_List_List {
  int dummy;
};
struct Cyc_Interface_I {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Interface_gen_extract(struct Cyc_Tcenv_Genv *, int,
                                             struct Cyc_List_List *);
struct Cyc_Interface_I *Cyc_Interface_extract(struct Cyc_Tcenv_Genv *ae,
                                              struct Cyc_List_List *tds) {
  return ({ Cyc_Interface_gen_extract(ae, 1, tds); });
}


x86 assembly (clang, -O0):
<Cyc_Interface_extract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <Cyc_Interface_gen_extract@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Interface_extract>:
push   %rax
mov    %rsi,%rdx
mov    $0x1,%esi
call   1030 <Cyc_Interface_gen_extract@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_Interface_I = type { i32 }
%struct.Cyc_Tcenv_Genv = type { i32 }
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_Interface_I* @Cyc_Interface_extract(%struct.Cyc_Tcenv_Genv* %0, %struct.Cyc_List_List* %1) {
%3 = alloca %struct.Cyc_Tcenv_Genv*
%4 = alloca %struct.Cyc_List_List*
%5 = alloca i32
store %struct.Cyc_Tcenv_Genv* %0, %struct.Cyc_Tcenv_Genv** %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_Tcenv_Genv*, %struct.Cyc_Tcenv_Genv** %3
%7 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%8 = call i32 @Cyc_Interface_gen_extract(%struct.Cyc_Tcenv_Genv* %6, i32 1, %struct.Cyc_List_List* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to %struct.Cyc_Interface_I*
ret %struct.Cyc_Interface_I* %11
}

LLVM IR (-O2):
%struct.Cyc_Interface_I = type { i32 }
%struct.Cyc_Tcenv_Genv = type { i32 }
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_Interface_I* @Cyc_Interface_extract(%struct.Cyc_Tcenv_Genv* %0, %struct.Cyc_List_List* %1) {
%3 = tail call i32 @Cyc_Interface_gen_extract(%struct.Cyc_Tcenv_Genv* %0, i32 1, %struct.Cyc_List_List* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.Cyc_Interface_I*
ret %struct.Cyc_Interface_I* %5
}
/* Variables and functions */
int /*<<< orphan*/ external();
int /*<<< orphan*/ internal();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Split Module Table world (5)\n");
  internal();
  external();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <internal@plt>
mov    $0x0,%al
call   1050 <external@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <internal@plt>
xor    %eax,%eax
call   1050 <external@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Hello Split Module Table world (5)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @internal()
%4 = call i32 (...) @external()
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Hello Split Module Table world (5)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @internal()
%3 = tail call i32 (...) @external()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
struct time {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time_convert_in(struct time *, struct tm *);
void time_init_val(struct time *t, time_t *s) {
  struct tm *ot;
  ot = localtime(s);
  time_convert_in(t, ot);
}


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

x86 assembly (clang, -O2):
<time_init_val>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <localtime@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <time_convert_in@plt>

LLVM IR (-O0):
%struct.time = type { i32 }
%struct.tm = type { i32 }
define void @time_init_val(%struct.time* %0, i32* %1) {
%3 = alloca %struct.time*
%4 = alloca i32*
%5 = alloca %struct.tm*
store %struct.time* %0, %struct.time** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %7, %struct.tm** %5
%8 = load %struct.time*, %struct.time** %3
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @time_convert_in(%struct.time* %8, %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.time = type { i32 }
%struct.tm = type { i32 }
define void @time_init_val(%struct.time* %0, i32* %1) {
%3 = tail call %struct.tm* @localtime(i32* %1)
%4 = tail call i32 @time_convert_in(%struct.time* %0, %struct.tm* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BUG();
void flush_tlb_kernel_page(unsigned long addr) { BUG(); }


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

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

LLVM IR (-O0):
define void @flush_tlb_kernel_page(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
define void @flush_tlb_kernel_page(i64 %0) {
%2 = tail call i32 (...) @BUG()
ret void
}
/* Variables and functions */
double ln_get_uranus_earth_dist(double);
double ln_get_uranus_solar_dist(double);
double log10(double);
double ln_get_uranus_magnitude(double JD) {
  double delta, r;
  r = ln_get_uranus_solar_dist(JD);
  delta = ln_get_uranus_earth_dist(JD);
  return -7.19 + 5.0 * log10(r * delta);
}


x86 assembly (clang, -O0):
<ln_get_uranus_magnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <ln_get_uranus_solar_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_uranus_earth_dist@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1050 <log10@plt>
movsd  0xe8e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8a(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_uranus_magnitude>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <ln_get_uranus_solar_dist@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <ln_get_uranus_earth_dist@plt>
mulsd  0x10(%rsp),%xmm0
call   1050 <log10@plt>
mulsd  0xe9d(%rip),%xmm0
addsd  0xe9d(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ln_get_uranus_magnitude(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @ln_get_uranus_solar_dist(double %5)
store double %6, double* %4
%7 = load double, double* %2
%8 = call double @ln_get_uranus_earth_dist(double %7)
store double %8, double* %3
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = call double @log10(double %11)
%13 = call double @llvm.fmuladd.f64(double 5.000000e+00, double %12, double -7.190000e+00)
ret double %13
}

LLVM IR (-O2):
define double @ln_get_uranus_magnitude(double %0) {
%2 = tail call double @ln_get_uranus_solar_dist(double %0)
%3 = tail call double @ln_get_uranus_earth_dist(double %0)
%4 = fmul double %2, %3
%5 = tail call double @log10(double %4)
%6 = tail call double @llvm.fmuladd.f64(double %5, double 5.000000e+00, double -7.190000e+00)
ret double %6
}
/* Variables and functions */
void stub1(short, char);
void testClosureSBrV(void (*closure)(short, char), short a1, char a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureSBrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <testClosureSBrV+0x34>
mov    -0x8(%rbp),%rax
mov    -0xa(%rbp),%cx
movswl %cx,%edi
movsbl -0xb(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureSBrV>:
test   %rdi,%rdi
je     1110 <testClosureSBrV+0x10>
mov    %rdi,%rax
movswl %si,%edi
movsbl %dl,%esi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureSBrV(void (i16, i8)* %0, i16 signext %1, i8 signext %2) {
%4 = alloca void (i16, i8)*
%5 = alloca i16
%6 = alloca i8
store void (i16, i8)* %0, void (i16, i8)** %4
store i16 %1, i16* %5
store i8 %2, i8* %6
%7 = load void (i16, i8)*, void (i16, i8)** %4
%8 = icmp ne void (i16, i8)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load void (i16, i8)*, void (i16, i8)** %4
%11 = load i16, i16* %5
%12 = load i8, i8* %6
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @testClosureSBrV(void (i16, i8)* %0, i16 signext %1, i8 signext %2) {
%4 = icmp eq void (i16, i8)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i16 signext %1, i8 signext %2)
br label %6
6: ; preds = %5, %3
ret void
}
int main() {
  int sum = 0;
  int i = 10;
  do {
    sum += 1;
    i--;
    if (i == 0) {
      break;
    }
    if (1) {
      continue;
    }
    i++;
  } while (1);
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113a <main+0x3a>
jmp    114e <main+0x4e>
jmp    113f <main+0x3f>
mov    $0x1,%al
test   $0x1,%al
jne    1119 <main+0x19>
jmp    114e <main+0x4e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t upb_align_up(uint32_t val, uint32_t align) {
  return val % align == 0 ? val : val + align - (val % align);
}


x86 assembly (clang, -O0):
<upb_align_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1125 <upb_align_up+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <upb_align_up+0x3d>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<upb_align_up>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rsi,%rdi,1),%eax
sub    %edx,%eax
test   %edx,%edx
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @upb_align_up(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 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = sub nsw i32 %14, %17
br label %19
19: ; preds = %11, %9
%20 = phi i32 [ %10, %9 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @upb_align_up(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = add nsw i32 %1, %0
%6 = sub i32 %5, %3
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
int MAIN() {
  int i = 8;
  int *p = &i;
  i = *p >>= 2;
  print("i ", *p);
  print(i);
  return 0;
}


x86 assembly (clang, -O0):
<MAIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x8,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
sar    $0x2,%eax
mov    %eax,(%rcx)
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"i \00"
define i32 @MAIN() {
%1 = alloca i32
%2 = alloca i32*
store i32 8, i32* %1
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = ashr i32 %4, 2
store i32 %5, i32* %3
store i32 %5, i32* %1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @print to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"i \00"
define i32 @MAIN() {
%1 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @print to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 2)
ret i32 0
}
/* Variables and functions */
int __C_toupper(int);
int toupper(int c) { return __C_toupper(c); }


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

x86 assembly (clang, -O2):
<toupper>:
jmp    1030 <__C_toupper@plt>

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i32 @__C_toupper(i32 %0)
ret i32 %2
}
/* Variables and functions */
int precedence(char, char);
int /*<<< orphan*/ printf(char *, char, char, int);
void testPrecedence() {
  char op1 = '+', op2 = '*';
  printf("precedence( %c, %c ) = %d \n", op1, op2, precedence(op1, op2));
}


x86 assembly (clang, -O0):
<testPrecedence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x2b,-0x1(%rbp)
movb   $0x2a,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x4(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
movsbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1030 <precedence@plt>
mov    -0x4(%rbp),%dl
mov    %eax,%ecx
mov    -0x3(%rbp),%al
lea    0xea6(%rip),%rdi
movsbl %dl,%esi
movsbl %al,%edx
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testPrecedence>:
push   %rax
mov    $0x2b,%edi
mov    $0x2a,%esi
call   1030 <precedence@plt>
lea    0xec9(%rip),%rdi
mov    $0x2b,%esi
mov    $0x2a,%edx
mov    %eax,%ecx
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"precedence( %c, %c ) = %d \0A\00"
define void @testPrecedence() {
%1 = alloca i8
%2 = alloca i8
store i8 43, i8* %1
store i8 42, i8* %2
%3 = load i8, i8* %1
%4 = load i8, i8* %2
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = call i32 @precedence(i8 signext %5, i8 signext %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8 signext %4, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"precedence( %c, %c ) = %d \0A\00"
define void @testPrecedence() {
%1 = tail call i32 @precedence(i8 signext 43, i8 signext 42)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext 43, i8 signext 42, i32 %1)
ret void
}
void CDAudio_Resume(void) {}


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

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

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

LLVM IR (-O2):
define void @CDAudio_Resume() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void br_enc32be(unsigned char *dst, uint32_t x) {
  dst[3] = (unsigned char)x;
  dst[2] = (unsigned char)(x >> 8);
  dst[1] = (unsigned char)(x >> 16);
  dst[0] = (unsigned char)(x >> 24);
}


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

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

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

LLVM IR (-O2):
define void @br_enc32be(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = lshr i32 %1, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i32 %1, 24
%12 = trunc i32 %11 to i8
store i8 %12, i8* %0
ret void
}
void ft_striter(char *str, void (*f)(char *)) {
  if (!str || !f)
    return;
  while (*str != '\0') {
    f(str);
    str++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <ft_striter+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    112b <ft_striter+0x2b>
jmp    115b <ft_striter+0x5b>
jmp    1130 <ft_striter+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <ft_striter+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <ft_striter+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %0, %6 ]
tail call void %1(i8* %10)
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %6, %2
ret void
}
double obd_convert_0C(int a, int b) { return (double)((a * 256) + b) / 4.0f; }


x86 assembly (clang, -O0):
<obd_convert_0C>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
add    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee1(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obd_convert_0C>:
shl    $0x8,%edi
add    %esi,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xeef(%rip),%xmm0
ret

LLVM IR (-O0):
define double @obd_convert_0C(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 = mul nsw i32 %5, 256
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 4.000000e+00
ret double %10
}

LLVM IR (-O2):
define double @obd_convert_0C(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 8
%4 = add nsw i32 %3, %1
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 2.500000e-01
ret double %6
}
int multipRec(int n1, int n2) {
  if (n2 == 0)
    return 0;
  return n1 + multipRec(n1, n2 - 1);
}


x86 assembly (clang, -O0):
<multipRec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <multipRec+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1152 <multipRec+0x42>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <multipRec@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @multipRec(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int main_waitdo(unsigned int, char **);
int main(int argc, char **argv) { return main_waitdo((unsigned)argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_waitdo@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_waitdo(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ emq_channel_release(void *);
void emq_channel_list_free_handler(void *value) { emq_channel_release(value); }


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

x86 assembly (clang, -O2):
<emq_channel_list_free_handler>:
jmp    1030 <emq_channel_release@plt>

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

LLVM IR (-O2):
define void @emq_channel_list_free_handler(i8* %0) {
%2 = tail call i32 @emq_channel_release(i8* %0)
ret void
}
int gcd(int a, int b) {
  int c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1139 <gcd+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
jmp    1114 <gcd+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1120 <gcd+0x20>
nopl   0x0(%rax)
mov    %edx,%ecx
mov    %esi,%eax
cltd
idiv   %ecx
mov    %ecx,%esi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = phi i32 [ %6, %5 ], [ %1, %2 ]
%8 = srem i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ %1, %2 ], [ %6, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char sub_fun_3(char x, char y) {
  char res;
  printf("sub_fun_2_1\n");
  ;
  res = x + y;
  ;
  printf("sub_fun_2_2\n");
  return res;
}


x86 assembly (clang, -O0):
<sub_fun_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x3(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_fun_3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
add    %bpl,%bl
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"sub_fun_2_1\0A\00"
@.str.1 = [13 x i8] c"sub_fun_2_2\0A\00"
define signext i8 @sub_fun_3(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = add nsw i32 %8, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%14 = load i8, i8* %5
ret i8 %14
}

LLVM IR (-O2):
@str = [12 x i8] c"sub_fun_2_1\00"
@str.2 = [12 x i8] c"sub_fun_2_2\00"
define signext i8 @sub_fun_3(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = add i8 %1, %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
ret i8 %4
}
void yg() {
  int y1 __attribute__((blah));
  typedef int y2 __attribute__((blah));
}


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

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

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

LLVM IR (-O2):
define void @yg() {
ret void
}
const char *tskGetVersion() { return "0.0"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"0.0\00"
define i8* @tskGetVersion() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"0.0\00"
define i8* @tskGetVersion() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
void write32(unsigned int reg1, signed int val) {
  unsigned int *reg;
  reg = (unsigned int *)reg1;
  *(reg) = (int)val;
}


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

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

LLVM IR (-O0):
define void @write32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %5
%9 = load i32, i32* %4
%10 = load i32*, i32** %5
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @write32(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
store i32 %1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_74() {
  Assert_real((isqrt(74) == 8),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              375, ("Integer square root of 74 should be 8"));
}


x86 assembly (clang, -O0):
<t_sqrt_74>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4a,%edi
call   1030 <isqrt@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x177,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_74>:
push   %rax
mov    $0x4a,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x177,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 74 should be 8\00"
define void @t_sqrt_74() {
%1 = call i32 @isqrt(i32 74)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 375, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 74 should be 8\00"
define void @t_sqrt_74() {
%1 = tail call i32 @isqrt(i32 74)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 375, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}