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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ *stderr;
int end(char *name, char *buf, int sze, void *data) {
  FILE *fp = NULL;
  if (data != NULL)
    fp = (FILE *)data;
  else
    fp = stderr;
  fprintf(fp, "</%s>", name);
  return 0;
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1147 <end+0x37>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1155 <end+0x45>
mov    0x2e92(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end>:
push   %rax
mov    %rdi,%rdx
test   %rcx,%rcx
jne    1123 <end+0x13>
mov    0x2ec0(%rip),%rax
mov    (%rax),%rcx
lea    0xed6(%rip),%rsi
mov    %rcx,%rdi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32* null
@.str = [6 x i8] c"</%s>\00"
define i32 @end(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
store i32* null, i32** %9
%10 = load i8*, i8** %8
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %8
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %9
br label %17
15: ; preds = %4
%16 = load i32*, i32** @stderr
store i32* %16, i32** %9
br label %17
17: ; preds = %15, %12
%18 = load i32*, i32** %9
%19 = load i8*, i8** %5
%20 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %19)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [6 x i8] c"</%s>\00"
define i32 @end(i8* %0, i8* nocapture readnone %1, i32 %2, i8* %3) {
%5 = icmp eq i8* %3, null
%6 = bitcast i8* %3 to i32*
%7 = load i32*, i32** @stderr
%8 = select i1 %5, i32* %7, i32* %6
%9 = tail call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
float test_lgammaf(float x) { return __builtin_lgammaf(x); }


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

x86 assembly (clang, -O2):
<test_lgammaf>:
jmp    1030 <lgammaf@plt>

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

LLVM IR (-O2):
define float @test_lgammaf(float %0) {
%2 = tail call float @lgammaf(float %0)
ret float %2
}
int angel_ptrace(struct task_struct *parent, struct task_struct *child) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @angel_ptrace(%struct.task_struct* nocapture readnone %0, %struct.task_struct* nocapture readnone %1) {
ret i32 0
}
void _Locale_messages_destroy(void *__DUMMY_PAR) {}


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

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

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

LLVM IR (-O2):
define void @_Locale_messages_destroy(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int UP3D_GetParameter(int);
int32_t UP3D_GetHeaterTempReached(int heater) {
  if ((heater < 1) || (heater > 2))
    return -1;
  return UP3D_GetParameter(0x12 + heater - 1);
}


x86 assembly (clang, -O0):
<UP3D_GetHeaterTempReached>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     112f <UP3D_GetHeaterTempReached+0x1f>
cmpl   $0x2,-0x8(%rbp)
jle    113b <UP3D_GetHeaterTempReached+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <UP3D_GetHeaterTempReached+0x3c>
mov    -0x8(%rbp),%edi
add    $0x12,%edi
sub    $0x1,%edi
call   1030 <UP3D_GetParameter@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetHeaterTempReached>:
lea    -0x3(%rdi),%eax
cmp    $0xfffffffe,%eax
jae    111e <UP3D_GetHeaterTempReached+0xe>
mov    $0xffffffff,%eax
ret
add    $0x11,%edi
jmp    1030 <UP3D_GetParameter@plt>

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

LLVM IR (-O2):
define i32 @UP3D_GetHeaterTempReached(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, -2
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nuw nsw i32 %0, 17
%6 = tail call i32 @UP3D_GetParameter(i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
int islower(int c) {
  if (c >= 97 && c <= 122)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <islower+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <islower+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <islower+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ether_header {
  int /*<<< orphan*/ ether_dhost;
};

/* Variables and functions */
int /*<<< orphan*/ ETHER_ADDR_LEN;
int /*<<< orphan*/ bcopy(int /*<<< orphan*/, int /*<<< orphan*/ *,
                         int /*<<< orphan*/);
int inet_get_mac_addr_dst(void *data, uint8_t *mac_addr) {
  struct ether_header *eth_hdr;
  eth_hdr = data;
  bcopy(eth_hdr->ether_dhost, mac_addr, ETHER_ADDR_LEN);
  return 0;
}


x86 assembly (clang, -O0):
<inet_get_mac_addr_dst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
call   1030 <bcopy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_get_mac_addr_dst>:
push   %rax
mov    (%rdi),%edi
mov    0x2ed6(%rip),%rax
mov    (%rax),%edx
call   1030 <bcopy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ether_header = type { i32 }
@ETHER_ADDR_LEN = global i32 0
define i32 @inet_get_mac_addr_dst(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca %struct.ether_header*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.ether_header*
store %struct.ether_header* %7, %struct.ether_header** %5
%8 = load %struct.ether_header*, %struct.ether_header** %5
%9 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
%12 = load i32, i32* @ETHER_ADDR_LEN
%13 = call i32 @bcopy(i32 %10, i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@ETHER_ADDR_LEN = global i32 0
define i32 @inet_get_mac_addr_dst(i8* nocapture %0, i32* %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = load i32, i32* @ETHER_ADDR_LEN
%6 = tail call i32 @bcopy(i32 %4, i32* %1, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%lu", sizeof(int *)); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
struct netent *getnetbyname(const char *name) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<getnetbyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
lea    0xedb(%rip),%rsi
lea    0xee6(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1133 <getnetbyname+0x23>

x86 assembly (clang, -O2):
<getnetbyname>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <getnetbyname+0x20>

LLVM IR (-O0):
%struct.netent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getnetbyname = [13 x i8] c"getnetbyname\00"
define %struct.netent* @getnetbyname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.getnetbyname, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
%struct.netent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getnetbyname = [13 x i8] c"getnetbyname\00"
define %struct.netent* @getnetbyname(i8* nocapture readnone %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.getnetbyname, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
char *_trim(char *, char *, int);
char *trim(char *str) { return _trim(str, " \t\n\r\x0B\x0C", 1 | 2); }


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

x86 assembly (clang, -O2):
<trim>:
lea    0xee9(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <_trim@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" \09\0A\0D\0B\0C\00"
define i8* @trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @_trim(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c" \09\0A\0D\0B\0C\00"
define i8* @trim(i8* %0) {
%2 = tail call i8* @_trim(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3)
ret i8* %2
}
int test_imm_BFint16_reg(short val) {
  return ((val) & (-0xBF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BFint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff41,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BFint16_reg>:
test   $0xff41,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BFint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -191
%6 = icmp ne i32 %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_BFint16_reg(i16 signext %0) {
%2 = and i16 %0, -191
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int SSL_RadiansToDegree(int radians) { return (radians * 180) / 3.14159265359; }


x86 assembly (clang, -O0):
<SSL_RadiansToDegree>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xb4,-0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSL_RadiansToDegree>:
imul   $0xb4,%edi,%eax
cvtsi2sd %eax,%xmm0
divsd  0xeee(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @SSL_RadiansToDegree(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 180
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 0x400921FB54442EEA
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @SSL_RadiansToDegree(i32 %0) {
%2 = mul nsw i32 %0, 180
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 0x400921FB54442EEA
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pointer;

/* Variables and functions */
char *insert_unconflicted_element(char *);
int /*<<< orphan*/ memcpy(char *, char **, int);
int /*<<< orphan*/ push_bytearray(char *, int);
void push_string(char *string) {
  char *pointer = insert_unconflicted_element(string);
  char object[sizeof(pointer)];
  memcpy(object, &pointer, sizeof(pointer));
  push_bytearray(object, sizeof(pointer));
}


x86 assembly (clang, -O0):
<push_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <insert_unconflicted_element@plt>
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
lea    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   1030 <push_bytearray@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_string>:
push   %rbx
sub    $0x10,%rsp
call   1050 <insert_unconflicted_element@plt>
mov    %rax,(%rsp)
lea    0x8(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <push_bytearray@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @push_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [8 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @insert_unconflicted_element(i8* %5)
store i8* %6, i8** %3
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%8 = call i32 @memcpy(i8* %7, i8** %3, i32 8)
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%10 = call i32 @push_bytearray(i8* %9, i32 8)
ret void
}

LLVM IR (-O2):
define void @push_string(i8* %0) {
%2 = alloca i8*
%3 = alloca [8 x i8]
%4 = bitcast i8** %2 to i8*
%5 = tail call i8* @insert_unconflicted_element(i8* %0)
store i8* %5, i8** %2
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = call i32 @memcpy(i8* %6, i8** %2, i32 8)
%8 = call i32 @push_bytearray(i8* %6, i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;

/* Variables and functions */
int /*<<< orphan*/ bs_puts_utf8or16(char const *, int);
void bs_puts_utf16(const u_int16_t *s) { bs_puts_utf8or16((const char *)s, 1); }


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

x86 assembly (clang, -O2):
<bs_puts_utf16>:
mov    $0x1,%esi
jmp    1030 <bs_puts_utf8or16@plt>

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

LLVM IR (-O2):
define void @bs_puts_utf16(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @bs_puts_utf8or16(i8* %2, i32 1)
ret void
}
/* Variables and functions */
int ENOSYS;
int cl_splash_screen_prepare(int nand_offset) { return -ENOSYS; }


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

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @cl_splash_screen_prepare(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @cl_splash_screen_prepare(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
void vec3_sub3(double *v1, const double *v2, const double *v3) {
  v1[0] = v2[0] - v3[0];
  v1[1] = v2[1] - v3[1];
  v1[2] = v2[2] - v3[2];
}


x86 assembly (clang, -O0):
<vec3_sub3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_sub3>:
movsd  (%rsi),%xmm0
subsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
subsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
subsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @vec3_sub3(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @vec3_sub3(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fsub double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  extern char **environ;
  char **ptr = environ;
  while (*ptr != NULL) {
    printf("%s\n", *ptr);
    ++ptr;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1166 <main+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%rax
mov    (%rax),%rbx
mov    (%rbx),%rsi
test   %rsi,%rsi
je     1154 <main+0x44>
add    $0x8,%rbx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@environ = external global i8**
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i8**, i8*** @environ
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %4, %2 ]
%8 = phi i8** [ %10, %6 ], [ %3, %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
bool is_print(const int c) { return c >= 0x20 && c <= 0x7E; }


x86 assembly (clang, -O0):
<is_print>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_print+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_print>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_print(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_print(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
int number(char *num) {
  char x = 'n';
  int i = 0;
  while (x == 'n') {
    if (num[i] == '\0') {
      x = 's';
      continue;
    }
    if (num[i] < '0' || num[i] > '9')
      return 3;
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movb   $0x6e,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x6e,%eax
jne    1182 <number+0x82>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    113e <number+0x3e>
movb   $0x73,-0x11(%rbp)
jmp    1113 <number+0x13>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     1168 <number+0x68>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    1174 <number+0x74>
movl   $0x3,-0x4(%rbp)
jmp    1189 <number+0x89>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1113 <number+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
movzbl (%rdi),%eax
test   %al,%al
je     1117 <number+0x17>
add    $0xc6,%al
add    $0x1,%rdi
cmp    $0xf5,%al
ja     1100 <number>
mov    $0x3,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @number(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 110, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %36, %18, %1
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 110
br i1 %9, label %10, label %39
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %10
store i8 115, i8* %4
br label %6
19: ; preds = %10
%20 = load i8*, i8** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp slt i32 %25, 48
br i1 %26, label %35, label %27
27: ; preds = %19
%28 = load i8*, i8** %3
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp sgt i32 %33, 57
br i1 %34, label %35, label %36
35: ; preds = %27, %19
store i32 3, i32* %2
br label %40
36: ; preds = %27
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %6
39: ; preds = %6
store i32 0, i32* %2
br label %40
40: ; preds = %39, %35
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
define i32 @number(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %10, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = add i8 %5, -58
%9 = icmp ult i8 %8, -10
%10 = add nuw i64 %3, 1
br i1 %9, label %11, label %2
11: ; preds = %7, %2
%12 = phi i32 [ 0, %2 ], [ 3, %7 ]
ret i32 %12
}
long align(a, b)
long a, b;
{
  a += b - 1;
  return a - a % b;
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    -0x18(%rbp),%rax
sub    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
lea    (%rdi,%rsi,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111e <align+0x1e>
mov    %rcx,%rax
cqto
idiv   %rsi
jmp    1124 <align+0x24>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @align(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sub nsw i64 %5, 1
%7 = load i64, i64* %3
%8 = add nsw i64 %7, %6
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = srem i64 %10, %11
%13 = sub nsw i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @align(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = srem i64 %4, %1
%6 = sub nsw i64 %4, %5
ret i64 %6
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/remove_casts.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/remove_casts.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/remove_casts.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int puts(char *);
int foo(int a) { return puts("Hello"); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @foo(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SA1Direct(int);
int /*<<< orphan*/ STX16(int /*<<< orphan*/, int);
void Op86X0(void) { STX16(SA1Direct(2), 0xFFFF); }


x86 assembly (clang, -O0):
<Op86X0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <STX16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op86X0>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <STX16@plt>

LLVM IR (-O0):
define void @Op86X0() {
%1 = call i32 @SA1Direct(i32 2)
%2 = call i32 @STX16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op86X0() {
%1 = tail call i32 @SA1Direct(i32 2)
%2 = tail call i32 @STX16(i32 %1, i32 65535)
ret void
}
unsigned short hash(int value) { return value & 0xFFFF; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @hash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @hash(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
void rotr(int *a, int *b, int *c) {
  int tmp;
  tmp = *a;
  *a = *c;
  *c = *b;
  *b = tmp;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
store i32 %4, i32* %1
ret void
}
int __attribute((fastcall))
check_fastcall_espdiff_4(int a, int b, int c, int d) {
  return a + b + c + d;
}


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

x86 assembly (clang, -O2):
<check_fastcall_espdiff_4>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @check_fastcall_espdiff_4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @check_fastcall_espdiff_4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = add nsw i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("foo\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int isidentc(char);
int identCharPredicate(char c) { return isidentc(c); }


x86 assembly (clang, -O0):
<identCharPredicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isidentc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identCharPredicate>:
jmp    1030 <isidentc@plt>

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

LLVM IR (-O2):
define i32 @identCharPredicate(i8 signext %0) {
%2 = tail call i32 @isidentc(i8 signext %0)
ret i32 %2
}
void rop3_55_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_55_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_55_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_55_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_55_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _bad_stack_set(int);
void stack_l1_non_existant(void) { _bad_stack_set(0xFFAFFF00); }


x86 assembly (clang, -O0):
<stack_l1_non_existant>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffafff00,%edi
call   1030 <_bad_stack_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_l1_non_existant>:
mov    $0xffafff00,%edi
jmp    1030 <_bad_stack_set@plt>

LLVM IR (-O0):
define void @stack_l1_non_existant() {
%1 = call i32 @_bad_stack_set(i32 -5243136)
ret void
}

LLVM IR (-O2):
define void @stack_l1_non_existant() {
%1 = tail call i32 @_bad_stack_set(i32 -5243136)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: set system flag\n");
  printf("	auto	: auto set the first system flag \n");
  printf("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"usage: set system flag\0A\00"
@.str.1 = [41 x i8] c"\09auto\09: auto set the first system flag \0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"usage: set system flag\00"
@str.3 = [40 x i8] c"\09auto\09: auto set the first system flag \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct avl_tree_node {
  int dummy;
};

/* Variables and functions */
struct avl_tree_node *
avl_tree_first_or_last_in_order(struct avl_tree_node const *, int);
struct avl_tree_node *avl_tree_last_in_order(const struct avl_tree_node *root) {
  return avl_tree_first_or_last_in_order(root, 1);
}


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

x86 assembly (clang, -O2):
<avl_tree_last_in_order>:
mov    $0x1,%esi
jmp    1030 <avl_tree_first_or_last_in_order@plt>

LLVM IR (-O0):
%struct.avl_tree_node = type { i32 }
define %struct.avl_tree_node* @avl_tree_last_in_order(%struct.avl_tree_node* %0) {
%2 = alloca %struct.avl_tree_node*
store %struct.avl_tree_node* %0, %struct.avl_tree_node** %2
%3 = load %struct.avl_tree_node*, %struct.avl_tree_node** %2
%4 = call %struct.avl_tree_node* @avl_tree_first_or_last_in_order(%struct.avl_tree_node* %3, i32 1)
ret %struct.avl_tree_node* %4
}

LLVM IR (-O2):
%struct.avl_tree_node = type { i32 }
define %struct.avl_tree_node* @avl_tree_last_in_order(%struct.avl_tree_node* %0) {
%2 = tail call %struct.avl_tree_node* @avl_tree_first_or_last_in_order(%struct.avl_tree_node* %0, i32 1)
ret %struct.avl_tree_node* %2
}
unsigned int buf2uint(unsigned char *buf) {
  unsigned int val;
  val = buf[3];
  val = ((val << 8) + (0xff & buf[2]));
  val = ((val << 8) + (0xff & buf[1]));
  val = ((val << 8) + (0xff & buf[0]));
  return val;
}


x86 assembly (clang, -O0):
<buf2uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf2uint>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @buf2uint(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %4, 16
%9 = shl nuw nsw i32 %7, 8
%10 = or i32 %9, %8
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = shl nuw i32 %14, 8
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int Bit_Get(uint8_t *aPtr, int num) { return (aPtr[num / 8] >> (num % 8)) & 1; }


x86 assembly (clang, -O0):
<Bit_Get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    %edx,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bit_Get>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
mov    (%rdi,%rax,4),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @Bit_Get(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 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = srem i32 %11, 8
%13 = ashr i32 %10, %12
%14 = and i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @Bit_Get(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 7
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}