xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ BUFSIZ;
int atoi(char *);
int /*<<< orphan*/ fgets(char *, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
char *xcalloc(scalar_t__, int);
int get_choice(void) {
  char *s;
  int i;
  s = xcalloc(BUFSIZ + 1, sizeof(*s));
  printf("Choice: ");
  fgets(s, BUFSIZ, stdin);
  i = atoi(s);
  free(s);
  return i;
}


x86 assembly (clang, -O0):
<get_choice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e79(%rip),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1070 <xcalloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e4d(%rip),%rax
mov    (%rax),%rsi
mov    0x2e53(%rip),%rax
mov    (%rax),%edx
call   1050 <fgets@plt>
mov    -0x8(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_choice>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e7e(%rip),%rbp
mov    0x0(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1070 <xcalloc@plt>
mov    %rax,%rbx
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    0x0(%rbp),%rsi
mov    0x2e62(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i64 0
@.str = [9 x i8] c"Choice: \00"
@stdin = global i32 0
define i32 @get_choice() {
%1 = alloca i8*
%2 = alloca i32
%3 = load i64, i64* @BUFSIZ
%4 = add nsw i64 %3, 1
%5 = call i8* @xcalloc(i64 %4, i32 1)
store i8* %5, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %1
%8 = load i64, i64* @BUFSIZ
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %7, i64 %8, i32 %9)
%11 = load i8*, i8** %1
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %2
%13 = load i8*, i8** %1
%14 = call i32 @free(i8* %13)
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@BUFSIZ = global i64 0
@.str = [9 x i8] c"Choice: \00"
@stdin = global i32 0
define i32 @get_choice() {
%1 = load i64, i64* @BUFSIZ
%2 = add nsw i64 %1, 1
%3 = tail call i8* @xcalloc(i64 %2, i32 1)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i64, i64* @BUFSIZ
%6 = load i32, i32* @stdin
%7 = tail call i32 @fgets(i8* %3, i64 %5, i32 %6)
%8 = tail call i32 @atoi(i8* %3)
%9 = tail call i32 @free(i8* %3)
ret i32 %8
}
int operand(char c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
         (c >= '0' && c <= '9');
}


x86 assembly (clang, -O0):
<operand>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <operand+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <operand+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <operand+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <operand+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <operand+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<operand>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @operand(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 48
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 57
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @operand(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int Pieri_root_count(int m, int p, int q, int *r) {
  int fail;
  int mpq[3];
  double *c;
  mpq[0] = m;
  mpq[1] = p;
  mpq[2] = q;
  fail = _ada_use_c2phc(223, mpq, r, c);
  return fail;
}


x86 assembly (clang, -O0):
<Pieri_root_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0xdf,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pieri_root_count>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0xdf,%edi
mov    %rcx,%rdx
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @Pieri_root_count(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca [3 x i32]
%11 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%12 = load i32, i32* %5
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
store i32 %16, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%19 = load i32*, i32** %8
%20 = load double*, double** %11
%21 = call i32 @_ada_use_c2phc(i32 223, i32* %18, i32* %19, double* %20)
store i32 %21, i32* %9
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @Pieri_root_count(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %2, i32* %9
%10 = call i32 @_ada_use_c2phc(i32 223, i32* %7, i32* %3, double* undef)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ convertToUnibyteString(unsigned short *, unsigned char *,
                                          unsigned int const);
void LOGI_S16(unsigned short *string, const unsigned int length) {
  unsigned char tmp_buffer[length];
  convertToUnibyteString(string, tmp_buffer, length);
  ;
}


x86 assembly (clang, -O0):
<LOGI_S16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
call   1030 <convertToUnibyteString@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOGI_S16>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%edx
mov    %esi,%eax
mov    %rsp,%rsi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
call   1030 <convertToUnibyteString@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @LOGI_S16(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i16* %0, i16** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i16*, i16** %3
%12 = load i32, i32* %4
%13 = call i32 @convertToUnibyteString(i16* %11, i8* %10, i32 %12)
%14 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @LOGI_S16(i16* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @convertToUnibyteString(i16* %0, i8* %4, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, int /*<<< orphan*/, double,
                           int /*<<< orphan*/, double, double);
int /*<<< orphan*/ glutPostRedisplay();
void reshape(int w, int h) {
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0.0, (GLfloat)w, 0.0, (GLfloat)h, 0.0, -1.0);
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xorps  %xmm2,%xmm2
movsd  0xe8c(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1040 <glOrtho@plt>
mov    $0x0,%al
call   1060 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
movsd  0xe9c(%rip),%xmm3
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <glOrtho@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <glutPostRedisplay@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @reshape(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @GL_PROJECTION
%6 = call i32 @glMatrixMode(i32 %5)
%7 = call i32 (...) @glLoadIdentity()
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @glOrtho(double 0.000000e+00, i32 %8, double 0.000000e+00, i32 %9, double 0.000000e+00, double -1.000000e+00)
%11 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @reshape(i32 %0, i32 %1) {
%3 = load i32, i32* @GL_PROJECTION
%4 = tail call i32 @glMatrixMode(i32 %3)
%5 = tail call i32 (...) @glLoadIdentity()
%6 = tail call i32 @glOrtho(double 0.000000e+00, i32 %0, double 0.000000e+00, i32 %1, double 0.000000e+00, double -1.000000e+00)
%7 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void normal(int number) {
  int last;
  do {
    last = number % 10;
    printf("%d", last);
    number /= 10;
  } while (number != 0);
}


x86 assembly (clang, -O0):
<normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <normal+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xee2(%rip),%r14
xchg   %ax,%ax
movslq %ebx,%r15
imul   $0x66666667,%r15,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x22,%rbx
add    %eax,%ebx
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %r15d,%esi
sub    %eax,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x9,%r15d
cmp    $0x12,%r15d
ja     1120 <normal+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @normal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %2
%6 = srem i32 %5, 10
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 10
store i32 %10, i32* %2
br label %11
11: ; preds = %4
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @normal(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = srem i32 %3, 10
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = sdiv i32 %3, 10
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
/* Type definitions */
struct TS_bits {
  int dummy;
};

/* Variables and functions */
unsigned int bits_get(struct TS_bits *, unsigned int);
void bits_skip(struct TS_bits *bits, unsigned len) {
  unsigned int result;
  while (len > 32) {
    result = bits_get(bits, 32);
    len -= 32;
  }
  result = bits_get(bits, len);
}


x86 assembly (clang, -O0):
<bits_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jbe    1148 <bits_skip+0x38>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <bits_get@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <bits_skip+0xf>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <bits_get@plt>
mov    %eax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_skip>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
cmp    $0x21,%esi
jb     1135 <bits_skip+0x25>
xchg   %ax,%ax
mov    %r14,%rdi
mov    $0x20,%esi
call   1030 <bits_get@plt>
add    $0xffffffe0,%ebx
cmp    $0x20,%ebx
ja     1120 <bits_skip+0x10>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <bits_get@plt>

LLVM IR (-O0):
%struct.TS_bits = type { i32 }
define void @bits_skip(%struct.TS_bits* %0, i32 %1) {
%3 = alloca %struct.TS_bits*
%4 = alloca i32
%5 = alloca i32
store %struct.TS_bits* %0, %struct.TS_bits** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp ugt i32 %7, 32
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load %struct.TS_bits*, %struct.TS_bits** %3
%11 = call i32 @bits_get(%struct.TS_bits* %10, i32 32)
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = sub i32 %12, 32
store i32 %13, i32* %4
br label %6
14: ; preds = %6
%15 = load %struct.TS_bits*, %struct.TS_bits** %3
%16 = load i32, i32* %4
%17 = call i32 @bits_get(%struct.TS_bits* %15, i32 %16)
store i32 %17, i32* %5
ret void
}

LLVM IR (-O2):
%struct.TS_bits = type { i32 }
define void @bits_skip(%struct.TS_bits* %0, i32 %1) {
%3 = icmp ugt i32 %1, 32
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @bits_get(%struct.TS_bits* %0, i32 32)
%7 = add i32 %5, -32
%8 = icmp ugt i32 %7, 32
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %7, %4 ]
%11 = tail call i32 @bits_get(%struct.TS_bits* %0, i32 %10)
ret void
}
int test_create_pack() { return 100; }


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

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

LLVM IR (-O0):
define i32 @test_create_pack() {
ret i32 100
}

LLVM IR (-O2):
define i32 @test_create_pack() {
ret i32 100
}
const unsigned long hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
void _set_fault(unsigned char *u) { u[3] |= (1 << 5); }


x86 assembly (clang, -O0):
<_set_fault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%ecx
or     $0x20,%ecx
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_fault>:
orb    $0x20,0x3(%rdi)
ret

LLVM IR (-O0):
define void @_set_fault(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 32
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
ret void
}

LLVM IR (-O2):
define void @_set_fault(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = or i8 %3, 32
store i8 %4, i8* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int main() {
  int x, y, i;
  x = 0;
  y = 0;
  for (i = 0; i < 10; i++) {
    x++;
    y++;
  }
  __CRAB_assert(x > y);
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    115e <main+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <__CRAB_assert@plt>
mov    $0x14,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__CRAB_assert(i32 0)
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ core8_swap(char *, int);
void U_EMREXTTEXTOUTA_swap(char *record, int torev) {
  core8_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_EMREXTTEXTOUTA_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 <core8_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMREXTTEXTOUTA_swap>:
jmp    1030 <core8_swap@plt>

LLVM IR (-O0):
define void @U_EMREXTTEXTOUTA_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 @core8_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_EMREXTTEXTOUTA_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core8_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int inject(char *);
enum nss_status _nss_inject_gethostent_r(struct hostent *result, char *buffer,
                                         size_t buflen, int *errnop,
                                         int *h_errnop) {
  return inject("gethostent");
}


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

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

LLVM IR (-O0):
%struct.hostent = type { i32 }
@.str = [11 x i8] c"gethostent\00"
define i32 @_nss_inject_gethostent_r(%struct.hostent* %0, i8* %1, i64 %2, i32* %3, i32* %4) {
%6 = alloca %struct.hostent*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32*
store %struct.hostent* %0, %struct.hostent** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = call i32 @inject(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %11
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@.str = [11 x i8] c"gethostent\00"
define i32 @_nss_inject_gethostent_r(%struct.hostent* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32* nocapture readnone %3, i32* nocapture readnone %4) {
%6 = tail call i32 @inject(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %6
}
void delay_init(void) {}


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

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

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

LLVM IR (-O2):
define void @delay_init() {
ret void
}
/* Variables and functions */
int add(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int min, max, sum;
  scanf("%d%d", &min, &max);
  while (min <= max)
    sum = add(min++);
  printf("%d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1177 <main+0x47>
mov    -0x8(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1030 <add@plt>
mov    %eax,-0x10(%rbp)
jmp    1153 <main+0x23>
mov    -0x10(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1050 <scanf@plt>
mov    (%rsp),%edi
nopl   0x0(%rax,%rax,1)
lea    0x1(%rdi),%eax
mov    %eax,(%rsp)
call   1030 <add@plt>
mov    (%rsp),%edi
cmp    0x4(%rsp),%edi
jle    1150 <main+0x20>
lea    0xe97(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br label %9
9: ; preds = %0, %9
%10 = phi i32 [ %13, %9 ], [ %6, %0 ]
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = call i32 @add(i32 %10)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %9
16: ; preds = %9
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}
int digitsBaseTen(int x) {
  int digCount = 1;
  if (x < 0) {
    digCount = 2;
    x = -x;
  }
  while (x >= 10) {
    digCount += 1;
    x /= 10;
  }
  return digCount;
}


x86 assembly (clang, -O0):
<digitsBaseTen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1127 <digitsBaseTen+0x27>
movl   $0x2,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112c <digitsBaseTen+0x2c>
cmpl   $0xa,-0x4(%rbp)
jl     1152 <digitsBaseTen+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    112c <digitsBaseTen+0x2c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitsBaseTen>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x1f,%eax
add    $0x1,%eax
cmp    $0xa,%ecx
jb     1134 <digitsBaseTen+0x34>
mov    $0xcccccccd,%edx
nopl   0x0(%rax)
add    $0x1,%eax
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1120 <digitsBaseTen+0x20>
ret

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

LLVM IR (-O2):
define i32 @digitsBaseTen(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = sub nsw i32 0, %0
%4 = select i1 %2, i32 %3, i32 %0
%5 = select i1 %2, i32 2, i32 1
%6 = icmp ugt i32 %4, 9
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ %5, %1 ]
%9 = phi i32 [ %11, %7 ], [ %4, %1 ]
%10 = add nuw nsw i32 %8, 1
%11 = udiv i32 %9, 10
%12 = icmp ugt i32 %9, 99
br i1 %12, label %7, label %13
13: ; preds = %7, %1
%14 = phi i32 [ %5, %1 ], [ %10, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, int);
assert(int ln, _Bool b) {
  if (!b) {
    printf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/8l/ucc-c-compiler/refs/heads/master/test/"
           "other/sizeof.c"
           ":%d\n",
           ln);
    abort();
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
and    $0x1,%al
mov    %al,-0x9(%rbp)
testb  $0x1,-0x9(%rbp)
jne    1153 <assert+0x33>
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %esi,%esi
je     1125 <assert+0x5>
ret
push   %rax
mov    %edi,%eax
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/ucc-c-compiler/refs/heads/master/test/other/sizeof.c:%d\0A\00"
define i32 @assert(i32 %0, i1 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
%6 = zext i1 %1 to i8
store i8 %6, i8* %5
%7 = load i8, i8* %5
%8 = trunc i8 %7 to i1
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/ucc-c-compiler/refs/heads/master/test/other/sizeof.c:%d\0A\00"
define i32 @assert(i32 %0, i1 zeroext %1) {
br i1 %1, label %6, label %3
3: ; preds = %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret i32 undef
}
char hex2int(unsigned char hex) {
  unsigned char value = hex - '0';
  if (value > 9) {
    hex |= 0x20;
    value = hex - 'a' + 10;
    if (value < 10)
      value = 0xff;
  }
  if (value > 15)
    value = 0xff;
  return value;
}


x86 assembly (clang, -O0):
<hex2int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jle    114e <hex2int+0x4e>
movzbl -0x1(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1149 <hex2int+0x49>
movb   $0xff,-0x2(%rbp)
jmp    114e <hex2int+0x4e>
movzbl -0x2(%rbp),%eax
cmp    $0xf,%eax
jle    115f <hex2int+0x5f>
movb   $0xff,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2int>:
lea    -0x30(%rdi),%eax
or     $0x20,%dil
add    $0xa9,%dil
cmp    $0xa,%dil
movzbl %dil,%ecx
mov    $0xff,%edx
cmovb  %edx,%ecx
cmp    $0xa,%al
movzbl %al,%eax
cmovae %ecx,%eax
cmp    $0x10,%al
cmovae %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @hex2int(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = sub nsw i32 %5, 48
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sgt i32 %9, 9
br i1 %10, label %11, label %26
11: ; preds = %1
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = or i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = sub nsw i32 %17, 97
%19 = add nsw i32 %18, 10
%20 = trunc i32 %19 to i8
store i8 %20, i8* %3
%21 = load i8, i8* %3
%22 = zext i8 %21 to i32
%23 = icmp slt i32 %22, 10
br i1 %23, label %24, label %25
24: ; preds = %11
store i8 -1, i8* %3
br label %25
25: ; preds = %24, %11
br label %26
26: ; preds = %25, %1
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = icmp sgt i32 %28, 15
br i1 %29, label %30, label %31
30: ; preds = %26
store i8 -1, i8* %3
br label %31
31: ; preds = %30, %26
%32 = load i8, i8* %3
ret i8 %32
}

LLVM IR (-O2):
define signext i8 @hex2int(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ugt i8 %2, 9
%4 = or i8 %0, 32
%5 = add i8 %4, -87
%6 = icmp ult i8 %5, 10
%7 = select i1 %6, i8 -1, i8 %5
%8 = select i1 %3, i8 %7, i8 %2
%9 = icmp ugt i8 %8, 15
%10 = select i1 %9, i8 -1, i8 %8
ret i8 %10
}
struct param_d *dev_add_param_int(struct device_d *dev, const char *name,
                                  int (*set)(struct param_d *p, void *priv),
                                  int (*get)(struct param_d *p, void *priv),
                                  int *value, const char *format, void *priv) {
  return ((void *)0);
}


x86 assembly (clang, -O0):
<dev_add_param_int>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.param_d = type opaque
%struct.device_d = type opaque
define %struct.param_d* @dev_add_param_int(%struct.device_d* %0, i8* %1, i32 (%struct.param_d*, i8*)* %2, i32 (%struct.param_d*, i8*)* %3, i32* %4, i8* %5, i8* %6) {
%8 = alloca %struct.device_d*
%9 = alloca i8*
%10 = alloca i32 (%struct.param_d*, i8*)*
%11 = alloca i32 (%struct.param_d*, i8*)*
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i8*
store %struct.device_d* %0, %struct.device_d** %8
store i8* %1, i8** %9
store i32 (%struct.param_d*, i8*)* %2, i32 (%struct.param_d*, i8*)** %10
store i32 (%struct.param_d*, i8*)* %3, i32 (%struct.param_d*, i8*)** %11
store i32* %4, i32** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
ret %struct.param_d* null
}

LLVM IR (-O2):
%struct.param_d = type opaque
%struct.device_d = type opaque
define noalias %struct.param_d* @dev_add_param_int(%struct.device_d* nocapture readnone %0, i8* nocapture readnone %1, i32 (%struct.param_d*, i8*)* nocapture readnone %2, i32 (%struct.param_d*, i8*)* nocapture readnone %3, i32* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6) {
ret %struct.param_d* null
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, int);
void init_buffer(char *buffer) {
  memset(buffer, 0xff, 4096);
  buffer[0] = 0;
}


x86 assembly (clang, -O0):
<init_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xff,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_buffer>:
push   %rbx
mov    %rdi,%rbx
mov    $0xff,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
movb   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @init_buffer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memset(i8* %3, i32 255, i32 4096)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
ret void
}

LLVM IR (-O2):
define void @init_buffer(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 255, i32 4096)
store i8 0, i8* %0
ret void
}
int xmlUCSIsPhoneticExtensions(int code) {
  return (((code >= 0x1D00) && (code <= 0x1D7F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsPhoneticExtensions>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1d00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsPhoneticExtensions+0x26>
cmpl   $0x1d7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsPhoneticExtensions>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x1d00,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsPhoneticExtensions(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 7424
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void tsaf_set_pcrext(uint8_t *p_ts, uint16_t i_pcr_ext) {
  p_ts[10] |= (i_pcr_ext >> 8) & 0x1;
  p_ts[11] = i_pcr_ext & 0xff;
}


x86 assembly (clang, -O0):
<tsaf_set_pcrext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0x1,%ecx
mov    -0x8(%rbp),%rax
or     0x28(%rax),%ecx
mov    %ecx,0x28(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x2c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsaf_set_pcrext>:
movzbl %sil,%eax
shr    $0x8,%esi
and    $0x1,%esi
or     %esi,0x28(%rdi)
mov    %eax,0x2c(%rdi)
ret

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

LLVM IR (-O2):
define void @tsaf_set_pcrext(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 1
%5 = getelementptr inbounds i32, i32* %0, i64 10
%6 = load i32, i32* %5
%7 = or i32 %6, %4
store i32 %7, i32* %5
%8 = and i32 %1, 255
%9 = getelementptr inbounds i32, i32* %0, i64 11
store i32 %8, i32* %9
ret void
}
__attribute__((weak)) void matrix_time_between_scans(void) {}


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

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

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

LLVM IR (-O2):
define weak void @matrix_time_between_scans() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, linux!\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, linux!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int ft_iswhite(int c) {
  if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v' || c == '\f')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     1143 <ft_iswhite+0x43>
cmpl   $0x9,-0x8(%rbp)
je     1143 <ft_iswhite+0x43>
cmpl   $0xd,-0x8(%rbp)
je     1143 <ft_iswhite+0x43>
cmpl   $0xa,-0x8(%rbp)
je     1143 <ft_iswhite+0x43>
cmpl   $0xb,-0x8(%rbp)
je     1143 <ft_iswhite+0x43>
cmpl   $0xc,-0x8(%rbp)
jne    114f <ft_iswhite+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ft_iswhite+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_iswhite>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <ft_iswhite+0xe>
ret
cmp    $0x20,%edi
je     110d <ft_iswhite+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_iswhite(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 12, label %3
i32 11, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
extern int sfvfs_dir_del(const char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sfvfs_dir_del(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t __attribute__((weak)) lwm2m_get_local_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec;
}


x86 assembly (clang, -O0):
<lwm2m_get_local_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwm2m_get_local_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define weak i32 @lwm2m_get_local_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define weak i32 @lwm2m_get_local_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TOR_ISSPACE(char const);
int tor_strisspace(const char *s) {
  while (*s) {
    if (!TOR_ISSPACE(*s))
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<tor_strisspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <tor_strisspace+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <TOR_ISSPACE@plt>
cmp    $0x0,%eax
jne    114a <tor_strisspace+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <tor_strisspace+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <tor_strisspace+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tor_strisspace(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @TOR_ISSPACE(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _cp_error(char const *message, int ret) {
  fputs("cp"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_cp_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cp_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"cp: \00"
@stderr = global i32 0
define i32 @_cp_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"cp: \00"
@stderr = global i32 0
define i32 @_cp_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}