xunge/DecIR huggingface dataset:
/* Type definitions */
struct utsname {
  int dummy;
};

/* Variables and functions */
int uname(struct utsname *);
int haskell_uname(struct utsname *name) { return uname(name); }


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

x86 assembly (clang, -O2):
<haskell_uname>:
jmp    1030 <uname@plt>

LLVM IR (-O0):
%struct.utsname = type { i32 }
define i32 @haskell_uname(%struct.utsname* %0) {
%2 = alloca %struct.utsname*
store %struct.utsname* %0, %struct.utsname** %2
%3 = load %struct.utsname*, %struct.utsname** %2
%4 = call i32 @uname(%struct.utsname* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i32 @haskell_uname(%struct.utsname* nocapture %0) {
%2 = tail call i32 @uname(%struct.utsname* %0)
ret i32 %2
}
int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) { return 0; }


x86 assembly (clang, -O0):
<pwm_config>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pwm_device = type opaque
define i32 @pwm_config(%struct.pwm_device* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pwm_device*
%5 = alloca i32
%6 = alloca i32
store %struct.pwm_device* %0, %struct.pwm_device** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.pwm_device = type opaque
define i32 @pwm_config(%struct.pwm_device* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
f6(a) long a;
{
  int i;
  for (i = 0; i < 10; i++) {
    if (++a != 0)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    114d <f6+0x4d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     113a <f6+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <f6+0x54>
jmp    113f <f6+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <f6+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
xor    %eax,%eax
cmp    $0xffffffffffffffff,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @f6(i64 %0) {
%2 = icmp eq i64 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_standard_drop_variable_by_index(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(306, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_standard_drop_variable_by_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x132,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_standard_drop_variable_by_index>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x132,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_standard_drop_variable_by_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 306, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_standard_drop_variable_by_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 306, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned int foo2(unsigned int x, unsigned int y) {
  unsigned int z;
  if (x >= y)
    return 1;
  z = y - x;
  if (z == 0)
    abort();
  return z;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     1136 <foo2+0x26>
movl   $0x1,-0x4(%rbp)
jmp    1156 <foo2+0x46>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1150 <foo2+0x40>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
mov    $0x1,%eax
sub    %edi,%esi
jbe    111d <foo2+0xd>
mov    %esi,%eax
je     111e <foo2+0xe>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @foo2(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, %0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = sub i32 %1, %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %4, %2
%10 = phi i32 [ 1, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int jas_clrspc_numchans(int clrspc) {
  switch (((clrspc) >> 8)) {
  case 1:
  case 2:
  case 4:
  case 5:
    return 3;
    break;
  case 3:
    return 1;
    break;
  default:
    abort();
    break;
  }
}


x86 assembly (clang, -O0):
<jas_clrspc_numchans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     115a <jas_clrspc_numchans+0x4a>
jmp    1135 <jas_clrspc_numchans+0x25>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1166 <jas_clrspc_numchans+0x56>
jmp    1146 <jas_clrspc_numchans+0x36>
mov    -0xc(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x1,%eax
ja     1172 <jas_clrspc_numchans+0x62>
jmp    115a <jas_clrspc_numchans+0x4a>
movl   $0x3,-0x4(%rbp)
jmp    1179 <jas_clrspc_numchans+0x69>
movl   $0x1,-0x4(%rbp)
jmp    1179 <jas_clrspc_numchans+0x69>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jas_clrspc_numchans>:
push   %rax
sar    $0x8,%edi
add    $0xffffffff,%edi
cmp    $0x5,%edi
jae    112b <jas_clrspc_numchans+0x1b>
movslq %edi,%rax
lea    0xeda(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @jas_clrspc_numchans(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 8
switch i32 %5, label %8 [
i32 1, label %6
i32 2, label %6
i32 4, label %6
i32 5, label %6
i32 3, label %7
]
6: ; preds = %1, %1, %1, %1
store i32 3, i32* %2
br label %10
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.jas_clrspc_numchans = [5 x i32] [i32 3, i32 3, i32 1, i32 3, i32 3]
define i32 @jas_clrspc_numchans(i32 %0) {
%2 = ashr i32 %0, 8
%3 = add nsw i32 %2, -1
%4 = icmp ult i32 %3, 5
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.jas_clrspc_numchans, i64 0, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ jenkins_hash_byte_ori(char *, int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
uint32_t jenkins_hash_string_ori(char *s, uint32_t seed) {
  uint32_t n;
  n = strlen(s);
  return jenkins_hash_byte_ori(s, n, seed);
}


x86 assembly (clang, -O0):
<jenkins_hash_string_ori>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <jenkins_hash_byte_ori@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jenkins_hash_string_ori>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <jenkins_hash_byte_ori@plt>

LLVM IR (-O0):
define i32 @jenkins_hash_string_ori(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @jenkins_hash_byte_ori(i8* %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @jenkins_hash_string_ori(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @jenkins_hash_byte_ori(i8* %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("The answer is %d.\n", foo());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"The answer is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"The answer is %d.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: sgrax command arg1 [arg2 ..]", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: sgrax command arg1 [arg2 ..]\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: sgrax command arg1 [arg2 ..]\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0;
  printf("i++: %d\n", i++);
  i = 0;
  printf("++i: %d\n", ++i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
lea    0xeb5(%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
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"i++: %d\0A\00"
@.str.1 = [9 x i8] c"++i: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FreeChar1D(char *);
int /*<<< orphan*/ free(void *);
void FreeChar2D(char **s, int size) {
  int i;
  if (!s)
    return;
  for (i = 0; i < size; i++)
    FreeChar1D(s[i]);
  free((void *)s);
  return;
}


x86 assembly (clang, -O0):
<FreeChar2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113f <FreeChar2D+0x1f>
jmp    117a <FreeChar2D+0x5a>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1171 <FreeChar2D+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <FreeChar1D@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <FreeChar2D+0x26>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeChar2D>:
test   %rdi,%rdi
je     115f <FreeChar2D+0x3f>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1152 <FreeChar2D+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1040 <FreeChar1D@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <FreeChar2D+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @FreeChar2D(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @FreeChar1D(i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
%16 = bitcast i8** %0 to i8*
%17 = tail call i32 @free(i8* %16)
br label %18
18: ; preds = %2, %15
ret void
}
int copyLSB(int n) { return ((n & 1) << 8) + (-1); }


x86 assembly (clang, -O0):
<copyLSB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x8,%eax
add    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyLSB>:
and    $0x1,%edi
shl    $0x8,%edi
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @copyLSB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = shl i32 %4, 8
%6 = add nsw i32 %5, -1
ret i32 %6
}

LLVM IR (-O2):
define i32 @copyLSB(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, 256
%4 = add nsw i32 %3, -1
ret i32 %4
}
int func15() {
#pragma critTer : 58 :../../ test / resources / functionNumber.c:
  return 0;
#pragma critTer : 59 :../../ test / resources / functionNumber.c:
}


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

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

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

LLVM IR (-O2):
define i32 @func15() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
void fgetc_257_good(FILE *f) {
  int arr[257];
  int c = fgetc(f);
  arr[c + 1] = 42;
}


x86 assembly (clang, -O0):
<fgetc_257_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x414(%rbp)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x2a,-0x410(%rbp,%rax,4)
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc_257_good>:
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
define void @fgetc_257_good(i32* %0) {
%2 = alloca i32*
%3 = alloca [257 x i32]
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [257 x i32], [257 x i32]* %3, i64 0, i64 %9
store i32 42, i32* %10
ret void
}

LLVM IR (-O2):
define void @fgetc_257_good(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
char *strdate(time_t t) {
  static char buf[256];
  struct tm *tm = localtime(&t);
  strftime(buf, sizeof(buf), "%Y%m%d%H%M%S00%z", tm);
  return buf;
}


x86 assembly (clang, -O0):
<strdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2efd(%rip),%rdi
mov    $0x100,%esi
lea    0xeb1(%rip),%rdx
call   1040 <strftime@plt>
lea    0x2ee5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdate>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2f06(%rip),%rbx
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@strdate.buf = internal global [256 x i8] zeroinitializer
@.str = [17 x i8] c"%Y%m%d%H%M%S00%z\00"
define i8* @strdate(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store i32 %0, i32* %2
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %3
%5 = load %struct.tm*, %struct.tm** %3
%6 = call i32 @strftime(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @strdate.buf, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @strdate.buf, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@strdate.buf = internal global [256 x i8] zeroinitializer
@.str = [17 x i8] c"%Y%m%d%H%M%S00%z\00"
define i8* @strdate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @localtime(i32* %2)
%4 = call i32 @strftime(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @strdate.buf, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @strdate.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char *);
void sep(void) { uart_puts(","); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
define void @sep() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void tail(int *array, int length) {
  int *tailarray = *array + 1;
  int i;
  for (i = 0; i < length - 1; i++) {
    printf("tailarray[%d] is %d \n", i, tailarray[i]);
  }
}


x86 assembly (clang, -O0):
<tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1170 <tail+0x60>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1135 <tail+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tail>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     114a <tail+0x3a>
mov    %esi,%r15d
movslq (%rdi),%r12
add    $0xffffffff,%r15d
lea    0xed2(%rip),%r14
xor    %ebx,%ebx
mov    0x1(%r12,%rbx,4),%edx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <tail+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"tailarray[%d] is %d \0A\00"
define void @tail(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
store i32 0, i32* %6
br label %12
12: ; preds = %25, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %28
17: ; preds = %12
%18 = load i32, i32* %6
%19 = load i32*, i32** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %23)
br label %25
25: ; preds = %17
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %12
28: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"tailarray[%d] is %d \0A\00"
define void @tail(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = icmp sgt i32 %1, 1
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = add nsw i32 %1, -1
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %8, %11
%12 = phi i64 [ 0, %8 ], [ %17, %11 ]
%13 = getelementptr inbounds i32, i32* %6, i64 %12
%14 = load i32, i32* %13
%15 = trunc i64 %12 to i32
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %14)
%17 = add nuw nsw i64 %12, 1
%18 = icmp eq i64 %17, %10
br i1 %18, label %19, label %11
19: ; preds = %11, %2
ret void
}
/* Type definitions */
struct dumperinfo {
  int dummy;
};

/* Variables and functions */
int dumpsys_generic(struct dumperinfo *);
int dumpsys(struct dumperinfo *di) { return (dumpsys_generic(di)); }


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

x86 assembly (clang, -O2):
<dumpsys>:
jmp    1030 <dumpsys_generic@plt>

LLVM IR (-O0):
%struct.dumperinfo = type { i32 }
define i32 @dumpsys(%struct.dumperinfo* %0) {
%2 = alloca %struct.dumperinfo*
store %struct.dumperinfo* %0, %struct.dumperinfo** %2
%3 = load %struct.dumperinfo*, %struct.dumperinfo** %2
%4 = call i32 @dumpsys_generic(%struct.dumperinfo* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.dumperinfo = type { i32 }
define i32 @dumpsys(%struct.dumperinfo* %0) {
%2 = tail call i32 @dumpsys_generic(%struct.dumperinfo* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
void curses_refresh() { refresh(); }


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

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

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

LLVM IR (-O2):
define void @curses_refresh() {
%1 = tail call i32 (...) @refresh()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime_s(int /*<<< orphan*/ const *, struct tm *);
struct tm *localtime_r(const time_t *timep, struct tm *result) {
  return localtime_s(timep, result);
}


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

x86 assembly (clang, -O2):
<localtime_r>:
jmp    1030 <localtime_s@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca i32*
%4 = alloca %struct.tm*
store i32* %0, i32** %3
store %struct.tm* %1, %struct.tm** %4
%5 = load i32*, i32** %3
%6 = load %struct.tm*, %struct.tm** %4
%7 = call %struct.tm* @localtime_s(i32* %5, %struct.tm* %6)
ret %struct.tm* %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* %1) {
%3 = tail call %struct.tm* @localtime_s(i32* %0, %struct.tm* %1)
ret %struct.tm* %3
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double SDRandom(void) { return (rand() / (double)RAND_MAX); }


x86 assembly (clang, -O0):
<SDRandom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDRandom>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @SDRandom() {
%1 = call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @SDRandom() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ create_connect();
void lib_create_connect() { create_connect(); }


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

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

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

LLVM IR (-O2):
define void @lib_create_connect() {
%1 = tail call i32 (...) @create_connect()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(char *, char *, int);
void *memmove(void *s1, void *s2, int n) {
  bcopy((char *)s2, (char *)s1, n);
  return s1;
}


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

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

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

LLVM IR (-O2):
define i8* @memmove(i8* returned writeonly %0, i8* nocapture %1, i32 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* align 1 %0, i8* align 1 %1, i32 %2, i1 false)
ret i8* %0
}
long int clamp_rgb(long int x) {
  if (x < 0)
    x = 0;
  else if (x >= (long int)0x40000000)
    x = (long int)0x40000000 - 1;
  return (x >> (30 - 8));
}


x86 assembly (clang, -O0):
<clamp_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1120 <clamp_rgb+0x20>
movq   $0x0,-0x8(%rbp)
jmp    113b <clamp_rgb+0x3b>
cmpq   $0x40000000,-0x8(%rbp)
40
jl     1136 <clamp_rgb+0x36>
movq   $0x3fffffff,-0x8(%rbp)
3f
jmp    113b <clamp_rgb+0x3b>
mov    -0x8(%rbp),%rax
sar    $0x16,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_rgb>:
cmp    $0x3fffffff,%rdi
mov    $0x3fffffff,%ecx
cmovl  %rdi,%rcx
sar    $0x16,%rcx
xor    %eax,%eax
test   %rdi,%rdi
cmovns %rcx,%rax
ret

LLVM IR (-O0):
define i64 @clamp_rgb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i64 0, i64* %2
br label %11
6: ; preds = %1
%7 = load i64, i64* %2
%8 = icmp sge i64 %7, 1073741824
br i1 %8, label %9, label %10
9: ; preds = %6
store i64 1073741823, i64* %2
br label %10
10: ; preds = %9, %6
br label %11
11: ; preds = %10, %5
%12 = load i64, i64* %2
%13 = ashr i64 %12, 22
ret i64 %13
}

LLVM IR (-O2):
define i64 @clamp_rgb(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = icmp slt i64 %0, 1073741823
%4 = select i1 %3, i64 %0, i64 1073741823
%5 = ashr i64 %4, 22
%6 = select i1 %2, i64 0, i64 %5
ret i64 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int _strnlen(const char *s, uint32_t maxlen) {
  int i = 0;
  while (s[i++] && i < maxlen)
    ;
  return i;
}


x86 assembly (clang, -O0):
<_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1142 <_strnlen+0x42>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1152 <_strnlen+0x52>
jmp    1157 <_strnlen+0x57>
jmp    1112 <_strnlen+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strnlen>:
movslq %esi,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
je     111f <_strnlen+0x1f>
cmp    %rcx,%rax
jl     1110 <_strnlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @_strnlen(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %6, %4 ], [ 0, %2 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
%10 = icmp slt i64 %6, %3
%11 = select i1 %9, i1 %10, i1 false
br i1 %11, label %4, label %12
12: ; preds = %4
%13 = trunc i64 %6 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
int /*<<< orphan*/ puts(char *);
int main() {
  float iq[] = {90.365, 94.365};
  int coleg;
  puts("IQ results...\n\n");
  for (coleg = 0; coleg < 2; coleg++)
    printf("Colegul # %d - %f.\n", coleg, iq[coleg]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    117e <main+0x5e>
mov    -0x10(%rbp),%esi
movslq -0x10(%rbp),%rax
movss  -0xc(%rbp,%rax,4),%xmm0
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rbx
movss  0xec4(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
movss  0xeb6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.iq = [2 x float] [float 0x4056975C20000000, float 0x4057975C20000000]
@.str = [16 x i8] c"IQ results...\0A\0A\00"
@.str.1 = [20 x i8] c"Colegul # %d - %f.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x float]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [2 x float]* %2 to i8*
%5 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 %12
%14 = load float, float* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %10, float %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"IQ results...\0A\0A\00"
@.str.1 = [20 x i8] c"Colegul # %d - %f.\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0, float 0x4056975C20000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 1, float 0x4057975C20000000)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int read(int, int /*<<< orphan*/ *, int);
int read_noblock_l(int fd, int8_t *buf, int bytes) {
  int ret = 0;
  ret = read(fd, buf, bytes);
  return ret;
}


x86 assembly (clang, -O0):
<read_noblock_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_noblock_l>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @read_noblock_l(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i32* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @read_noblock_l(i32 %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ guilddb_sql_delete(int);
int /*<<< orphan*/ interlog_log_sql(char *, int);
int mapif_parse_BreakGuild(int fd, int guild_id) {
  guilddb_sql_delete(guild_id);
  interlog_log_sql("guild (id=%d) broken", guild_id);
  return 0;
}


x86 assembly (clang, -O0):
<mapif_parse_BreakGuild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <guilddb_sql_delete@plt>
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1040 <interlog_log_sql@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_parse_BreakGuild>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
call   1030 <guilddb_sql_delete@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
call   1040 <interlog_log_sql@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"guild (id=%d) broken\00"
define i32 @mapif_parse_BreakGuild(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 = call i32 @guilddb_sql_delete(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @interlog_log_sql(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"guild (id=%d) broken\00"
define i32 @mapif_parse_BreakGuild(i32 %0, i32 %1) {
%3 = tail call i32 @guilddb_sql_delete(i32 %1)
%4 = tail call i32 @interlog_log_sql(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int format_devices(char **, int, int /*<<< orphan*/);
int format_for_jbod(char **args, int num_args) {
  return format_devices(args, num_args, 0);
}


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

x86 assembly (clang, -O2):
<format_for_jbod>:
xor    %edx,%edx
jmp    1030 <format_devices@plt>

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

LLVM IR (-O2):
define i32 @format_for_jbod(i8** %0, i32 %1) {
%3 = tail call i32 @format_devices(i8** %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar(short *);
int __attribute__((no)) f2(int i) {
  short a[i * 2 + 7];
  bar(a);
  return a[i + 4];
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
lea    0x7(%rax,%rax,1),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(%rax,%rax,1),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <bar@plt>
mov    -0x20(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movswl (%rax,%rcx,2),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %edi,%r14d
lea    (%r14,%r14,1),%eax
add    $0x7,%eax
add    %rax,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <bar@plt>
movslq %r14d,%rax
movswl 0x8(%rbx,%rax,2),%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
%7 = add nsw i32 %6, 7
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i16, i64 %8
store i64 %8, i64* %4
%11 = call i32 @bar(i16* %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i16, i16* %10, i64 %14
%16 = load i16, i16* %15
%17 = sext i16 %16 to i32
%18 = load i8*, i8** %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 7
%4 = zext i32 %3 to i64
%5 = alloca i16, i64 %4
%6 = call i32 @bar(i16* %5)
%7 = add nsw i32 %0, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i16, i16* %5, i64 %8
%10 = load i16, i16* %9
%11 = sext i16 %10 to i32
ret i32 %11
}
long sys_futex0(int *addr, long op, long val) {
  long res;
  __asm volatile("syscall"
                 : "=a"(res)
                 : "0"(202), "D"(addr), "S"(op), "d"(val)
                 : "r11", "rcx", "memory");
  return res;
}


x86 assembly (clang, -O0):
<sys_futex0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xca,%eax
syscall
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_futex0>:
mov    $0xca,%eax
syscall
ret

LLVM IR (-O0):
define i64 @sys_futex0(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i32*, i32** %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 202, i32* %8, i64 %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @sys_futex0(i32* %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 202, i32* %0, i64 %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void do_error(char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<do_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<do_error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @do_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @do_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *malloc(long);
void *edit_malloc(long in_size, int in_zone) {
  void *mem = malloc(in_size);
  return mem;
}


x86 assembly (clang, -O0):
<edit_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edit_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @edit_malloc(i64 %0, i32 %1) {
%3 = tail call i8* @malloc(i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xe6() {
  Assert_real((isascii(230) == 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_isascii.c",
              1155, ("isascii should be 0 for 0xe6"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xe6>:
push   %rax
mov    $0xe6,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x483,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe6\00"
define void @t_isascii_0xe6() {
%1 = call i64 @isascii(i32 230)
%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 1155, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe6\00"
define void @t_isascii_0xe6() {
%1 = tail call i64 @isascii(i32 230)
%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 1155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int addTTyMode(void *sg, const char *mode) { return -1; }


x86 assembly (clang, -O0):
<addTTyMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @addTTyMode(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}