xunge/DecIR huggingface dataset:
short int str2mac(char *str, char *mac) {
  if (mac) {
    mac[0] = 0x00;
    mac[1] = 0x17;
    mac[2] = 0x9A;
    mac[3] = 0x88;
    mac[4] = 0x88;
    mac[5] = 0x88;
  }
  return 0;
}


x86 assembly (clang, -O0):
<str2mac>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <str2mac+0x46>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x17,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x9a,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x88,0x3(%rax)
mov    -0x10(%rbp),%rax
movb   $0x88,0x4(%rax)
mov    -0x10(%rbp),%rax
movb   $0x88,0x5(%rax)
xor    %eax,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2mac>:
test   %rsi,%rsi
je     1111 <str2mac+0x11>
movl   $0x889a1700,(%rsi)
movw   $0x8888,0x4(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i16 @str2mac(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %20
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 0, i8* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 23, i8* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 2
store i8 -102, i8* %13
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 3
store i8 -120, i8* %15
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 4
store i8 -120, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 5
store i8 -120, i8* %19
br label %20
20: ; preds = %7, %2
ret i16 0
}

LLVM IR (-O2):
define signext i16 @str2mac(i8* nocapture readnone %0, i8* writeonly %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %10, label %4
4: ; preds = %2
store i8 0, i8* %1
%5 = getelementptr inbounds i8, i8* %1, i64 1
store i8 23, i8* %5
%6 = getelementptr inbounds i8, i8* %1, i64 2
store i8 -102, i8* %6
%7 = getelementptr inbounds i8, i8* %1, i64 3
store i8 -120, i8* %7
%8 = getelementptr inbounds i8, i8* %1, i64 4
store i8 -120, i8* %8
%9 = getelementptr inbounds i8, i8* %1, i64 5
store i8 -120, i8* %9
br label %10
10: ; preds = %4, %2
ret i16 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void U32TO8_LITTLE(uint8_t *const c, const uint32_t v) {
  c[0] = (uint8_t)v;
  c[1] = (uint8_t)(v >> 8);
  c[2] = (uint8_t)(v >> 16);
  c[3] = (uint8_t)(v >> 24);
}


x86 assembly (clang, -O0):
<U32TO8_LITTLE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<U32TO8_LITTLE>:
movslq %esi,%rax
mov    %rax,(%rdi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rdi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @U32TO8_LITTLE(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
store i64 %3, i64* %0
%4 = ashr i32 %1, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %5, i64* %6
%7 = ashr i32 %1, 16
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %8, i64* %9
%10 = ashr i32 %1, 24
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %11, i64* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void printerr(const char *prefix, const char *msg, va_list ap) {
  fprintf(stderr, prefix);
  fprintf(stderr, ": ");
  vfprintf(stderr, msg, ap);
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<printerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vfprintf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printerr>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    0x2eac(%rip),%rbp
mov    0x0(%rbp),%edi
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <vfprintf@plt>
mov    0x0(%rbp),%edi
lea    0xea0(%rip),%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c": \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printerr(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %7, i8* %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @vfprintf(i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c": \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printerr(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 @vfprintf(i32 %8, i8* %1, i32 %2)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sclp_set_write_mask(int /*<<< orphan*/, int);
void sclp_setup(void) { sclp_set_write_mask(0, 0x00000040); }


x86 assembly (clang, -O0):
<sclp_setup>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x40,%esi
call   1030 <sclp_set_write_mask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sclp_setup>:
xor    %edi,%edi
mov    $0x40,%esi
jmp    1030 <sclp_set_write_mask@plt>

LLVM IR (-O0):
define void @sclp_setup() {
%1 = call i32 @sclp_set_write_mask(i32 0, i32 64)
ret void
}

LLVM IR (-O2):
define void @sclp_setup() {
%1 = tail call i32 @sclp_set_write_mask(i32 0, i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func3() { printf("This is not really here\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"This is not really here\0A\00"
define void @func3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"This is not really here\00"
define void @func3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
char const *skip_nonws(char const *c) {
  while (*c && *c != ' ' && *c != '\t' && *c != '\n')
    ++c;
  return c;
}


x86 assembly (clang, -O0):
<skip_nonws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_nonws+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_nonws+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_nonws+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <skip_nonws+0x67>
jmp    1178 <skip_nonws+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_nonws+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_nonws>:
mov    %rdi,%rax
movabs $0x100000601,%rcx
jmp    1114 <skip_nonws+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1110 <skip_nonws+0x10>
bt     %rdx,%rcx
jae    1110 <skip_nonws+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_nonws(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
i8 9, label %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
ret i8* %3
}
double getprob(sv, total)
int *sv;
int total;
{
  double ans, totseq;
  totseq = ((double)total) * 2.9957322735539909;
  ans = lnass(sv) + lnperm(sv, total) - totseq;
  return (ans);
}


x86 assembly (clang, -O0):
<getprob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <lnass@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <lnperm@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getprob>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
cvtsi2sd %esi,%xmm0
mulsd  0xec7(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <lnass@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <lnperm@plt>
add    %r14d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @getprob(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 0x4007F7427B73E391
store double %9, double* %6
%10 = load i32*, i32** %3
%11 = call i32 (i32*, ...) bitcast (i32 (...)* @lnass to i32 (i32*, ...)*)(i32* %10)
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @lnperm to i32 (i32*, i32, ...)*)(i32* %12, i32 %13)
%15 = add nsw i32 %11, %14
%16 = sitofp i32 %15 to double
%17 = load double, double* %6
%18 = fsub double %16, %17
store double %18, double* %5
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
define double @getprob(i32* %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fmul double %3, 0x4007F7427B73E391
%5 = tail call i32 (i32*, ...) bitcast (i32 (...)* @lnass to i32 (i32*, ...)*)(i32* %0)
%6 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @lnperm to i32 (i32*, i32, ...)*)(i32* %0, i32 %1)
%7 = add nsw i32 %6, %5
%8 = sitofp i32 %7 to double
%9 = fsub double %8, %4
ret double %9
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
struct buffer *new_buffer_size(int);
struct buffer *new_buffer(void) {
  return new_buffer_size(100);
}


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

x86 assembly (clang, -O2):
<new_buffer>:
mov    $0x64,%edi
jmp    1030 <new_buffer_size@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define %struct.buffer* @new_buffer() {
%1 = call %struct.buffer* @new_buffer_size(i32 100)
ret %struct.buffer* %1
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define %struct.buffer* @new_buffer() {
%1 = tail call %struct.buffer* @new_buffer_size(i32 100)
ret %struct.buffer* %1
}
double f1(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @f1(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
int atm_header_get_vpi(unsigned char *cell) {
  return ((((int)cell[0]) << 4) | (((int)cell[1]) >> 4));
}


x86 assembly (clang, -O0):
<atm_header_get_vpi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atm_header_get_vpi>:
movzbl (%rdi),%ecx
shl    $0x4,%ecx
movzbl 0x1(%rdi),%eax
shr    $0x4,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @atm_header_get_vpi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 4
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = ashr i32 %11, 4
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @atm_header_get_vpi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = lshr i8 %6, 4
%8 = zext i8 %7 to i32
%9 = or i32 %4, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ generate(char *);
int main() {
  generate("u SB");
  generate("fuck u");
  generate("WTF");
  generate("TKS");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <generate@plt>
lea    0xed3(%rip),%rdi
call   1030 <generate@plt>
lea    0xece(%rip),%rdi
call   1030 <generate@plt>
lea    0xec6(%rip),%rdi
call   1030 <generate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"u SB\00"
@.str.1 = [7 x i8] c"fuck u\00"
@.str.2 = [4 x i8] c"WTF\00"
@.str.3 = [4 x i8] c"TKS\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @generate(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @generate(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @generate(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @generate(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"u SB\00"
@.str.1 = [7 x i8] c"fuck u\00"
@.str.2 = [4 x i8] c"WTF\00"
@.str.3 = [4 x i8] c"TKS\00"
define i32 @main() {
%1 = tail call i32 @generate(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @generate(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @generate(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @generate(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
int pty_master_readable(int fd, long usec) { return 0; }


x86 assembly (clang, -O0):
<pty_master_readable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pty_master_readable(i32 %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int get_n_vars();
int get_n_vgms(void) {
  int n;
  n = get_n_vars();
  return (n * (n + 1)) / 2;
}


x86 assembly (clang, -O0):
<get_n_vgms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_n_vars@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_n_vgms>:
push   %rax
xor    %eax,%eax
call   1030 <get_n_vars@plt>
lea    0x1(%rax),%ecx
imul   %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_n_vgms() {
%1 = alloca i32
%2 = call i32 (...) @get_n_vars()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_n_vgms() {
%1 = tail call i32 (...) @get_n_vars()
%2 = add nsw i32 %1, 1
%3 = mul nsw i32 %2, %1
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_96(void) { DeinitFields(); }


x86 assembly (clang, -O0):
<SwitchFrom_96>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DeinitFields@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SwitchFrom_96() {
%1 = call i32 (...) @DeinitFields()
ret void
}

LLVM IR (-O2):
define void @SwitchFrom_96() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
void d2i_OCSP_REQUEST(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_OCSP_REQUEST() {
ret void
}
/* Variables and functions */
int strlen(char *);
int clean_line(char *line) {
  int i;
  for (i = 0; i < strlen(line); i++)
    line[i] = line[i + 1];
  return i;
}


x86 assembly (clang, -O0):
<clean_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1168 <clean_line+0x58>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <clean_line+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
xor    %ebx,%ebx
test   %eax,%eax
jle    114d <clean_line+0x3d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%r14,%rbx,1),%eax
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <clean_line+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @clean_line(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %15
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %8, i8* %9
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %6, %11
br i1 %12, label %4, label %13
13: ; preds = %4
%14 = trunc i64 %6 to i32
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
long double __qtanh(long double);
long double intr_wrap_086(long double p1) { return __qtanh(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_086>:
jmp    1030 <__qtanh@plt>

LLVM IR (-O0):
define x86_fp80 @intr_wrap_086(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 @__qtanh(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @intr_wrap_086(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qtanh(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ bb_main();
int main(int argc, char **argv) {
  bb_main();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bb_main@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @bb_main()
ret i32 0
}
/* Type definitions */
typedef float float_t;

/* Variables and functions */
float floorf(float);
float __rmod(float x, float_t y) {
  float q1, q2;
  if ((q1 = x / y) >= 0.0F)
    q2 = floorf(q1);
  else
    q2 = -floorf(-q1);
  return (x - y * q2);
}


x86 assembly (clang, -O0):
<__rmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1151 <__rmod+0x41>
movss  -0xc(%rbp),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,-0x10(%rbp)
jmp    117a <__rmod+0x6a>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <floorf@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rmod>:
push   %rax
movss  %xmm0,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    113d <__rmod+0x2d>
xorps  0xed1(%rip),%xmm0
call   1030 <floorf@plt>
xorps  0xec5(%rip),%xmm0
jmp    1142 <__rmod+0x32>
call   1030 <floorf@plt>
movss  0x4(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  (%rsp),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @__rmod(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fdiv float %7, %8
store float %9, float* %5
%10 = fcmp oge float %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load float, float* %5
%13 = call float @llvm.floor.f32(float %12)
store float %13, float* %6
br label %19
14: ; preds = %2
%15 = load float, float* %5
%16 = fneg float %15
%17 = call float @llvm.floor.f32(float %16)
%18 = fneg float %17
store float %18, float* %6
br label %19
19: ; preds = %14, %11
%20 = load float, float* %3
%21 = load float, float* %4
%22 = load float, float* %6
%23 = fneg float %21
%24 = call float @llvm.fmuladd.f32(float %23, float %22, float %20)
ret float %24
}

LLVM IR (-O2):
define float @__rmod(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = fcmp ult float %3, 0.000000e+00
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call float @llvm.floor.f32(float %3)
br label %11
7: ; preds = %2
%8 = fneg float %3
%9 = tail call float @llvm.floor.f32(float %8)
%10 = fneg float %9
br label %11
11: ; preds = %7, %5
%12 = phi float [ %6, %5 ], [ %10, %7 ]
%13 = fneg float %1
%14 = tail call float @llvm.fmuladd.f32(float %13, float %12, float %0)
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(int exitval) {
  fprintf(exitval ? stderr : stdout,
          "Usage: setsecblk [--help] [--device id] <new string>\n");
  exit(exitval);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <usage+0x26>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <usage+0x32>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1130 <usage+0x10>
mov    0x2eaa(%rip),%rax
jmp    1137 <usage+0x17>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [54 x i8] c"Usage: setsecblk [--help] [--device id] <new string>\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @stderr
br label %9
7: ; preds = %1
%8 = load i32, i32* @stdout
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [54 x i8] c"Usage: setsecblk [--help] [--device id] <new string>\0A\00"
define void @usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = load i32, i32* @stdout
%5 = select i1 %2, i32 %4, i32 %3
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int writeall(int, char *, int /*<<< orphan*/);
int puts(const char *str) { return writeall(1, (char *)str, strlen(str)); }


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <writeall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <writeall@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @writeall(i32 1, i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isblank(char);
char next_char(char **p) {
  while (**p && isblank(**p))
    *p += 1;
  return **p;
}


x86 assembly (clang, -O0):
<next_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114d <next_char+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115d <next_char+0x4d>
jmp    1170 <next_char+0x60>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <next_char+0xc>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_char>:
push   %rbx
mov    (%rdi),%rax
mov    (%rax),%al
test   %al,%al
je     113f <next_char+0x2f>
mov    %rdi,%rbx
nopl   (%rax)
movsbl %al,%edi
call   1030 <isblank@plt>
mov    (%rbx),%rcx
test   %rax,%rax
je     1143 <next_char+0x33>
lea    0x1(%rcx),%rax
mov    %rax,(%rbx)
movzbl 0x1(%rcx),%eax
test   %al,%al
jne    1120 <next_char+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    (%rcx),%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @next_char(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %17, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = call i64 @isblank(i8 signext %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %9, %3
%16 = phi i1 [ false, %3 ], [ %14, %9 ]
br i1 %16, label %17, label %21
17: ; preds = %15
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8* %20, i8** %18
br label %3
21: ; preds = %15
%22 = load i8**, i8*** %2
%23 = load i8*, i8** %22
%24 = load i8, i8* %23
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @next_char(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %1, %12
%6 = phi i8 [ %14, %12 ], [ %3, %1 ]
%7 = tail call i64 @isblank(i8 signext %6)
%8 = icmp eq i64 %7, 0
%9 = load i8*, i8** %0
br i1 %8, label %10, label %12
10: ; preds = %5
%11 = load i8, i8* %9
br label %16
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %13, i8** %0
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %12, %10, %1
%17 = phi i8 [ 0, %1 ], [ %11, %10 ], [ 0, %12 ]
ret i8 %17
}
/* Variables and functions */
int sameData(const char *data1, const char *data2, size_t len) {
  while (len--)
    if (*data1++ != *data2++)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<sameData>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1166 <sameData+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1161 <sameData+0x61>
movl   $0x0,-0x4(%rbp)
jmp    116d <sameData+0x6d>
jmp    1110 <sameData+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sameData>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %rax,%rdx
je     112a <sameData+0x2a>
movzbl (%rdi,%rax,1),%r8d
lea    0x1(%rax),%rcx
cmp    (%rsi,%rax,1),%r8b
mov    %rcx,%rax
je     1110 <sameData+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sameData(i8* nocapture %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i64 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i64 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = add i64 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %17
}
/* Variables and functions */
int do_send(int, char *, char const *, char const *);
int irc_ban(int fd, const char *channel, const char *nick) {
  return do_send(fd, "MODE %s +b %s", channel, nick);
}


x86 assembly (clang, -O0):
<irc_ban>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <do_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_ban>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"MODE %s +b %s\00"
define i32 @irc_ban(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 = call i32 @do_send(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"MODE %s +b %s\00"
define i32 @irc_ban(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x03() {
  Assert_real((isspace(3) == 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_isspace.c",
              20, ("isspace should be 0 for 0x03"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x03>:
push   %rax
mov    $0x3,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x03\00"
define void @t_isspace_0x03() {
%1 = call i64 @isspace(i32 3)
%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 20, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x03\00"
define void @t_isspace_0x03() {
%1 = tail call i64 @isspace(i32 3)
%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 20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int reset_signal_handlers_to_default(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @reset_signal_handlers_to_default() {
ret i32 1
}

LLVM IR (-O2):
define i32 @reset_signal_handlers_to_default() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int reverse(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  printf("%d\n", reverse(atoi(argv[1])));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <reverse@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <reverse@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @reverse(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *cstr_sub(char *ptr, int len) {
  char *dst = (char *)malloc(sizeof(char) * (len + 1));
  memcpy(dst, ptr, len);
  dst[len] = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<cstr_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstr_sub>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @cstr_sub(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = call i32 @memcpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %5
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 0, i8* %20
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @cstr_sub(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %1)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xd6() {
  Assert_real((isalnum(214) == 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_isalnum.c",
              1075, ("isalnum should be 0 for 0xd6"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xd6>:
push   %rax
mov    $0xd6,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x433,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd6\00"
define void @t_isalnum_0xd6() {
%1 = call i64 @isalnum(i32 214)
%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 1075, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd6\00"
define void @t_isalnum_0xd6() {
%1 = tail call i64 @isalnum(i32 214)
%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 1075, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ target();
void b() {
  target();
  target();
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <target@plt>
mov    $0x0,%al
call   1030 <target@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rax
xor    %eax,%eax
call   1030 <target@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <target@plt>

LLVM IR (-O0):
define void @b() {
%1 = call i32 (...) @target()
%2 = call i32 (...) @target()
ret void
}

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 (...) @target()
%2 = tail call i32 (...) @target()
ret void
}
int is_power_of_2(unsigned long n) { return (n != 0 && ((n & (n - 1)) == 0)); }


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1131 <is_power_of_2+0x31>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
test   %rdi,%rdi
je     1112 <is_power_of_2+0x12>
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_power_of_2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo(int);
int main(void) {
  if (foo(1) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
cmp    $0x0,%rax
je     114a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <foo@plt>
test   %rax,%rax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @foo(i32 1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}