xunge/DecIR huggingface dataset:
char *r_strdup(str)
char *str;
{
  int len;
  char *nstr;
  if (!str)
    return (0);
  len = strlen(str) + 1;
  if (!(nstr = r_malloc(0, len)))
    return (0);
  memcpy(nstr, str, len);
  return (nstr);
}


x86 assembly (clang, -O0):
<r_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <r_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    11a6 <r_strdup+0x76>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <r_malloc@plt>
cltq
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    118d <r_strdup+0x5d>
movq   $0x0,-0x8(%rbp)
jmp    11a6 <r_strdup+0x76>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_strdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     116d <r_strdup+0x3d>
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%ebx
xor    %r14d,%r14d
xor    %edi,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <r_malloc@plt>
test   %eax,%eax
je     1170 <r_strdup+0x40>
movslq %eax,%r14
movslq %ebx,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <memcpy@plt>
jmp    1170 <r_strdup+0x40>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @r_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @r_malloc to i32 (i32, i32, ...)*)(i32 0, i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = icmp eq i32 %7, 0
br i1 %10, label %13, label %11
11: ; preds = %3
%12 = sext i32 %6 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %9, i8* align 1 %0, i64 %12, i1 false)
br label %13
13: ; preds = %3, %1, %11
%14 = phi i8* [ %9, %11 ], [ null, %1 ], [ null, %3 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ static_func();
void shared_func() {
  printf("shared called !!\n");
  static_func();
}


x86 assembly (clang, -O0):
<shared_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <static_func@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shared_func>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <static_func@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"shared called !!\0A\00"
define void @shared_func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @static_func()
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"shared called !!\00"
define void @shared_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @static_func()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int m(int x) {
  int c, a;
  a = (c = 5) + 16 + x * 2;
  foo(c, a);
}


x86 assembly (clang, -O0):
<m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x15,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m>:
lea    (%rdi,%rdi,1),%esi
add    $0x15,%esi
mov    $0x5,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @m(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 5, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 2
%8 = add nsw i32 21, %7
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @foo(i32 %9, i32 %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @m(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 21
%4 = tail call i32 @foo(i32 5, i32 %3)
ret i32 undef
}
double tf_bd(signed char x, double c) { return c / 3; }


x86 assembly (clang, -O0):
<tf_bd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee4(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf_bd>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @tf_bd(i8 signext %0, double %1) {
%3 = alloca i8
%4 = alloca double
store i8 %0, i8* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fdiv double %5, 3.000000e+00
ret double %6
}

LLVM IR (-O2):
define double @tf_bd(i8 signext %0, double %1) {
%3 = fdiv double %1, 3.000000e+00
ret double %3
}
f() {
  int i;
  for (i = 1;; i = 0) {
    if (h()) {
      if (i)
        g();
      g(h());
      g(h());
    } else {
      g();
      break;
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <h@plt>
cmp    $0x0,%eax
je     1175 <f+0x55>
cmpl   $0x0,-0x8(%rbp)
je     1150 <f+0x30>
mov    $0x0,%al
call   1040 <g@plt>
mov    $0x0,%al
call   1030 <h@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <g@plt>
mov    $0x0,%al
call   1030 <h@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <g@plt>
jmp    1181 <f+0x61>
mov    $0x0,%al
call   1040 <g@plt>
jmp    1192 <f+0x72>
jmp    1186 <f+0x66>
movl   $0x0,-0x8(%rbp)
jmp    112f <f+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %eax,%eax
call   1030 <h@plt>
test   %eax,%eax
je     116b <f+0x4b>
xor    %eax,%eax
call   1040 <g@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <h@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
call   1030 <h@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
call   1030 <h@plt>
test   %eax,%eax
jne    1140 <f+0x20>
xor    %eax,%eax
pop    %rcx
jmp    1040 <g@plt>

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

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 (...) @h()
%2 = icmp eq i32 %1, 0
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i32 (...) @g()
br label %5
5: ; preds = %5, %3
%6 = tail call i32 (...) @h()
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @g to i32 (i32, ...)*)(i32 %6)
%8 = tail call i32 (...) @h()
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @g to i32 (i32, ...)*)(i32 %8)
%10 = tail call i32 (...) @h()
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %0
%13 = tail call i32 (...) @g()
ret i32 undef
}
/* Variables and functions */
int test(int, char **);
int main(int argc, char **argv) { return test(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned char, int);
void clear_mem_error(unsigned char reason) {
  reason = (reason & 0xf) | 4;
  outb(reason, 0x61);
}


x86 assembly (clang, -O0):
<clear_mem_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
or     $0x4,%eax
mov    %al,-0x1(%rbp)
mov    $0x61,%esi
movzbl -0x1(%rbp),%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_mem_error>:
and    $0xb,%dil
or     $0x4,%dil
movzbl %dil,%edi
mov    $0x61,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @clear_mem_error(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = or i32 %5, 4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = call i32 @outb(i8 zeroext %8, i32 97)
ret void
}

LLVM IR (-O2):
define void @clear_mem_error(i8 zeroext %0) {
%2 = and i8 %0, 11
%3 = or i8 %2, 4
%4 = tail call i32 @outb(i8 zeroext %3, i32 97)
ret void
}
/* Variables and functions */
int match(char const *, char *);
int esVariable(const char *linea) { return match(linea, "^[a-z][0-9a-z_]*:"); }


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

x86 assembly (clang, -O2):
<esVariable>:
lea    0xee9(%rip),%rsi
jmp    1030 <match@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"^[a-z][0-9a-z_]*:\00"
define i32 @esVariable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @match(i8* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"^[a-z][0-9a-z_]*:\00"
define i32 @esVariable(i8* %0) {
%2 = tail call i32 @match(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int test_imm_66int8_reg(signed char val) {
  return ((val) & (0x66 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_66int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x66,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_66int8_reg>:
test   $0x66,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_66int8_reg(i8 signext %0) {
%2 = and i8 %0, 102
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned char bit_count(unsigned num) {
  unsigned char bit_count = 0;
  while (num) {
    num >>= 1;
    bit_count++;
  }
  return bit_count;
}


x86 assembly (clang, -O0):
<bit_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112b <bit_count+0x2b>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    110b <bit_count+0xb>
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_count>:
xor    %eax,%eax
test   %edi,%edi
je     111b <bit_count+0x1b>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%al
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bit_count+0x10>
ret

LLVM IR (-O0):
define zeroext i8 @bit_count(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %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 %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = lshr i32 %8, 1
store i32 %9, i32* %2
%10 = load i8, i8* %3
%11 = add i8 %10, 1
store i8 %11, i8* %3
br label %4
12: ; preds = %4
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @bit_count(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i8 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8 [ 0, %1 ], [ %7, %3 ]
ret i8 %10
}
void (*tag4(int sig, void (*handler)(int)))(int) {
  (*handler)(sig);
  return handler;
}


x86 assembly (clang, -O0):
<tag4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
call   *%rax
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag4>:
push   %rbx
mov    %rsi,%rbx
call   *%rsi
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define void (i32)* @tag4(i32 %0, void (i32)* returned %1) {
tail call void %1(i32 %0)
ret void (i32)* %1
}
int dsi_init(struct platform_device *pdev) { return 0; }


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

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

LLVM IR (-O0):
%struct.platform_device = type opaque
define i32 @dsi_init(%struct.platform_device* %0) {
%2 = alloca %struct.platform_device*
store %struct.platform_device* %0, %struct.platform_device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @dsi_init(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
diag(s) char *s;
{
  while (*s)
    write(2, s++, 1);
}


x86 assembly (clang, -O0):
<diag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <diag+0x3e>
mov    -0x10(%rbp),%rsi
mov    %rsi,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    $0x2,%edi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <write@plt>
jmp    111c <diag+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diag>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1141 <diag+0x31>
mov    %rdi,%rbx
nopl   0x0(%rax)
lea    0x1(%rbx),%r14
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
mov    %r14,%rbx
jne    1120 <diag+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @diag(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* %9, i32 1)
br label %4
12: ; preds = %4
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @diag(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* %5, i32 1)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR3A_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_WMR3A_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
ginc(lval) int lval[];
{
  if (lval[2] == (2 << 2))
    ol("addd\t#2");
  else
    ol("addd\t#1");
}


x86 assembly (clang, -O0):
<ginc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x8,0x8(%rax)
jne    113d <ginc+0x2d>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
jmp    114b <ginc+0x3b>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ginc>:
cmpl   $0x8,0x8(%rdi)
lea    0xee5(%rip),%rax
lea    0xee6(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"addd\09\00"
@.str.1 = [8 x i8] c"addd\09\00"
define i32 @ginc(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 8
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"addd\09\00"
@.str.1 = [8 x i8] c"addd\09\00"
define i32 @ginc(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 8
%5 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* %5)
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ ino_t;

/* Variables and functions */
int akwbs_compare_file_stat(const void *pa, const void *pb) {
  if (*(ino_t *)pa < *(ino_t *)pb)
    return -1;
  if (*(ino_t *)pa > *(ino_t *)pb)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<akwbs_compare_file_stat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jge    112c <akwbs_compare_file_stat+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <akwbs_compare_file_stat+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jle    114c <akwbs_compare_file_stat+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <akwbs_compare_file_stat+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<akwbs_compare_file_stat>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @akwbs_compare_file_stat(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void g_unichar_istitle() {}


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

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

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

LLVM IR (-O2):
define void @g_unichar_istitle() {
ret void
}
/* Variables and functions */
int source_peek(char *);
int /*<<< orphan*/ source_skip();
int source_get(char *c) {
  int ret;
  ret = source_peek(c);
  if (ret >= 1) {
    source_skip();
  }
  return ret;
}


x86 assembly (clang, -O0):
<source_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <source_peek@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1149 <source_get+0x29>
mov    $0x0,%al
call   1040 <source_skip@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<source_get>:
push   %rbx
call   1030 <source_peek@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    1133 <source_get+0x13>
xor    %eax,%eax
call   1040 <source_skip@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @source_get(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @source_peek(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @source_skip()
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @source_get(i8* %0) {
%2 = tail call i32 @source_peek(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @source_skip()
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xe1() {
  Assert_real((isdigit(225) == 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_isdigit.c",
              1130, ("isdigit should be 0 for 0xe1"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xe1>:
push   %rax
mov    $0xe1,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46a,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xe1\00"
define void @t_isdigit_0xe1() {
%1 = call i64 @isdigit(i32 225)
%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 1130, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xe1\00"
define void @t_isdigit_0xe1() {
%1 = tail call i64 @isdigit(i32 225)
%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 1130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cc_cache_fini();
int /*<<< orphan*/ cc_reg_fini();
void cc_allocator_fini(void) {
  cc_reg_fini();
  cc_cache_fini();
}


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

x86 assembly (clang, -O2):
<cc_allocator_fini>:
push   %rax
xor    %eax,%eax
call   1030 <cc_reg_fini@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cc_cache_fini@plt>

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

LLVM IR (-O2):
define void @cc_allocator_fini() {
%1 = tail call i32 (...) @cc_reg_fini()
%2 = tail call i32 (...) @cc_cache_fini()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_unary3();
void do_app3(void) { do_unary3(); }


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

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

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

LLVM IR (-O2):
define void @do_app3() {
%1 = tail call i32 (...) @do_unary3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
char *mymalloc(int);
char *cnvstr(char *name, int l) {
  char *p = mymalloc(l + 1);
  memcpy(p, name, l);
  p[l] = 0;
  return p;
}


x86 assembly (clang, -O0):
<cnvstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <mymalloc@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):
<cnvstr>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <mymalloc@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* @cnvstr(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 = call i8* @mymalloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @cnvstr(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @mymalloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int get_cores(void) {
  int cpus = 5;
  cpus = sysconf(_SC_NPROCESSORS_ONLN);
  return cpus;
}


x86 assembly (clang, -O0):
<get_cores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cores>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_cores() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* @_SC_NPROCESSORS_ONLN
%3 = call i32 @sysconf(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_cores() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Variables and functions */
int my_pid();
int dp_my_pid(void) { return my_pid(); }


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

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

LLVM IR (-O0):
define i32 @dp_my_pid() {
%1 = call i32 (...) @my_pid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @dp_my_pid() {
%1 = tail call i32 (...) @my_pid()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setjmp(int /*<<< orphan*/);
int main() {
  jmp_buf buf;
  if (!setjmp(buf)) {
    printf("Raising Exception\n");
    printf("%lu\n%lu", sizeof(jmp_buf), sizeof(int));
    longjmp(buf, 1);
  } else {
    printf("Caught Exception\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1040 <setjmp@plt>
cmp    $0x0,%eax
jne    117a <main+0x4a>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x4,%edx
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <longjmp@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <setjmp@plt>
test   %eax,%eax
je     115a <main+0x1a>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe93(%rip),%rdi
xor    %eax,%eax
mov    $0x4,%edx
mov    %rdx,%rsi
call   1040 <printf@plt>
mov    $0x1,%esi
call   1060 <longjmp@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Raising Exception\0A\00"
@.str.1 = [8 x i8] c"%lu\0A%lu\00"
@.str.2 = [18 x i8] c"Caught Exception\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @setjmp(i32 %2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 4, i64 4)
%8 = load i32, i32* %1
%9 = call i32 @longjmp(i32 %8, i32 1)
unreachable
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%lu\0A%lu\00"
@str = [18 x i8] c"Raising Exception\00"
@str.3 = [17 x i8] c"Caught Exception\00"
define i32 @main() {
%1 = call i32 @setjmp(i32 undef)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 4, i64 4)
%6 = call i32 @longjmp(i32 undef, i32 1)
unreachable
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int execute_uname() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_uname() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fxam() {
  db(0xD9);
  db(0xE5);
}


x86 assembly (clang, -O0):
<fxam>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xe5,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxam>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xe5,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fxam() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 229)
ret void
}

LLVM IR (-O2):
define void @fxam() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 229)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nsblk_spam_who(int);
void nsblk_spam_who3(void) { nsblk_spam_who(3); }


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

x86 assembly (clang, -O2):
<nsblk_spam_who3>:
mov    $0x3,%edi
jmp    1030 <nsblk_spam_who@plt>

LLVM IR (-O0):
define void @nsblk_spam_who3() {
%1 = call i32 @nsblk_spam_who(i32 3)
ret void
}

LLVM IR (-O2):
define void @nsblk_spam_who3() {
%1 = tail call i32 @nsblk_spam_who(i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_64(int /*<<< orphan*/);
uint64_t htobe64(uint64_t host_64bits) { return bswap_64(host_64bits); }


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

x86 assembly (clang, -O2):
<htobe64>:
jmp    1030 <bswap_64@plt>

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

LLVM IR (-O2):
define i32 @htobe64(i32 %0) {
%2 = tail call i32 @bswap_64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(char *argv) {
  printf("usage: ");
  printf(argv);
  printf(" [first integer] [second integer]\n");
  printf("This program takes two positive integers and finds the greatest "
         "common denominator between them");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"usage: \00"
@.str.1 = [35 x i8] c" [first integer] [second integer]\0A\00"
@.str.2 = [96 x i8] c"This program takes two positive integers and finds the greatest common denominator between them\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"usage: \00"
@.str.2 = [96 x i8] c"This program takes two positive integers and finds the greatest common denominator between them\00"
@str = [34 x i8] c" [first integer] [second integer]\00"
define void @usage(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct ks10_uinsn {
  int dummy;
};

/* Variables and functions */
int get_field(char *, struct ks10_uinsn *);
int ifMEM(int i, struct ks10_uinsn *insn) {
  return get_field("MEM", insn) == 1;
}


x86 assembly (clang, -O0):
<ifMEM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <get_field@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifMEM>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <get_field@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ks10_uinsn = type { i32 }
@.str = [4 x i8] c"MEM\00"
define i32 @ifMEM(i32 %0, %struct.ks10_uinsn* %1) {
%3 = alloca i32
%4 = alloca %struct.ks10_uinsn*
store i32 %0, i32* %3
store %struct.ks10_uinsn* %1, %struct.ks10_uinsn** %4
%5 = load %struct.ks10_uinsn*, %struct.ks10_uinsn** %4
%6 = call i32 @get_field(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.ks10_uinsn* %5)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.ks10_uinsn = type { i32 }
@.str = [4 x i8] c"MEM\00"
define i32 @ifMEM(i32 %0, %struct.ks10_uinsn* %1) {
%3 = tail call i32 @get_field(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.ks10_uinsn* %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int inoutput_file_exist(char *pFileName) {
  int retval;
  if (access(pFileName, F_OK) == 0) {
    retval = 1;
  } else {
    retval = 0;
  }
  return retval;
}


x86 assembly (clang, -O0):
<inoutput_file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1144 <inoutput_file_exist+0x34>
movl   $0x1,-0xc(%rbp)
jmp    114b <inoutput_file_exist+0x3b>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inoutput_file_exist>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @inoutput_file_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @F_OK
%6 = call i64 @access(i8* %4, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %3
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @inoutput_file_exist(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello, World!"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void termop_settab(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      389, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_settab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x185,%r8d
lea    0xf37(%rip),%r9
lea    0xf3e(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_settab>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf65(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x185,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_settab = [14 x i8] c"termop_settab\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_settab(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 389, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.termop_settab, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_settab = [14 x i8] c"termop_settab\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_settab(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 389, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.termop_settab, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
void underLineToSpace(char *str) {
  for (int i = 0; str[i]; i++)
    if (str[i] == '_')
      str[i] = ' ';
}


x86 assembly (clang, -O0):
<underLineToSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <underLineToSpace+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5f,%eax
jne    1142 <underLineToSpace+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
jmp    1147 <underLineToSpace+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <underLineToSpace+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<underLineToSpace>:
jmp    1117 <underLineToSpace+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x20,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x5f,%al
je     1110 <underLineToSpace+0x10>
test   %al,%al
jne    1113 <underLineToSpace+0x13>
ret

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

LLVM IR (-O2):
define void @underLineToSpace(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i64 [ %9, %8 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 0, label %6
i8 95, label %7
]
6: ; preds = %2
ret void
7: ; preds = %2
store i8 32, i8* %4
br label %8
8: ; preds = %2, %7
%9 = add nuw i64 %3, 1
br label %2
}
void swap(char *v[], int i, int j) {
  char *tmp = v[i];
  v[i] = v[j];
  v[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}