xunge/DecIR huggingface dataset:
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_handler;
};
typedef int /*<<< orphan*/ act;

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/);
void default_signals(void) {
  struct sigaction act;
  memset(&act, 0, sizeof(act));
  act.sa_handler = SIG_DFL;
  sigaction(SIGALRM, &act, 0);
}


x86 assembly (clang, -O0):
<default_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_signals>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGALRM = global i32 0
define void @default_signals() {
%1 = alloca %struct.sigaction
%2 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 4)
%3 = load i32, i32* @SIG_DFL
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i32 %3, i32* %4
%5 = load i32, i32* @SIGALRM
%6 = call i32 @sigaction(i32 %5, %struct.sigaction* %1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGALRM = global i32 0
define void @default_signals() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 4)
%4 = load i32, i32* @SIG_DFL
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @SIGALRM
%7 = call i32 @sigaction(i32 %6, %struct.sigaction* %1, i32 0)
ret void
}
char stlstr_escape_for(char i) {
  switch (i) {
  case 'n':
    return '\n';
  case 't':
    return '\t';
  case '\'':
    return '\'';
  case '"':
    return '"';
  case '\\':
    return '\\';
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<stlstr_escape_for>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x22,%eax
je     117e <stlstr_escape_for+0x7e>
jmp    111f <stlstr_escape_for+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x27,%eax
je     1175 <stlstr_escape_for+0x75>
jmp    1130 <stlstr_escape_for+0x30>
mov    -0x8(%rbp),%eax
sub    $0x5c,%eax
je     1187 <stlstr_escape_for+0x87>
jmp    1141 <stlstr_escape_for+0x41>
mov    -0x8(%rbp),%eax
sub    $0x6e,%eax
je     1163 <stlstr_escape_for+0x63>
jmp    1152 <stlstr_escape_for+0x52>
mov    -0x8(%rbp),%eax
sub    $0x74,%eax
je     116c <stlstr_escape_for+0x6c>
jmp    1190 <stlstr_escape_for+0x90>
movb   $0xa,-0x1(%rbp)
jmp    1194 <stlstr_escape_for+0x94>
movb   $0x9,-0x1(%rbp)
jmp    1194 <stlstr_escape_for+0x94>
movb   $0x27,-0x1(%rbp)
jmp    1194 <stlstr_escape_for+0x94>
movb   $0x22,-0x1(%rbp)
jmp    1194 <stlstr_escape_for+0x94>
movb   $0x5c,-0x1(%rbp)
jmp    1194 <stlstr_escape_for+0x94>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stlstr_escape_for>:
cmp    $0x5b,%edi
jle    1119 <stlstr_escape_for+0x19>
cmp    $0x5c,%edi
je     1126 <stlstr_escape_for+0x26>
mov    $0xa,%al
cmp    $0x6e,%edi
je     112e <stlstr_escape_for+0x2e>
cmp    $0x74,%edi
jne    112c <stlstr_escape_for+0x2c>
mov    $0x9,%al
ret
cmp    $0x22,%edi
je     1129 <stlstr_escape_for+0x29>
cmp    $0x27,%edi
jne    112c <stlstr_escape_for+0x2c>
mov    $0x27,%al
ret
mov    $0x5c,%al
ret
mov    $0x22,%al
ret
mov    $0xff,%al
ret

LLVM IR (-O0):
define signext i8 @stlstr_escape_for(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 110, label %6
i32 116, label %7
i32 39, label %8
i32 34, label %9
i32 92, label %10
]
6: ; preds = %1
store i8 10, i8* %2
br label %12
7: ; preds = %1
store i8 9, i8* %2
br label %12
8: ; preds = %1
store i8 39, i8* %2
br label %12
9: ; preds = %1
store i8 34, i8* %2
br label %12
10: ; preds = %1
store i8 92, i8* %2
br label %12
11: ; preds = %1
store i8 -1, i8* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @stlstr_escape_for(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 110, label %8
i32 116, label %3
i32 39, label %4
i32 34, label %5
i32 92, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i8 [ -1, %7 ], [ 92, %6 ], [ 34, %5 ], [ 39, %4 ], [ 9, %3 ], [ 10, %1 ]
ret i8 %9
}
int is_uv_system(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @is_uv_system() {
ret i32 0
}

LLVM IR (-O2):
define i32 @is_uv_system() {
ret i32 0
}
/* Variables and functions */
bool bnor(bool a, bool b) { return !(a || b); }


x86 assembly (clang, -O0):
<bnor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <bnor+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnor>:
xor    %eax,%eax
or     %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bnor(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @bnor(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum(int c) { return isalpha(c) || isdigit(c) ? 1 : 0; }


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void av_frame_set_decode_error_flags() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_set_decode_error_flags() {
ret void
}
float delta(float a, float b, float c) {}


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @delta(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %4
ret float %8
}

LLVM IR (-O2):
define float @delta(float %0, float %1, float %2) {
ret float undef
}
/* Type definitions */
struct cb_seq {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
struct cb_seq *cb_seq_init_range(int /*<<< orphan*/, char *, char *,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
struct cb_seq *cb_seq_init(int32_t id, char *name, char *residues) {
  return cb_seq_init_range(id, name, residues, 0, strlen(residues));
}


x86 assembly (clang, -O0):
<cb_seq_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%r8d
xor    %ecx,%ecx
call   1040 <cb_seq_init_range@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_seq_init>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cb_seq_init_range@plt>

LLVM IR (-O0):
%struct.cb_seq = type { i32 }
define %struct.cb_seq* @cb_seq_init(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call %struct.cb_seq* @cb_seq_init_range(i32 %7, i8* %8, i8* %9, i32 0, i32 %11)
ret %struct.cb_seq* %12
}

LLVM IR (-O2):
%struct.cb_seq = type { i32 }
define %struct.cb_seq* @cb_seq_init(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call %struct.cb_seq* @cb_seq_init_range(i32 %0, i8* %1, i8* %2, i32 0, i32 %4)
ret %struct.cb_seq* %5
}
void copy_from_vram(unsigned int adr, const unsigned char *src,
                    unsigned int size) {
  volatile unsigned short dummy;
  *((unsigned short *)0x2116) = (adr);
  ;
  dummy = *(unsigned short *)0x2139;
  *((unsigned short *)(0x4300 | ((7) << 4))) = (0x3981);
  ;
  *((void **)(0x4302 | ((7) << 4))) = ((unsigned char *)src);
  ;
  *((unsigned short *)(0x4305 | ((7) << 4))) = (size);
  ;
  *((unsigned char *)0x420b) = (1 << 7);
  ;
}


x86 assembly (clang, -O0):
<copy_from_vram>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,%cx
mov    $0x2116,%eax
mov    %cx,(%rax)
mov    $0x2139,%eax
mov    (%rax),%ax
mov    %ax,-0x16(%rbp)
mov    $0x4370,%eax
movw   $0x3981,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0x4372,%eax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
mov    %ax,%cx
mov    $0x4375,%eax
mov    %cx,(%rax)
mov    $0x420b,%eax
movb   $0x80,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_from_vram>:
mov    %di,0x2116
movzwl 0x2139,%eax
mov    %ax,-0x2(%rsp)
movw   $0x3981,0x4370
mov    %rsi,0x4372
mov    %dx,0x4375
movb   $0x80,0x420b
80
ret

LLVM IR (-O0):
define void @copy_from_vram(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i16
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i16
store i16 %9, i16* inttoptr (i64 8470 to i16*)
%10 = load i16, i16* inttoptr (i64 8505 to i16*)
store volatile i16 %10, i16* %7
store i16 14721, i16* inttoptr (i64 17264 to i16*)
%11 = load i8*, i8** %5
store i8* %11, i8** inttoptr (i64 17266 to i8**)
%12 = load i32, i32* %6
%13 = trunc i32 %12 to i16
store i16 %13, i16* inttoptr (i64 17269 to i16*)
store i8 -128, i8* inttoptr (i64 16907 to i8*)
ret void
}

LLVM IR (-O2):
define void @copy_from_vram(i32 %0, i8* %1, i32 %2) {
%4 = alloca i16
%5 = bitcast i16* %4 to i8*
%6 = trunc i32 %0 to i16
store i16 %6, i16* inttoptr (i64 8470 to i16*)
%7 = load i16, i16* inttoptr (i64 8505 to i16*)
store volatile i16 %7, i16* %4
store i16 14721, i16* inttoptr (i64 17264 to i16*)
store i8* %1, i8** inttoptr (i64 17266 to i8**)
%8 = trunc i32 %2 to i16
store i16 %8, i16* inttoptr (i64 17269 to i16*)
store i8 -128, i8* inttoptr (i64 16907 to i8*)
ret void
}
main() {
  signed short i = 3;
  unsigned char c = 2;
  return i + c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x3,-0x6(%rbp)
movb   $0x2,-0x7(%rbp)
movswl -0x6(%rbp),%eax
movzbl -0x7(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i8
store i32 0, i32* %1
store i16 3, i16* %2
store i8 2, i8* %3
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ logprintf(int /*<<< orphan*/, char *);
int sqlite_get_permissions_by_permission(int /*<<< orphan*/ *, char *);
int mode_rlist(sqlite3 *db, int argc, char **argv) {
  if (argc < 2) {
    logprintf(0, "Permission to list is missing\n\n");
    return 20;
  }
  return sqlite_get_permissions_by_permission(db, argv[1]);
}


x86 assembly (clang, -O0):
<mode_rlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1157 <mode_rlist+0x37>
xor    %edi,%edi
lea    0xeba(%rip),%rsi
call   1040 <logprintf@plt>
movl   $0x14,-0x4(%rbp)
jmp    116b <mode_rlist+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <sqlite_get_permissions_by_permission@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_rlist>:
push   %rax
cmp    $0x1,%esi
jg     113b <mode_rlist+0x1b>
lea    0xed3(%rip),%rsi
xor    %edi,%edi
call   1040 <logprintf@plt>
mov    $0x14,%eax
pop    %rcx
ret
mov    0x8(%rdx),%rsi
pop    %rax
jmp    1030 <sqlite_get_permissions_by_permission@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Permission to list is missing\0A\0A\00"
define i32 @mode_rlist(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8**
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @logprintf(i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 20, i32* %4
br label %18
12: ; preds = %3
%13 = load i32*, i32** %5
%14 = load i8**, i8*** %7
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @sqlite_get_permissions_by_permission(i32* %13, i8* %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %12, %10
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@.str = [32 x i8] c"Permission to list is missing\0A\0A\00"
define i32 @mode_rlist(i32* %0, i32 %1, i8** nocapture %2) {
%4 = icmp slt i32 %1, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @logprintf(i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %2, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @sqlite_get_permissions_by_permission(i32* %0, i8* %9)
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ 20, %5 ], [ %10, %7 ]
ret i32 %12
}
void swap(char *a, char *b) {
  int t;
  t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = load i8*, i8** %3
store i8 %10, i8* %11
%12 = load i32, i32* %5
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
store i8 %13, i8* %14
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cmd;

/* Variables and functions */
int MAXPATHLEN;
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int system(char *);
void fb_lfs_recur_rm(char *path) {
  int ret;
  char cmd[MAXPATHLEN];
  (void)snprintf(cmd, sizeof(cmd), "rm -rf %s", path);
  ret = system(cmd);
  return;
}


x86 assembly (clang, -O0):
<fb_lfs_recur_rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    %eax,%esi
mov    -0x8(%rbp),%rcx
lea    0xe9b(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_lfs_recur_rm>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rcx
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xeb3(%rip),%rdx
mov    %rbx,%rdi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@MAXPATHLEN = global i32 0
@.str = [10 x i8] c"rm -rf %s\00"
define void @fb_lfs_recur_rm(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i32, i32* @MAXPATHLEN
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %4
%9 = alloca i8, i64 %7
store i64 %7, i64* %5
%10 = trunc i64 %7 to i32
%11 = load i8*, i8** %2
%12 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @system(i8* %9)
store i32 %13, i32* %3
%14 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
@MAXPATHLEN = global i32 0
@.str = [10 x i8] c"rm -rf %s\00"
define void @fb_lfs_recur_rm(i8* %0) {
%2 = load i32, i32* @MAXPATHLEN
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @snprintf(i8* %4, i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 @system(i8* %4)
ret void
}
/* Type definitions */
struct __clone_args {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ syscall(int, struct __clone_args *, size_t);
pid_t sys_clone3(struct __clone_args *args, size_t size) {
  fflush(stdout);
  fflush(stderr);
  return syscall(-1, args, size);
}


x86 assembly (clang, -O0):
<sys_clone3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_clone3>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.__clone_args = type { i32 }
@stdout = global i32 0
@stderr = global i32 0
define i32 @sys_clone3(%struct.__clone_args* %0, i64 %1) {
%3 = alloca %struct.__clone_args*
%4 = alloca i64
store %struct.__clone_args* %0, %struct.__clone_args** %3
store i64 %1, i64* %4
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fflush(i32 %7)
%9 = load %struct.__clone_args*, %struct.__clone_args** %3
%10 = load i64, i64* %4
%11 = call i32 @syscall(i32 -1, %struct.__clone_args* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.__clone_args = type { i32 }
@stdout = global i32 0
@stderr = global i32 0
define i32 @sys_clone3(%struct.__clone_args* %0, i64 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @syscall(i32 -1, %struct.__clone_args* %0, i64 %1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char *);
int toupper(char);
char *sethomepath(char *buf, char *userid) {
  sprintf(buf, "home/%c/%s", toupper(userid[0]), userid);
  return buf;
}


x86 assembly (clang, -O0):
<sethomepath>:
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    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
lea    0xeab(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sethomepath>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsbl (%rsi),%edi
call   1030 <toupper@plt>
lea    0xec7(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
mov    %rbx,%rcx
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"home/%c/%s\00"
define i8* @sethomepath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = call i32 @toupper(i8 signext %8)
%10 = load i8*, i8** %4
%11 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"home/%c/%s\00"
define i8* @sethomepath(i8* returned writeonly %0, i8* %1) {
%3 = load i8, i8* %1
%4 = tail call i32 @toupper(i8 signext %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %1)
ret i8* %0
}
unsigned char NANDDataReadByte(unsigned int dataRegAddr) {
  unsigned char dataByte;
  dataByte = (unsigned char)(*(volatile unsigned char *)(dataRegAddr));
  return (dataByte);
}


x86 assembly (clang, -O0):
<NANDDataReadByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    (%rax),%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @NANDDataReadByte(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = load volatile i8, i8* %6
store i8 %7, i8* %3
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @NANDDataReadByte(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
%4 = load volatile i8, i8* %3
ret i8 %4
}
double log(double x) {
  double ln2;
  __asm("fldln2" : "=t"(ln2));
  return ln2 * log2(x);
}


x86 assembly (clang, -O0):
<log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
fldln2
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log2@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log>:
push   %rax
fldln2
fstpl  (%rsp)
call   1030 <log2@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @log(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double asm "fldln2", "={st},~{dirflag},~{fpsr},~{flags}"()
store double %4, double* %3
%5 = load double, double* %3
%6 = load double, double* %2
%7 = call double @log2(double %6)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @log(double %0) {
%2 = tail call double asm "fldln2", "={st},~{dirflag},~{fpsr},~{flags}"()
%3 = tail call double @log2(double %0)
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
fmax(int m, int n) {
  int r;
  r = m % n;
  while (r != 0) {
    m = n;
    n = r;
    r = m % n;
  }
  return n;
}


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

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

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

LLVM IR (-O2):
define i32 @fmax(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = phi i32 [ %6, %5 ], [ %1, %2 ]
%8 = srem i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ %1, %2 ], [ %6, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ isspace(unsigned char);
int only_whitespace(const char *s) {
  while (*s != '\0') {
    if (!isspace((unsigned char)*s))
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<only_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115e <only_whitespace+0x4e>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114d <only_whitespace+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1165 <only_whitespace+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <only_whitespace+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<only_whitespace>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <only_whitespace+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <only_whitespace+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <only_whitespace+0x20>
jmp    114b <only_whitespace+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @only_whitespace(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 zeroext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xb9() {
  Assert_real((isprint(185) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              930, ("isprint should be 0 for 0xb9"));
}


x86 assembly (clang, -O0):
<t_isprint_0xb9>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb9,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3a2,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xb9>:
push   %rax
mov    $0xb9,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3a2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb9\00"
define void @t_isprint_0xb9() {
%1 = call i64 @isprint(i32 185)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 930, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb9\00"
define void @t_isprint_0xb9() {
%1 = tail call i64 @isprint(i32 185)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 930, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int countBits(unsigned int x) {
  int n;
  n = 0;
  while (x != 0) {
    x &= x - 1;
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<countBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <countBits+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <countBits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countBits>:
xor    %eax,%eax
test   %edi,%edi
je     111c <countBits+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <countBits+0x10>
ret

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

LLVM IR (-O2):
define i32 @countBits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
long double tanh(long double);
long double imprecise_tanhl(long double v) { return tanh(v); }


x86 assembly (clang, -O0):
<imprecise_tanhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tanh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprecise_tanhl>:
jmp    1030 <tanh@plt>

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

LLVM IR (-O2):
define x86_fp80 @imprecise_tanhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @tanh(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ioptval;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IP_TTL;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, void *,
               unsigned int *);
int sock_get_ttl(int sock) {
  int ioptval;
  unsigned int ioptvallen;
  ioptvallen = sizeof(ioptval);
  if (getsockopt(sock, IPPROTO_IP, IP_TTL, (void *)&ioptval, &ioptvallen) ==
      -1) {
    return -1;
  }
  return ioptval;
}


x86 assembly (clang, -O0):
<sock_get_ttl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <getsockopt@plt>
cmp    $0xffffffff,%eax
jne    1159 <sock_get_ttl+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <sock_get_ttl+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_get_ttl>:
push   %rax
movl   $0x4,(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1030 <getsockopt@plt>
cmp    $0xffffffff,%eax
je     1140 <sock_get_ttl+0x30>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_IP = global i32 0
@IP_TTL = global i32 0
define i32 @sock_get_ttl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @IPPROTO_IP
%8 = load i32, i32* @IP_TTL
%9 = bitcast i32* %4 to i8*
%10 = call i32 @getsockopt(i32 %6, i32 %7, i32 %8, i8* %9, i32* %5)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %15
13: ; preds = %1
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@IPPROTO_IP = global i32 0
@IP_TTL = global i32 0
define i32 @sock_get_ttl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @IPPROTO_IP
%7 = load i32, i32* @IP_TTL
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i8* %4, i32* %3)
%9 = icmp eq i32 %8, -1
%10 = load i32, i32* %2
%11 = select i1 %9, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
int term();
int add(int x) { return x + term(); }


x86 assembly (clang, -O0):
<add>:
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 <term@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <term@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0) {
%2 = tail call i32 (...) @term()
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ render_createwindows();
scalar_t__ render_init();
int /*<<< orphan*/ render_shutdown();
int main() {
  if (render_init() != 0) {
    printf("Init error!\n");
    return 1;
  }
  printw("hello world");
  render_createwindows();
  render_shutdown();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <render_init@plt>
cmp    $0x0,%rax
je     1188 <main+0x38>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a9 <main+0x59>
lea    0xe7e(%rip),%rdi
call   1050 <printw@plt>
mov    $0x0,%al
call   1060 <render_createwindows@plt>
mov    $0x0,%al
call   1040 <render_shutdown@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <render_init@plt>
test   %rax,%rax
je     1172 <main+0x22>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    118c <main+0x3c>
lea    0xe87(%rip),%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <render_createwindows@plt>
xor    %eax,%eax
call   1040 <render_shutdown@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Init error!\0A\00"
@.str.1 = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @render_init()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %10
6: ; preds = %0
%7 = call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @render_createwindows()
%9 = call i32 (...) @render_shutdown()
store i32 0, i32* %1
br label %10
10: ; preds = %6, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"hello world\00"
@str = [12 x i8] c"Init error!\00"
define i32 @main() {
%1 = tail call i64 (...) @render_init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = tail call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @render_createwindows()
%8 = tail call i32 (...) @render_shutdown()
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ 1, %3 ], [ 0, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  const int size = 3;
  int array[] = {100, 200, 300};
  int e = 53;
  if (e >= size)
    printf("Element %d is out of range\n", e);
  else
    printf("Element %d is %d\n", e, array[e]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0xc(%rbp)
movl   $0x35,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jl     1161 <main+0x51>
mov    -0x18(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117a <main+0x6a>
mov    -0x18(%rbp),%esi
movslq -0x18(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.array = [3 x i32] [i32 100, i32 200, i32 300]
@.str = [28 x i8] c"Element %d is out of range\0A\00"
@.str.1 = [18 x i8] c"Element %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i32]
%4 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%5 = bitcast [3 x i32]* %3 to i8*
store i32 53, i32* %4
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 3
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %4
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %18
11: ; preds = %0
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %16)
br label %18
18: ; preds = %11, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Element %d is out of range\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 53)
ret i32 0
}
/* Variables and functions */
scalar_t__ __floatsidf(long);
float __floatsisf(long a1) { (float)__floatsidf(a1); }


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

x86 assembly (clang, -O2):
<__floatsisf>:
jmp    1030 <__floatsidf@plt>

LLVM IR (-O0):
define float @__floatsisf(i64 %0) {
%2 = alloca float
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i64 @__floatsidf(i64 %4)
%6 = sitofp i64 %5 to float
%7 = load float, float* %2
ret float %7
}

LLVM IR (-O2):
define float @__floatsisf(i64 %0) {
%2 = tail call i64 @__floatsidf(i64 %0)
ret float undef
}
int public_suffix_get_depth(const char *string) {
  const char *s;
  int result = 1;
  if (!string) {
    return 0;
  }
  for (s = string + 1; *s; s++) {
    if (*s == '.') {
      result++;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<public_suffix_get_depth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <public_suffix_get_depth+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1174 <public_suffix_get_depth+0x74>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <public_suffix_get_depth+0x6e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1158 <public_suffix_get_depth+0x58>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115d <public_suffix_get_depth+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1132 <public_suffix_get_depth+0x32>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<public_suffix_get_depth>:
test   %rdi,%rdi
je     1126 <public_suffix_get_depth+0x26>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rdi),%ecx
test   %cl,%cl
je     1128 <public_suffix_get_depth+0x28>
add    $0x1,%rdi
cmp    $0x2e,%cl
jne    1110 <public_suffix_get_depth+0x10>
add    $0x1,%eax
jmp    1110 <public_suffix_get_depth+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @public_suffix_get_depth(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i32 1, i32* %5
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 0, i32* %2
br label %30
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %4
br label %12
12: ; preds = %25, %9
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %12
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 46
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %24
24: ; preds = %21, %16
br label %25
25: ; preds = %24
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
br label %12
28: ; preds = %12
%29 = load i32, i32* %5
store i32 %29, i32* %2
br label %30
30: ; preds = %28, %8
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @public_suffix_get_depth(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %10
%4 = phi i8* [ %8, %10 ], [ %0, %1 ]
%5 = phi i32 [ %11, %10 ], [ 1, %1 ]
br label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %4, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
switch i8 %9, label %6 [
i8 0, label %12
i8 46, label %10
]
10: ; preds = %6
%11 = add nuw nsw i32 %5, 1
br label %3
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %5, %6 ]
ret i32 %13
}