xunge/DecIR huggingface dataset:
int normalize_perms(int mode) {
  mode &= 0666;
  mode |= 0600;
  if ((mode & 0060) != 0060)
    mode &= 0606;
  if ((mode & 0006) != 0006)
    mode &= 0660;
  return mode;
}


x86 assembly (clang, -O0):
<normalize_perms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1b6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x180,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x30,%eax
cmp    $0x30,%eax
je     1137 <normalize_perms+0x37>
mov    -0x4(%rbp),%eax
and    $0x186,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x6,%eax
cmp    $0x6,%eax
je     1151 <normalize_perms+0x51>
mov    -0x4(%rbp),%eax
and    $0x1b0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_perms>:
mov    %edi,%eax
and    $0x36,%eax
or     $0x180,%eax
not    %edi
mov    %eax,%ecx
and    $0xffffff86,%ecx
test   $0x30,%dil
cmove  %eax,%ecx
mov    %ecx,%edx
not    %edx
mov    %ecx,%eax
and    $0xffffffb0,%eax
test   $0x6,%dl
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @normalize_perms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 438
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = or i32 %5, 384
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = and i32 %7, 48
%9 = icmp ne i32 %8, 48
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = and i32 %11, 390
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %2
%15 = and i32 %14, 6
%16 = icmp ne i32 %15, 6
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %2
%19 = and i32 %18, 432
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %13
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @normalize_perms(i32 %0) {
%2 = and i32 %0, 54
%3 = or i32 %2, 384
%4 = and i32 %0, 48
%5 = icmp eq i32 %4, 48
%6 = and i32 %3, 390
%7 = select i1 %5, i32 %3, i32 %6
%8 = and i32 %7, 6
%9 = icmp eq i32 %8, 6
%10 = and i32 %7, 432
%11 = select i1 %9, i32 %7, i32 %10
ret i32 %11
}
int main() {
  switch (0) {
  case 0:
    return 1;
  case 1:
  case 2:
  default:
    return 4;
  }
  return 5;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRF3_set(void) { return U_WMRCORENONE_set("U_WMRF3"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRF3\00"
define i8* @U_WMRF3_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
struct ipr_dev {
  int dummy;
};

/* Variables and functions */
int ipr_start_stop(struct ipr_dev *, int, char *);
int ipr_start_stop_start(struct ipr_dev *dev) {
  return ipr_start_stop(dev, 0x01, "Start Unit");
}


x86 assembly (clang, -O0):
<ipr_start_stop_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    0xed4(%rip),%rdx
call   1030 <ipr_start_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipr_start_stop_start>:
lea    0xee9(%rip),%rdx
mov    $0x1,%esi
jmp    1030 <ipr_start_stop@plt>

LLVM IR (-O0):
%struct.ipr_dev = type { i32 }
@.str = [11 x i8] c"Start Unit\00"
define i32 @ipr_start_stop_start(%struct.ipr_dev* %0) {
%2 = alloca %struct.ipr_dev*
store %struct.ipr_dev* %0, %struct.ipr_dev** %2
%3 = load %struct.ipr_dev*, %struct.ipr_dev** %2
%4 = call i32 @ipr_start_stop(%struct.ipr_dev* %3, i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
%struct.ipr_dev = type { i32 }
@.str = [11 x i8] c"Start Unit\00"
define i32 @ipr_start_stop_start(%struct.ipr_dev* %0) {
%2 = tail call i32 @ipr_start_stop(%struct.ipr_dev* %0, i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ serror(char *);
void badsyntax() { serror("bad operands"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"bad operands\00"
define void @badsyntax() {
%1 = call i32 @serror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"bad operands\00"
define void @badsyntax() {
%1 = tail call i32 @serror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void usage(const char *progname) {
  fprintf(stdout, "Usage: %s [-p <port>] <server> <message>\n", progname);
  fprintf(stdout, "--port | -p <port>  start listening on port <port>.\n");
  fprintf(stdout, "                    The default port is 8053.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xf01(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf1b(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [42 x i8] c"Usage: %s [-p <port>] <server> <message>\0A\00"
@.str.1 = [53 x i8] c"--port | -p <port> start listening on port <port>.\0A\00"
@.str.2 = [47 x i8] c" The default port is 8053.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [42 x i8] c"Usage: %s [-p <port>] <server> <message>\0A\00"
@.str.1 = [53 x i8] c"--port | -p <port> start listening on port <port>.\0A\00"
@.str.2 = [47 x i8] c" The default port is 8053.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int is_igp(int chipset) {
  switch (chipset) {
  case 0x0a:
  case 0x1a:
  case 0x1f:
  case 0x2a:
  case 0x4e:
  case 0x4c:
  case 0x67:
  case 0x68:
  case 0x63:
  case 0xaa:
  case 0xac:
  case 0xaf:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_igp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xa,%eax
je     11ce <is_igp+0xce>
jmp    111b <is_igp+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x1a,%eax
je     11ce <is_igp+0xce>
jmp    112c <is_igp+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x1f,%eax
je     11ce <is_igp+0xce>
jmp    113d <is_igp+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x2a,%eax
je     11ce <is_igp+0xce>
jmp    114e <is_igp+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x4c,%eax
je     11ce <is_igp+0xce>
jmp    115f <is_igp+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x4e,%eax
je     11ce <is_igp+0xce>
jmp    1170 <is_igp+0x70>
mov    -0xc(%rbp),%eax
sub    $0x63,%eax
je     11ce <is_igp+0xce>
jmp    1181 <is_igp+0x81>
mov    -0xc(%rbp),%eax
add    $0xffffff99,%eax
sub    $0x2,%eax
jb     11ce <is_igp+0xce>
jmp    1195 <is_igp+0x95>
mov    -0xc(%rbp),%eax
sub    $0xaa,%eax
je     11ce <is_igp+0xce>
jmp    11a8 <is_igp+0xa8>
mov    -0xc(%rbp),%eax
sub    $0xac,%eax
je     11ce <is_igp+0xce>
jmp    11bb <is_igp+0xbb>
mov    -0xc(%rbp),%eax
sub    $0xaf,%eax
jne    11da <is_igp+0xda>
jmp    11ce <is_igp+0xce>
movl   $0x1,-0x4(%rbp)
jmp    11e1 <is_igp+0xe1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_igp>:
mov    $0x1,%eax
lea    -0x1a(%rdi),%ecx
cmp    $0x4e,%ecx
ja     111d <is_igp+0x1d>
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    -0xaa(%rdi),%ecx
cmp    $0x5,%ecx
ja     1132 <is_igp+0x32>
mov    $0x25,%edx
bt     %ecx,%edx
jb     1137 <is_igp+0x37>
cmp    $0xa,%edi
jne    1138 <is_igp+0x38>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_igp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 10, label %5
i32 26, label %5
i32 31, label %5
i32 42, label %5
i32 78, label %5
i32 76, label %5
i32 103, label %5
i32 104, label %5
i32 99, label %5
i32 170, label %5
i32 172, label %5
i32 175, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_igp(i32 %0) {
switch i32 %0, label %2 [
i32 10, label %3
i32 26, label %3
i32 31, label %3
i32 42, label %3
i32 78, label %3
i32 76, label %3
i32 103, label %3
i32 104, label %3
i32 99, label %3
i32 170, label %3
i32 172, label %3
i32 175, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void I2CSlaveFIFOEnable(uint32_t ui32Base, uint32_t ui32Config) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000804))) =
      ui32Config | 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveFIFOEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x1,%eax
movslq %eax,%rcx
mov    -0x4(%rbp),%eax
add    $0x804,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveFIFOEnable>:
or     $0x1,%esi
movslq %esi,%rax
movslq %edi,%rcx
mov    %rax,0x804(%rcx)
ret

LLVM IR (-O0):
define void @I2CSlaveFIFOEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = or i32 %5, 1
%7 = sext i32 %6 to i64
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 2052
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
store volatile i64 %7, i64* %11
ret void
}

LLVM IR (-O2):
define void @I2CSlaveFIFOEnable(i32 %0, i32 %1) {
%3 = or i32 %1, 1
%4 = sext i32 %3 to i64
%5 = add nsw i32 %0, 2052
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
store volatile i64 %4, i64* %7
ret void
}
void f(int a, float b) {}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0, float %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int *, int /*<<< orphan*/);
void getVendorID(char *buf) {
  int regs[4];
  cpuid(regs, 0);
  ((unsigned *)buf)[0] = (unsigned)regs[1];
  ((unsigned *)buf)[1] = (unsigned)regs[3];
  ((unsigned *)buf)[2] = (unsigned)regs[2];
}


x86 assembly (clang, -O0):
<getVendorID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1030 <cpuid@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVendorID>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <cpuid@plt>
mov    0x4(%rsp),%eax
mov    %eax,(%rbx)
mov    0xc(%rsp),%eax
mov    %eax,0x4(%rbx)
mov    0x8(%rsp),%eax
mov    %eax,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @getVendorID(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i32]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%5 = call i32 @cpuid(i32* %4, i32 0)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%7 = load i32, i32* %6
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %7, i32* %10
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%12 = load i32, i32* %11
%13 = load i8*, i8** %2
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %12, i32* %15
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%17 = load i32, i32* %16
%18 = load i8*, i8** %2
%19 = bitcast i8* %18 to i32*
%20 = getelementptr inbounds i32, i32* %19, i64 2
store i32 %17, i32* %20
ret void
}

LLVM IR (-O2):
define void @getVendorID(i8* nocapture writeonly %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @cpuid(i32* %4, i32 0)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = bitcast i8* %0 to i32*
store i32 %7, i32* %8
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%10 = load i32, i32* %9
%11 = getelementptr inbounds i8, i8* %0, i64 4
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%14 = load i32, i32* %13
%15 = getelementptr inbounds i8, i8* %0, i64 8
%16 = bitcast i8* %15 to i32*
store i32 %14, i32* %16
ret void
}
/* Variables and functions */
unsigned long jenkins_one_at_a_time_hash(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int get_cell(const char *key, unsigned long int *hash) {
  *hash = jenkins_one_at_a_time_hash(key, strlen(key));
  return *hash % 512;
}


x86 assembly (clang, -O0):
<get_cell>:
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    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <jenkins_one_at_a_time_hash@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
and    $0x1ff,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cell>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <jenkins_one_at_a_time_hash@plt>
mov    %rax,(%r14)
and    $0x1ff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @get_cell(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i64 @jenkins_one_at_a_time_hash(i8* %5, i32 %7)
%9 = load i64*, i64** %4
store i64 %8, i64* %9
%10 = load i64*, i64** %4
%11 = load i64, i64* %10
%12 = urem i64 %11, 512
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_cell(i8* %0, i64* nocapture writeonly %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @jenkins_one_at_a_time_hash(i8* %0, i32 %3)
store i64 %4, i64* %1
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 511
ret i32 %6
}
void SoftDlgProc(void) {}


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

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

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

LLVM IR (-O2):
define void @SoftDlgProc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cond_wait() {
  printf("NOT IMPLEMENTED:"
         "pa_cond_wait"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"NOT IMPLEMENTED:pa_cond_wait\0A\00"
define i32 @pa_cond_wait() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [29 x i8] c"NOT IMPLEMENTED:pa_cond_wait\00"
define i32 @pa_cond_wait() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int wycc_ilog2(long itm) {
  int ans = 0;
  if (itm < 0) {
    itm *= -1;
  };
  while (itm > 0) {
    ans++;
    itm >>= 1;
  }
  return ans;
}


x86 assembly (clang, -O0):
<wycc_ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1123 <wycc_ilog2+0x23>
imul   $0xffffffffffffffff,-0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1128 <wycc_ilog2+0x28>
cmpq   $0x0,-0x8(%rbp)
jle    114d <wycc_ilog2+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1128 <wycc_ilog2+0x28>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wycc_ilog2>:
test   %rdi,%rdi
je     1130 <wycc_ilog2+0x30>
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
xor    %eax,%eax
mov    %rcx,%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
shr    %rdx
cmp    $0x1,%rcx
mov    %rdx,%rcx
ja     1120 <wycc_ilog2+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @wycc_ilog2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = phi i64 [ %9, %5 ], [ %4, %3 ]
%8 = add nuw nsw i32 %6, 1
%9 = lshr i64 %7, 1
%10 = icmp ult i64 %7, 2
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %12
}
void glmCrossProduct2f(float result[2], const float v1[2]) {
  result[0] = v1[1];
  result[1] = -v1[0];
}


x86 assembly (clang, -O0):
<glmCrossProduct2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmCrossProduct2f>:
movss  0x4(%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  (%rsi),%xmm0
xorps  0xeec(%rip),%xmm0
movss  %xmm0,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @glmCrossProduct2f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = getelementptr inbounds float, float* %1, i64 1
%4 = load float, float* %3
store float %4, float* %0
%5 = load float, float* %1
%6 = fneg float %5
%7 = getelementptr inbounds float, float* %0, i64 1
store float %6, float* %7
ret void
}
/* Variables and functions */
int fc8080_probe(void *);
int bbm_com_probe(void *handle) {
  int res;
  res = fc8080_probe(handle);
  return res;
}


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

x86 assembly (clang, -O2):
<bbm_com_probe>:
jmp    1030 <fc8080_probe@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_probe(i8* %0) {
%2 = tail call i32 @fc8080_probe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void oa_free(void *pMem) { free(pMem); }


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

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

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

LLVM IR (-O2):
define void @oa_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *);
char *malloc(size_t);
char *my_malloc(size_t s) {
  char *p = malloc(s ? s : 1);
  if (p == NULL)
    fatal_error("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <my_malloc+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <my_malloc+0x32>
mov    $0x1,%eax
mov    %rax,-0x18(%rbp)
jmp    1152 <my_malloc+0x32>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1176 <my_malloc+0x56>
lea    0xe8f(%rip),%rdi
call   1030 <fatal_error@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rax,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <my_malloc+0x26>
lea    0xebf(%rip),%rdi
call   1030 <fatal_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i64 [ %7, %6 ], [ 1, %8 ]
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @fatal_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @my_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @fatal_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void fc48(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      goto a;
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
a:;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc48(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %20
7: ; No predecessors!
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %7, %1
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc48(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sfile_make_argv(char *, char *, int *, char ***, int);
void Xorriso__dispose_words(int *argc, char ***argv) {
  Sfile_make_argv("", "", argc, argv, 2);
}


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

x86 assembly (clang, -O2):
<Xorriso__dispose_words>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
mov    %rdi,%rsi
mov    $0x2,%r8d
jmp    1030 <Sfile_make_argv@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @Xorriso__dispose_words(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 @Sfile_make_argv(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %5, i8*** %6, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @Xorriso__dispose_words(i32* %0, i8*** %1) {
%3 = tail call i32 @Sfile_make_argv(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %0, i8*** %1, i32 2)
ret void
}
int test_imm_3Eint64_midword_reg(long long val) {
  return ((val >> 16) & (0x3E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Eint64_midword_reg(i64 %0) {
%2 = and i64 %0, 4063232
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t snprintf(char *, size_t, char *, char *, char const *);
size_t strlcat(char *d, char const *s, size_t n) {
  return snprintf(d, n, "%s%s", d, s);
}


x86 assembly (clang, -O0):
<strlcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xec5(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlcat>:
mov    %rsi,%r8
lea    0xee6(%rip),%rax
mov    %rdx,%rsi
mov    %rax,%rdx
mov    %rdi,%rcx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i64 @strlcat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i64 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret i64 %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i64 @strlcat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @snprintf(i8* %0, i64 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i64 %4
}
int cwbit(int *datastream, int i) {
  int word = i >> 3;
  int bit = 7 - (i & 7);
  return (datastream[word] >> bit) & 1;
}


x86 assembly (clang, -O0):
<cwbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x7,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cwbit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = sub nsw i32 7, %10
store i32 %11, i32* %6
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32, i32* %6
%18 = ashr i32 %16, %17
%19 = and i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
define i32 @cwbit(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = and i32 %1, 7
%5 = xor i32 %4, 7
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = lshr i32 %8, %5
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_pipe_get_ttl_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_pipe@%p::get_ttl (rtpp_pipe_get_ttl) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_pipe_get_ttl_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_pipe_get_ttl_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_pipe@%p::get_ttl (rtpp_pipe_get_ttl) is invoked after destruction\0A\00"
define void @rtpp_pipe_get_ttl_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_pipe@%p::get_ttl (rtpp_pipe_get_ttl) is invoked after destruction\0A\00"
define void @rtpp_pipe_get_ttl_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo(int);
int main() {
  assert(foo(3) == 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <foo@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 3)
%3 = icmp eq i32 %2, 6
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 3)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
unsigned int LeftRotate(unsigned int toShift, int shiftAmt) {
  return (toShift << shiftAmt) | (toShift >> (32 - shiftAmt));
}


x86 assembly (clang, -O0):
<LeftRotate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeftRotate>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @LeftRotate(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @LeftRotate(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t, char const *);
int /*<<< orphan*/ stderr;
void line_ignored(size_t n, const char *line) {
  fprintf(stderr, "ignored invalid line %zu in /etc/paxd.conf: %s", n, line);
}


x86 assembly (clang, -O0):
<line_ignored>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_ignored>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"ignored invalid line %zu in /etc/paxd.conf: %s\00"
define void @line_ignored(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i64, i64* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"ignored invalid line %zu in /etc/paxd.conf: %s\00"
define void @line_ignored(i64 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *filePointer(int, char **);
int /*<<< orphan*/ solve(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  FILE *fp = filePointer(argc, argv);
  if (fp == NULL)
    return EXIT_FAILURE;
  solve(fp);
  fclose(fp);
  return EXIT_SUCCESS;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <filePointer@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <main+0x42>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <main+0x60>
mov    -0x18(%rbp),%rdi
call   1030 <solve@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1050 <filePointer@plt>
test   %rax,%rax
je     1157 <main+0x27>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <solve@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2e83(%rip),%rax
jmp    115e <main+0x2e>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32* @filePointer(i32 %0, i8** %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @solve(i32* %3)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32* [ @EXIT_SUCCESS, %5 ], [ @EXIT_FAILURE, %2 ]
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
void *realloc(void *, size_t);
void *brain_realloc_(void *in_mem, size_t in_size, int in_hint) {
  return realloc(in_mem, in_size);
}


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

x86 assembly (clang, -O2):
<brain_realloc_>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @brain_realloc_(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @brain_realloc_(i8* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void imprimeparte(char desenho[4][7], int parte) {
  printf("%s", desenho[parte]);
}


x86 assembly (clang, -O0):
<imprimeparte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   $0x7,%rax,%rax
add    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeparte>:
movslq %esi,%rax
lea    0x0(,%rax,8),%rsi
sub    %rax,%rsi
add    %rdi,%rsi
lea    0xed8(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @imprimeparte([7 x i8]* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 %3, i64 0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ execve(char *, char **, char **);
int /*<<< orphan*/ setgid(int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ unlinkTmpFiles();
void rootshell(char **env, char **argv) {
  char pwd[128];
  char *sh[] = {"/system/bin/sh", 0};
  setuid(0);
  setgid(0);
  unlinkTmpFiles();
  execve(*sh, argv, env);
  die("[-] execve");
}


x86 assembly (clang, -O0):
<rootshell>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ca6(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0x2ca0(%rip),%rax
mov    %rax,-0x98(%rbp)
xor    %edi,%edi
call   1070 <setuid@plt>
xor    %edi,%edi
call   1050 <setgid@plt>
mov    $0x0,%al
call   1030 <unlinkTmpFiles@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1040 <execve@plt>
lea    0xe60(%rip),%rdi
call   1060 <die@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rootshell>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
call   1070 <setuid@plt>
xor    %edi,%edi
call   1050 <setgid@plt>
xor    %eax,%eax
call   1030 <unlinkTmpFiles@plt>
lea    0xe8a(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <execve@plt>
lea    0xe87(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <die@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"/system/bin/sh\00"
@__const.rootshell.sh = [2 x i8*] [i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [11 x i8] c"[-] execve\00"
define void @rootshell(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca [128 x i8]
%6 = alloca [2 x i8*]
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%7 = bitcast [2 x i8*]* %6 to i8*
%8 = call i32 @setuid(i32 0)
%9 = call i32 @setgid(i32 0)
%10 = call i32 (...) @unlinkTmpFiles()
%11 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %4
%14 = load i8**, i8*** %3
%15 = call i32 @execve(i8* %12, i8** %13, i8** %14)
%16 = call i32 @die(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/system/bin/sh\00"
@.str.1 = [11 x i8] c"[-] execve\00"
define void @rootshell(i8** %0, i8** %1) {
%3 = tail call i32 @setuid(i32 0)
%4 = tail call i32 @setgid(i32 0)
%5 = tail call i32 (...) @unlinkTmpFiles()
%6 = tail call i32 @execve(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1, i8** %0)
%7 = tail call i32 @die(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void test4(void) {
  char a[10] = "asdf";
  char b[10] = {"asdf"};
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xef2(%rip),%ax
mov    %ax,-0x2(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xee6(%rip),%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.test4.a = [10 x i8] c"asdf\00\00\00\00\00\00"
@__const.test4.b = [10 x i8] c"asdf\00\00\00\00\00\00"
define void @test4() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = bitcast [10 x i8]* %1 to i8*
%4 = bitcast [10 x i8]* %2 to i8*
ret void
}

LLVM IR (-O2):
define void @test4() {
ret void
}
/* Variables and functions */
int factor();
int divide(int x) { return x / factor(); }


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <factor@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <factor@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @divide(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @factor()
%5 = sdiv i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @divide(i32 %0) {
%2 = tail call i32 (...) @factor()
%3 = sdiv i32 %0, %2
ret i32 %3
}
int test_imm_D0uint32_mem(unsigned int *val) {
  return ((*val) & (0xD0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D0uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 208
%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_D0uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 208
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void __imlib_FileDel(char *s) {
  if ((!s) || (!*s))
    return;
  unlink(s);
  return;
}


x86 assembly (clang, -O0):
<__imlib_FileDel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <__imlib_FileDel+0x24>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1139 <__imlib_FileDel+0x29>
jmp    1142 <__imlib_FileDel+0x32>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__imlib_FileDel>:
test   %rdi,%rdi
je     111f <__imlib_FileDel+0xf>
cmpb   $0x0,(%rdi)
je     111f <__imlib_FileDel+0xf>
jmp    1030 <unlink@plt>
ret

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

LLVM IR (-O2):
define void @__imlib_FileDel(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @unlink(i8* %0)
br label %8
8: ; preds = %1, %3, %6
ret void
}