xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t intrev(int32_t i) {
  int32_t rev = 0;
  while (i) {
    rev *= 10;
    rev += (i % 10);
    i /= 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<intrev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <intrev+0x43>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <intrev+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intrev>:
xor    %eax,%eax
test   %edi,%edi
je     113f <intrev+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <intrev+0x10>
ret

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

LLVM IR (-O2):
define i32 @intrev(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void deny() {
  printf("\nWelcome to VHFFS plaform\n\n");
  printf("This is a restricted Shell Account\n");
  printf("You cannot execute anything here.\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<deny>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<deny>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\0AWelcome to VHFFS plaform\0A\0A\00"
@.str.1 = [36 x i8] c"This is a restricted Shell Account\0A\00"
@.str.2 = [36 x i8] c"You cannot execute anything here.\0A\0A\00"
define void @deny() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [27 x i8] c"\0AWelcome to VHFFS plaform\0A\00"
@str.3 = [35 x i8] c"This is a restricted Shell Account\00"
@str.4 = [35 x i8] c"You cannot execute anything here.\0A\00"
define void @deny() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int f449(int *);
int f450(int *p) { return f449(p); }


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

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

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

LLVM IR (-O2):
define i32 @f450(i32* %0) {
%2 = tail call i32 @f449(i32* %0)
ret i32 %2
}
/* Type definitions */
struct S_BB_LOCAL {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct S_BB_LOCAL *);
void bb_local_delete(struct S_BB_LOCAL *local) { free(local); }


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

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

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

LLVM IR (-O2):
%struct.S_BB_LOCAL = type { i32 }
define void @bb_local_delete(%struct.S_BB_LOCAL* nocapture %0) {
%2 = tail call i32 @free(%struct.S_BB_LOCAL* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_dex();
void e_dex_accu() { e_dex(); }


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

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

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

LLVM IR (-O2):
define void @e_dex_accu() {
%1 = tail call i32 (...) @e_dex()
ret void
}
int fun645() { return 645; }


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

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

LLVM IR (-O0):
define i32 @fun645() {
ret i32 645
}

LLVM IR (-O2):
define i32 @fun645() {
ret i32 645
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t getProtoOutput(uint8_t *data) { return (data[0] >> 5) & 0x07; }


x86 assembly (clang, -O0):
<getProtoOutput>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x5,%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getProtoOutput>:
mov    (%rdi),%eax
shr    $0x5,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @getProtoOutput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = ashr i32 %5, 5
%7 = and i32 %6, 7
ret i32 %7
}

LLVM IR (-O2):
define i32 @getProtoOutput(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 5
%4 = and i32 %3, 7
ret i32 %4
}
int __VERIFIER_nondet_int() {
  int i;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @__VERIFIER_nondet_int() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_int() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ strcmp(void const *, void const *);
int _dictStringCopyHTKeyCompare(void *privdata, const void *key1,
                                const void *key2) {
  ((void)privdata);
  return strcmp(key1, key2) == 0;
}


x86 assembly (clang, -O0):
<_dictStringCopyHTKeyCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dictStringCopyHTKeyCompare>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_dictStringCopyHTKeyCompare(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_dictStringCopyHTKeyCompare(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %1, i8* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ ctime_r(int /*<<< orphan*/ const *, char *);
char *strchr(char *, char);
char *ytht_ctime_r(const time_t clock, char *buf) {
  char *tmp;
  ctime_r(&clock, buf);
  tmp = strchr(buf, '\n');
  if (NULL != tmp)
    *tmp = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<ytht_ctime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
call   1040 <ctime_r@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
je     1161 <ytht_ctime_r+0x41>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ytht_ctime_r>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <ctime_r@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     114b <ytht_ctime_r+0x2b>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ytht_ctime_r(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @ctime_r(i32* %3, i8* %6)
%8 = load i8*, i8** %4
%9 = call i8* @strchr(i8* %8, i8 signext 10)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* null, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %5
store i8 0, i8* %13
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @ytht_ctime_r(i32 %0, i8* returned %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @ctime_r(i32* %3, i8* %1)
%5 = call i8* @strchr(i8* dereferenceable(1) %1, i8 signext 10)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
store i8 0, i8* %5
br label %8
8: ; preds = %7, %2
ret i8* %1
}
const char *proginfo_name(void) { return "ordoprep"; }


x86 assembly (clang, -O0):
<proginfo_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proginfo_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"ordoprep\00"
define i8* @proginfo_name() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"ordoprep\00"
define i8* @proginfo_name() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ isspace(char);
void eatWhitespace(char **at) {
  while (**at && isspace(**at)) {
    ++(*at);
  }
}


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

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

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

LLVM IR (-O2):
define void @eatWhitespace(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i8 [ %12, %9 ], [ %3, %1 ]
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = load i8*, i8** %0
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %0
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void w_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @w_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void tcp_initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @tcp_initialize() {
ret void
}
void console_set_by_of(void) {}


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

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

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

LLVM IR (-O2):
define void @console_set_by_of() {
ret void
}
void dump_points(int **vals, int rows, int cols) {
  int i, j;
  for (i = 0; i < rows; i++) {
    for (j = 0; j < cols; j++) {
      ;
    };
  }
}


x86 assembly (clang, -O0):
<dump_points>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <dump_points+0x5a>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1147 <dump_points+0x47>
jmp    1139 <dump_points+0x39>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <dump_points+0x28>
jmp    114c <dump_points+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <dump_points+0x15>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dump_points(i32** nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int cbmarch_iec_get(int f, int line) {
  return (ioctl(f, _IO(0xcb, 12)) & line) != 0;
}


x86 assembly (clang, -O0):
<cbmarch_iec_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xcb,%edi
mov    $0xc,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_iec_get>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xcb,%edi
mov    $0xc,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cbmarch_iec_get(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @_IO(i32 203, i32 12)
%7 = call i32 @ioctl(i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @cbmarch_iec_get(i32 %0, i32 %1) {
%3 = tail call i32 @_IO(i32 203, i32 12)
%4 = tail call i32 @ioctl(i32 %0, i32 %3)
%5 = and i32 %4, %1
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void clear_segments() { *(volatile unsigned *)(0xBF800000 + (0x86108)) = 0xff; }


x86 assembly (clang, -O0):
<clear_segments>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf886108,%eax
movl   $0xff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_segments>:
mov    $0xbf886108,%eax
movl   $0xff,(%rax)
ret

LLVM IR (-O0):
define void @clear_segments() {
store volatile i32 255, i32* inttoptr (i64 3213385992 to i32*)
ret void
}

LLVM IR (-O2):
define void @clear_segments() {
store volatile i32 255, i32* inttoptr (i64 3213385992 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void merge_sort(int a[], int start, int end) {
  int middle;
  if (end > start) {
    middle = (start + end) / 2;
    merge_sort(a, start, middle);
    merge_sort(a, middle + 1, end);
    merge(a, start, middle, end);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1182 <merge_sort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    %esi,%edx
jle    1172 <merge_sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <merge_sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <merge_sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

LLVM IR (-O0):
define void @merge_sort(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
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @merge_sort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @merge_sort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rand(int, int);
void main() {
  int a = rand(1, 3);
  int b = rand(0, 6);
  int c;
  if (a + b >= 8) {
    c = b - a;
    assert(b >= 5 && a >= 2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x8,%eax
jl     1187 <main+0x67>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x5,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jl     117a <main+0x5a>
cmpl   $0x2,-0x4(%rbp)
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <rand@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <rand@plt>
lea    (%rax,%rbx,1),%ecx
cmp    $0x8,%ecx
jl     115d <main+0x3d>
cmp    $0x5,%eax
setge  %al
cmp    $0x2,%ebx
setge  %cl
and    %al,%cl
movzbl %cl,%edi
pop    %rbx
jmp    1030 <assert@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @rand(i32 1, i32 3)
%2 = tail call i32 @rand(i32 0, i32 6)
%3 = add nsw i32 %2, %1
%4 = icmp sgt i32 %3, 7
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = icmp sgt i32 %2, 4
%7 = icmp sgt i32 %1, 1
%8 = select i1 %6, i1 %7, i1 false
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
br label %11
11: ; preds = %5, %0
ret void
}
void encodeDmaLoadPeri(void) {}


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

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

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

LLVM IR (-O2):
define void @encodeDmaLoadPeri() {
ret void
}
void makeOperand(char c, unsigned int operand) {
  operand = (operand * 10) + (c - '0');
}


x86 assembly (clang, -O0):
<makeOperand>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @makeOperand(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul i32 %5, 10
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
%10 = add i32 %6, %9
store i32 %10, i32* %4
ret void
}

LLVM IR (-O2):
define void @makeOperand(i8 signext %0, i32 %1) {
ret void
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
scalar_t__ EINVAL;
int /*<<< orphan*/ RLIMIT_NPROC;
int /*<<< orphan*/ abort();
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  struct rlimit lim;
  if (getrlimit(RLIMIT_NPROC, &lim) != -1 || errno != EINVAL)
    abort();
  printf("pass\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1060 <getrlimit@plt>
cmp    $0xffffffff,%eax
jne    1184 <main+0x44>
mov    0x2e67(%rip),%rax
mov    (%rax),%rax
mov    0x2e55(%rip),%rcx
cmp    (%rcx),%rax
je     118b <main+0x4b>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1060 <getrlimit@plt>
cmp    $0xffffffff,%eax
jne    1180 <main+0x40>
mov    0x2e7a(%rip),%rax
mov    (%rax),%rax
mov    0x2e68(%rip),%rcx
cmp    (%rcx),%rax
jne    1180 <main+0x40>
lea    0xe8c(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_NPROC = global i32 0
@errno = global i64 0
@EINVAL = global i64 0
@.str = [6 x i8] c"pass\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rlimit
store i32 0, i32* %1
%3 = load i32, i32* @RLIMIT_NPROC
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %2)
%5 = icmp ne i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINVAL
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %6, %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %6
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_NPROC = global i32 0
@errno = global i64 0
@EINVAL = global i64 0
@str = [5 x i8] c"pass\00"
define i32 @main() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_NPROC
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINVAL
%9 = icmp eq i64 %7, %8
br i1 %9, label %12, label %10
10: ; preds = %6, %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %6
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ DefDriverProcedure(int);
int32_t DefCanSetOptions(char *options) {
  DefDriverProcedure(1);
  return (0);
}


x86 assembly (clang, -O0):
<DefCanSetOptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <DefDriverProcedure@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @DefCanSetOptions(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @DefDriverProcedure(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @DefCanSetOptions(i8* nocapture readnone %0) {
%2 = tail call i32 @DefDriverProcedure(i32 1)
ret i32 0
}
/* Variables and functions */
int SHA256_HashBuf(unsigned char *, unsigned char *, unsigned long long);
SHA256_NSS(unsigned char *in, unsigned char *out, unsigned long long inlen) {
  return SHA256_HashBuf(out, in, inlen);
}


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

x86 assembly (clang, -O2):
<SHA256_NSS>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <SHA256_HashBuf@plt>

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

LLVM IR (-O2):
define i32 @SHA256_NSS(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @SHA256_HashBuf(i8* %1, i8* %0, i64 %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ is_user_module_valid();
int /*<<< orphan*/ module_user_setup();
void setup() {
  if (is_user_module_valid()) {
    module_user_setup();
  }
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_user_module_valid@plt>
cmp    $0x0,%rax
je     113c <setup+0x1c>
mov    $0x0,%al
call   1040 <module_user_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
xor    %eax,%eax
call   1030 <is_user_module_valid@plt>
test   %rax,%rax
je     1135 <setup+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <module_user_setup@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @setup() {
%1 = call i64 (...) @is_user_module_valid()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @module_user_setup()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i64 (...) @is_user_module_valid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @module_user_setup()
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void inc_counter(uint8_t *counter) {
  uint32_t n = 16;
  uint8_t c;
  do {
    --n;
    c = counter[n];
    ++c;
    counter[n] = c;
    if (c)
      return;
  } while (n);
}


x86 assembly (clang, -O0):
<inc_counter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
cmpq   $0x0,-0x18(%rbp)
je     1154 <inc_counter+0x54>
jmp    1163 <inc_counter+0x63>
jmp    1159 <inc_counter+0x59>
cmpl   $0x0,-0xc(%rbp)
jne    110f <inc_counter+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_counter>:
mov    $0x78,%eax
cs nopw 0x0(%rax,%rax,1)
nop
addq   $0x1,(%rdi,%rax,1)
jne    1123 <inc_counter+0x23>
lea    -0x8(%rax),%rcx
test   %rax,%rax
mov    %rcx,%rax
jne    1110 <inc_counter+0x10>
ret

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

LLVM IR (-O2):
define void @inc_counter(i64* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 16, %1 ]
%4 = add nsw i64 %3, -1
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = add nsw i64 %6, 1
store i64 %7, i64* %5
%8 = icmp ne i64 %7, 0
%9 = icmp eq i64 %4, 0
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %11, label %2
11: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int array_sum(int array[], const int n);
  int values[] = {3, 7, -9, 3, 6, -1, 7, 9, 1, -5};
  printf("The sum is %i\n", array_sum(values, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <array_sum@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <array_sum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.values = [10 x i32] [i32 3, i32 7, i32 -9, i32 3, i32 6, i32 -1, i32 7, i32 9, i32 1, i32 -5]
@.str = [15 x i8] c"The sum is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @array_sum(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.values = [10 x i32] [i32 3, i32 7, i32 -9, i32 3, i32 6, i32 -1, i32 7, i32 9, i32 1, i32 -5]
@.str = [15 x i8] c"The sum is %i\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @array_sum(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int SIGWINCH;
int /*<<< orphan*/ redraw_all();
int /*<<< orphan*/ signal(int, void (*)(int));
void handle_signal(int signum) {
  if (signum == SIGWINCH)
    redraw_all();
  signal(signum, (void (*)(int))handle_signal);
}


x86 assembly (clang, -O0):
<handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    1144 <handle_signal+0x24>
mov    $0x0,%al
call   1040 <redraw_all@plt>
mov    -0x4(%rbp),%edi
mov    0x2e8a(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_signal>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
cmp    %edi,(%rax)
jne    1135 <handle_signal+0x15>
xor    %eax,%eax
call   1040 <redraw_all@plt>
mov    0x2e9c(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGWINCH = global i32 0
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGWINCH
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @redraw_all()
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = call i32 @signal(i32 %9, void (i32)* @handle_signal)
ret void
}

LLVM IR (-O2):
@SIGWINCH = global i32 0
define void @handle_signal(i32 %0) {
%2 = load i32, i32* @SIGWINCH
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @redraw_all()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @signal(i32 %0, void (i32)* @handle_signal)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Minimalistic STUN client ver.%s\n", "0.1");
  fprintf(stderr,
          "Usage: %s [-p port] [-l localport] [-c count] [-d] stun_server "
          "[local_address]\n",
          "ministun");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
lea    0xeee(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xf26(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
lea    0xef9(%rip),%rdx
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeef(%rip),%rsi
lea    0xf38(%rip),%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Minimalistic STUN client ver.%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [80 x i8] c"Usage: %s [-p port] [-l localport] [-c count] [-d] stun_server [local_address]\0A\00"
@.str.3 = [9 x i8] c"ministun\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Minimalistic STUN client ver.%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [80 x i8] c"Usage: %s [-p port] [-l localport] [-c count] [-d] stun_server [local_address]\0A\00"
@.str.3 = [9 x i8] c"ministun\00"
define void @usage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void f(int dim, double *x, double *fx) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, double* nocapture %1, double* nocapture %2) {
ret void
}
/* Type definitions */
struct termp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ term_free(struct termp *);
void ascii_free(void *arg) { term_free((struct termp *)arg); }


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

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

LLVM IR (-O0):
%struct.termp = type { i32 }
define void @ascii_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.termp*
%5 = call i32 @term_free(%struct.termp* %4)
ret void
}

LLVM IR (-O2):
%struct.termp = type { i32 }
define void @ascii_free(i8* %0) {
%2 = bitcast i8* %0 to %struct.termp*
%3 = tail call i32 @term_free(%struct.termp* %2)
ret void
}
/* Type definitions */
typedef scalar_t__ ippdu;

/* Variables and functions */
unsigned int ip_compute_checksum(unsigned char *, int);
void ip_update_checksum(unsigned char *ippdu) {
  unsigned int cs;
  cs = ip_compute_checksum(ippdu, 4 * (*(unsigned char *)(ippdu)&0x0F));
  *((unsigned char *)(ippdu) + 10) = (unsigned char)((cs >> 8) & 0xFF);
  *((unsigned char *)(ippdu) + 11) = (unsigned char)(cs & 0xFF);
}


x86 assembly (clang, -O0):
<ip_update_checksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
and    $0xf,%esi
shl    $0x2,%esi
call   1030 <ip_compute_checksum@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xa(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xb(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_update_checksum>:
push   %rbx
mov    %rdi,%rbx
movzbl (%rdi),%esi
shl    $0x2,%esi
and    $0x3c,%esi
call   1030 <ip_compute_checksum@plt>
rol    $0x8,%ax
mov    %ax,0xa(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ip_update_checksum(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %7, 15
%9 = mul nsw i32 4, %8
%10 = call i32 @ip_compute_checksum(i8* %4, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = lshr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 10
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 11
store i8 %19, i8* %21
ret void
}

LLVM IR (-O2):
define void @ip_update_checksum(i8* %0) {
%2 = load i8, i8* %0
%3 = shl i8 %2, 2
%4 = and i8 %3, 60
%5 = zext i8 %4 to i32
%6 = tail call i32 @ip_compute_checksum(i8* %0, i32 %5)
%7 = lshr i32 %6, 8
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %8, i8* %9
%10 = trunc i32 %6 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 11
store i8 %10, i8* %11
ret void
}
int get_ret_code(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @get_ret_code() {
ret i32 42
}

LLVM IR (-O2):
define i32 @get_ret_code() {
ret i32 42
}
void ERR_peek_last_error_line_data(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_peek_last_error_line_data() {
ret void
}
/* Variables and functions */
int fcntl(int, int, void *);
extern int _swift_Platform_fcntlPtr(int fd, int cmd, void *ptr) {
  return fcntl(fd, cmd, ptr);
}


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

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

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

LLVM IR (-O2):
define i32 @_swift_Platform_fcntlPtr(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i8* %2)
ret i32 %4
}
void band_constant_Good() {
  char a[2];
  int x = (-3) & 1;
  a[x] = 0;
}


x86 assembly (clang, -O0):
<band_constant_Good>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movb   $0x0,-0x2(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @band_constant_Good() {
%1 = alloca [2 x i8]
%2 = alloca i32
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 %4
store i8 0, i8* %5
ret void
}

LLVM IR (-O2):
define void @band_constant_Good() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int **, int **);
void testTortureExecute(void) {
  int a;
  int *p1 = &a, *p2 = &a;
  foo(&p1, &p2);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rax
mov    %rax,0x8(%rsp)
mov    %rax,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <foo@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32* %1, i32** %2
store i32* %1, i32** %3
%4 = call i32 @foo(i32** %2, i32** %3)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%6 = bitcast i32** %3 to i8*
store i32* %1, i32** %3
%7 = call i32 @foo(i32** %2, i32** %3)
ret void
}
void increment(void) {
  int x = 10;
  x++;
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @increment() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @increment() {
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int DecodeDelta(int code) {
  static const int8_t kDeltas[8] = {0, 1, 4, 11, 0, -1, -4, -11};
  return kDeltas[code];
}


x86 assembly (clang, -O0):
<DecodeDelta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xeee(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecodeDelta>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@DecodeDelta.kDeltas = internal constant [8 x i32] [i32 0, i32 1, i32 4, i32 11, i32 0, i32 -1, i32 -4, i32 -11]
define i32 @DecodeDelta(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @DecodeDelta.kDeltas, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
@DecodeDelta.kDeltas = internal unnamed_addr constant [8 x i32] [i32 0, i32 1, i32 4, i32 11, i32 0, i32 -1, i32 -4, i32 -11]
define i32 @DecodeDelta(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [8 x i32], [8 x i32]* @DecodeDelta.kDeltas, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}