xunge/DecIR huggingface dataset:
/* Variables and functions */
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *, ...);
void Cmd_Echo_f(void) {
  int i;
  for (i = 1; i < Cmd_Argc(); i++) {
    Com_Printf("%s ", Cmd_Argv(i));
  }
  Com_Printf("\n");
}


x86 assembly (clang, -O0):
<Cmd_Echo_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jge    117f <Cmd_Echo_f+0x4f>
mov    -0x4(%rbp),%edi
call   1050 <Cmd_Argv@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <Com_Printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <Cmd_Echo_f+0xf>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <Com_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_Echo_f>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jl     1171 <Cmd_Echo_f+0x41>
mov    $0x1,%ebx
lea    0xeb4(%rip),%r14
nopl   0x0(%rax)
mov    %ebx,%edi
call   1050 <Cmd_Argv@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <Com_Printf@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    %eax,%ebx
jl     1150 <Cmd_Echo_f+0x20>
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Cmd_Echo_f() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = call i32 (...) @Cmd_Argc()
%5 = icmp slt i32 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @Cmd_Argv(i32 %7)
%9 = call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
%14 = call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Cmd_Echo_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 1, %0 ]
%5 = tail call i32 @Cmd_Argv(i32 %4)
%6 = tail call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = tail call i32 (...) @Cmd_Argc()
%9 = icmp slt i32 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %0
%11 = tail call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rbtree {
  int dummy;
};
struct htable {
  int dummy;
};

/* Variables and functions */
int read_records_from_file(char *, struct htable *, struct rbtree *,
                           int /*<<< orphan*/);
int read_root(struct htable *ds, struct rbtree *rbt) {
  return read_records_from_file("../root.z", ds, rbt, 0);
}


x86 assembly (clang, -O0):
<read_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
xor    %ecx,%ecx
call   1030 <read_records_from_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_root>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
xor    %ecx,%ecx
jmp    1030 <read_records_from_file@plt>

LLVM IR (-O0):
%struct.htable = type { i32 }
%struct.rbtree = type { i32 }
@.str = [10 x i8] c"../root.z\00"
define i32 @read_root(%struct.htable* %0, %struct.rbtree* %1) {
%3 = alloca %struct.htable*
%4 = alloca %struct.rbtree*
store %struct.htable* %0, %struct.htable** %3
store %struct.rbtree* %1, %struct.rbtree** %4
%5 = load %struct.htable*, %struct.htable** %3
%6 = load %struct.rbtree*, %struct.rbtree** %4
%7 = call i32 @read_records_from_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.htable* %5, %struct.rbtree* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.htable = type { i32 }
%struct.rbtree = type { i32 }
@.str = [10 x i8] c"../root.z\00"
define i32 @read_root(%struct.htable* %0, %struct.rbtree* %1) {
%3 = tail call i32 @read_records_from_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.htable* %0, %struct.rbtree* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
double ceil(double);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("ceil examples\n");
  printf("The value %f is %f\n", 5.1, ceil(5.1));
  printf("The value %f is %f\n", 4.9, ceil(4.9));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xee3(%rip),%xmm1
lea    0xef3(%rip),%rdi
movsd  0xecc(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0xeb5(%rip),%xmm1
lea    0xed5(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rbx
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xeba(%rip),%xmm0
movsd  0xeba(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"ceil examples\0A\00"
@.str.1 = [20 x i8] c"The value %f is %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call double @llvm.ceil.f64(double 5.100000e+00)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double 5.100000e+00, double %3)
%5 = call double @llvm.ceil.f64(double 4.900000e+00)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double 4.900000e+00, double %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"The value %f is %f\0A\00"
@str = [14 x i8] c"ceil examples\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double 5.100000e+00, double 6.000000e+00)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double 4.900000e+00, double 5.000000e+00)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t add(uint8_t a, uint8_t b) { return a + b; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%rax
ret

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

LLVM IR (-O2):
define i64 @add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
int wl_get_frequency_offset(const char *ifname, int *buf) {
  *buf = 0;
  return -1;
}


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

x86 assembly (clang, -O2):
<wl_get_frequency_offset>:
movl   $0x0,(%rsi)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @wl_get_frequency_offset(i8* nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
ret i32 -1
}
int test_imm_0Fuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x0F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Fuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xf,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Fuint64_midword_reg>:
test   $0xf0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Fuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 983040
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sys_ni(void) { printf("ni\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"ni\00"
define void @sys_ni() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ read(int, char *, int);
void main(void) {
  char a[10];
  read(0xffffffff, a, 5);
  puts(a);
  exit(0);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rsi
mov    $0xffffffff,%edi
mov    $0x5,%edx
call   1040 <read@plt>
lea    -0xa(%rbp),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rbx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1040 <read@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 -1, i8* %2, i32 5)
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 -1, i8* %2, i32 5)
%4 = call i32 @puts(i8* %2)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *realloc(char *, scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
void string_append(char **original, char *string_to_add) {
  *original = realloc(*original, strlen(*original) + strlen(string_to_add) + 1);
  strcat(*original, string_to_add);
}


x86 assembly (clang, -O0):
<string_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdi
add    %rax,%rsi
add    $0x1,%rsi
call   1040 <realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_append>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rax,%r12
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r12,%rax,1),%rsi
add    $0x1,%rsi
mov    %rbx,%rdi
call   1040 <realloc@plt>
mov    %rax,(%r15)
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <strcat@plt>

LLVM IR (-O0):
define void @string_append(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = call i64 @strlen(i8* %8)
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %9, %11
%13 = add nsw i64 %12, 1
%14 = call i8* @realloc(i8* %6, i64 %13)
%15 = load i8**, i8*** %3
store i8* %14, i8** %15
%16 = load i8**, i8*** %3
%17 = load i8*, i8** %16
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i8* %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @string_append(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = add i64 %4, 1
%7 = add i64 %6, %5
%8 = tail call i8* @realloc(i8* %3, i64 %7)
store i8* %8, i8** %0
%9 = tail call i32 @strcat(i8* %8, i8* %1)
ret void
}
void reset_array(int *arr, int n) {
  int i;
  for (i = 0; i < n; i++) {
    arr[i] = 0;
  }
}


x86 assembly (clang, -O0):
<reset_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <reset_array+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <reset_array+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_array>:
test   %esi,%esi
jle    1126 <reset_array+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @reset_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
void freeshellpath(char *shellpath[]) {
  for (int i = 0; shellpath[i]; i++)
    free(shellpath[i]);
  free(shellpath);
}


x86 assembly (clang, -O0):
<freeshellpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <freeshellpath+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <freeshellpath+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeshellpath>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freeshellpath+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freeshellpath+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeshellpath(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = bitcast i8** %0 to i8*
tail call void @free(i8* %5)
ret void
6: ; preds = %1, %6
%7 = phi i64 [ %9, %6 ], [ 0, %1 ]
%8 = phi i8* [ %11, %6 ], [ %2, %1 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ generate_random_walk(char **);
int /*<<< orphan*/ print_array(char **);
int main(void) {
  char walk[10][10];
  generate_random_walk(walk);
  print_array(walk);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <generate_random_walk@plt>
lea    -0x70(%rbp),%rdi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <generate_random_walk@plt>
mov    %rbx,%rdi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i8]]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 0
%4 = bitcast [10 x i8]* %3 to i8**
%5 = call i32 @generate_random_walk(i8** %4)
%6 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 0
%7 = bitcast [10 x i8]* %6 to i8**
%8 = call i32 @print_array(i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x [10 x i8]]
%2 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%3 = bitcast [10 x [10 x i8]]* %1 to i8**
%4 = call i32 @generate_random_walk(i8** %3)
%5 = call i32 @print_array(i8** %3)
ret i32 0
}
/* Variables and functions */
int chdir(char const *);
int UnixVfs_chdir(const char *zPath) {
  int rc;
  rc = chdir(zPath);
  return rc == 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<UnixVfs_chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnixVfs_chdir>:
push   %rax
call   1030 <chdir@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @UnixVfs_chdir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
%3 = icmp ne i32 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
int lnblnk_(chline, len)
char *chline;
int len;
{
  char *chcur;
  chcur = chline + len;
  while (chcur > chline) {
    if (*--chcur != ' ')
      goto exit;
  }
  return 0;
exit:
  return chcur + 1 - chline;
}


x86 assembly (clang, -O0):
<lnblnk_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    114e <lnblnk_+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
je     1149 <lnblnk_+0x49>
jmp    115a <lnblnk_+0x5a>
jmp    111a <lnblnk_+0x1a>
movl   $0x0,-0x4(%rbp)
jmp    116c <lnblnk_+0x6c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnblnk_>:
movslq %esi,%rax
lea    (%rdi,%rax,1),%rcx
add    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmp    %rdi,%rcx
jbe    1123 <lnblnk_+0x23>
add    $0xffffffff,%eax
cmpb   $0x20,-0x1(%rcx)
lea    -0x1(%rcx),%rcx
je     1110 <lnblnk_+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @lnblnk_(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %8, %2
%6 = phi i8* [ %4, %2 ], [ %9, %8 ]
%7 = icmp ugt i8* %6, %0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 32
br i1 %11, label %5, label %12
12: ; preds = %8
%13 = ptrtoint i8* %6 to i64
%14 = ptrtoint i8* %0 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
br label %17
17: ; preds = %5, %12
%18 = phi i32 [ %16, %12 ], [ 0, %5 ]
ret i32 %18
}
char *langRomTypeFmpac() { return "FMPAC"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"FMPAC\00"
define i8* @langRomTypeFmpac() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int test_imm_96int16_reg(short val) {
  return ((val) & (-0x96 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_96int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff6a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_96int16_reg>:
test   $0xff6a,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_96int16_reg(i16 signext %0) {
%2 = and i16 %0, -150
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef double uint32_t;

/* Variables and functions */
scalar_t__ UINT32_MAX;
uint32_t dtou32(double d, uint32_t scale) {
  return (uint32_t)((d / scale) * (double)UINT32_MAX);
}


x86 assembly (clang, -O0):
<dtou32>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
mov    0x2ed9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtou32>:
divsd  %xmm1,%xmm0
mov    0x2eed(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@UINT32_MAX = global i64 0
define double @dtou32(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
%8 = load i64, i64* @UINT32_MAX
%9 = sitofp i64 %8 to double
%10 = fmul double %7, %9
ret double %10
}

LLVM IR (-O2):
@UINT32_MAX = global i64 0
define double @dtou32(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = load i64, i64* @UINT32_MAX
%5 = sitofp i64 %4 to double
%6 = fmul double %3, %5
ret double %6
}
/* Variables and functions */
int send_msg_recv_msg(int, int, int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                      size_t, void *);
int send_cmd_recv_msg(int sock, int type, int op, size_t recv_len,
                      void *recv_buf) {
  return send_msg_recv_msg(sock, type, op, 0, NULL, recv_len, recv_buf);
}


x86 assembly (clang, -O0):
<send_cmd_recv_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   1030 <send_msg_recv_msg@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd_recv_msg>:
push   %rax
mov    %rcx,%r9
mov    %r8,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <send_msg_recv_msg@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @send_cmd_recv_msg(i32 %0, i32 %1, i32 %2, i64 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i64, i64* %9
%15 = load i8*, i8** %10
%16 = call i32 @send_msg_recv_msg(i32 %11, i32 %12, i32 %13, i32 0, i32* null, i64 %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @send_cmd_recv_msg(i32 %0, i32 %1, i32 %2, i64 %3, i8* %4) {
%6 = tail call i32 @send_msg_recv_msg(i32 %0, i32 %1, i32 %2, i32 0, i32* null, i64 %3, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ configureIeee802154Patch();
void refreshIeee802154Patch(void) { configureIeee802154Patch(); }


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

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

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

LLVM IR (-O2):
define void @refreshIeee802154Patch() {
%1 = tail call i32 (...) @configureIeee802154Patch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
void pmu_adc_enable() {
  pmu_reg_write(0x3B, ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |
                       (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) |
                       (1 << 10) | (1 << 11) | (0 << 12) | (1 << 13) |
                       (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) |
                       (1 << 18) | (1 << 19) | (1 << 20)));
}


x86 assembly (clang, -O0):
<pmu_adc_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
mov    $0x1fefff,%esi
call   1030 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_enable>:
mov    $0x3b,%edi
mov    $0x1fefff,%esi
jmp    1030 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_adc_enable() {
%1 = call i32 @pmu_reg_write(i32 59, i32 2093055)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_enable() {
%1 = tail call i32 @pmu_reg_write(i32 59, i32 2093055)
ret void
}
int get_max(int a, int b) {
  int bigger = (a > b) ? a : b;
  return bigger;
}


x86 assembly (clang, -O0):
<get_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <get_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <get_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void end_no_core() { exit(1); }


x86 assembly (clang, -O0):
<end_no_core>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @end_no_core() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @end_no_core() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
char *strcpy(char *dest, const char *src) {
  char *dest_ch = dest;
  while (*src)
    *dest_ch++ = *src++;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1120 <strcpy+0x20>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i8* %0
}
void foo_2_1_2_2_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_1_1_1_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  int a = 1;
  int b = 2;
  __VERIFIER_assert(a > b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp sgt i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr,
          "Usage: ice_tool [-r addr][-w addr data][-v][-V] [BITSTREAM] \n"
          "  BITSTREAM is a file containing the FPGA bitstream to download\n"
          "  -r read SPI control port at addr\n"
          "  -w write SPI control port at addr w/ data\n"
          "  -v enables verbose progress messages\n"
          "  -V prints the tool version\n");
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [273 x i8] c"Usage: ice_tool [-r addr][-w addr data][-v][-V] [BITSTREAM] \0A BITSTREAM is a file containing the FPGA bitstream to download\0A -r read SPI control port at addr\0A -w write SPI control port at addr w/ data\0A -v enables verbose progress messages\0A -V prints the tool version\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([273 x i8], [273 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [273 x i8] c"Usage: ice_tool [-r addr][-w addr data][-v][-V] [BITSTREAM] \0A BITSTREAM is a file containing the FPGA bitstream to download\0A -r read SPI control port at addr\0A -w write SPI control port at addr w/ data\0A -v enables verbose progress messages\0A -V prints the tool version\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([273 x i8], [273 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void smc_outwd(unsigned int val, unsigned int addr) {
  *((volatile unsigned short *)addr) = val;
}


x86 assembly (clang, -O0):
<smc_outwd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,%cx
mov    -0x8(%rbp),%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smc_outwd>:
mov    %esi,%eax
mov    %di,(%rax)
ret

LLVM IR (-O0):
define void @smc_outwd(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 = trunc i32 %5 to i16
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i16*
store volatile i16 %6, i16* %9
ret void
}

LLVM IR (-O2):
define void @smc_outwd(i32 %0, i32 %1) {
%3 = trunc i32 %0 to i16
%4 = zext i32 %1 to i64
%5 = inttoptr i64 %4 to i16*
store volatile i16 %3, i16* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cat1();
void rot61_sem() { cat1(); }


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

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

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

LLVM IR (-O2):
define void @rot61_sem() {
%1 = tail call i32 (...) @cat1()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct macan_key {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
void macan_aes_cmac(const struct macan_key *key, size_t length, uint8_t *dst,
                    uint8_t *src) {
  (void)key, (void)length, (void)dst, (void)src;
  memset(dst, 0, 16);
}


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

x86 assembly (clang, -O2):
<macan_aes_cmac>:
mov    %rdx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
%struct.macan_key = type { i32 }
define void @macan_aes_cmac(%struct.macan_key* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca %struct.macan_key*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
store %struct.macan_key* %0, %struct.macan_key** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load %struct.macan_key*, %struct.macan_key** %5
%10 = load i64, i64* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %7
%14 = call i32 @memset(i32* %13, i32 0, i32 16)
ret void
}

LLVM IR (-O2):
%struct.macan_key = type { i32 }
define void @macan_aes_cmac(%struct.macan_key* nocapture readnone %0, i64 %1, i32* %2, i32* nocapture readnone %3) {
%5 = tail call i32 @memset(i32* %2, i32 0, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/
__softboundmpx_propagate_metadata_shadow_stack_from(int, int /*<<< orphan*/);
int /*<<< orphan*/ __softboundmpx_store_null_return_metadata();
char *strstr(char const *, char const *);
__attribute__((__weak__, __always___)) char *
softboundmpx_strstr(const char *haystack, const char *needle) {
  char *ret_ptr = strstr(haystack, needle);
  if (ret_ptr != NULL) {
    __softboundmpx_propagate_metadata_shadow_stack_from(1, 0);
  } else {
    __softboundmpx_store_null_return_metadata();
  }
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx_strstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116d <softboundmpx_strstr+0x3d>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <__softboundmpx_propagate_metadata_shadow_stack_from@plt>
jmp    1174 <softboundmpx_strstr+0x44>
mov    $0x0,%al
call   1050 <__softboundmpx_store_null_return_metadata@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_strstr>:
push   %rbx
call   1040 <strstr@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114c <softboundmpx_strstr+0x1c>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <__softboundmpx_propagate_metadata_shadow_stack_from@plt>
jmp    1153 <softboundmpx_strstr+0x23>
xor    %eax,%eax
call   1050 <__softboundmpx_store_null_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define weak i8* @softboundmpx_strstr(i8* %0, i8* %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @__softboundmpx_propagate_metadata_shadow_stack_from(i32 1, i32 0)
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @__softboundmpx_store_null_return_metadata()
br label %9
9: ; preds = %7, %5
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
FILE *OpenFile(char *fname, char *mode) {
  FILE *file = fopen(fname, mode);
  if (!file) {
    printf("Could not open %s\n", fname);
    exit(1);
  }
  return file;
}


x86 assembly (clang, -O0):
<OpenFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <OpenFile+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenFile>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <OpenFile+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Could not open %s\0A\00"
define i32* @OpenFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [19 x i8] c"Could not open %s\0A\00"
define noalias i32* @OpenFile(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int errno;
int wby_socket_error() { return errno; }


x86 assembly (clang, -O0):
<wby_socket_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wby_socket_error>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @wby_socket_error() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @wby_socket_error() {
%1 = load i32, i32* @errno
ret i32 %1
}
void vSetStrBit(unsigned char *psStr, int iPosition, int iValue) {
  unsigned char *p;
  unsigned char ucTmp;
  p = psStr + iPosition / 8;
  iPosition %= 8;
  ucTmp = 1 << (7 - iPosition);
  if (iValue)
    *p |= ucTmp;
  else
    *p &= ~ucTmp;
}


x86 assembly (clang, -O0):
<vSetStrBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    $0x7,%ecx
sub    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x19(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     116f <vSetStrBit+0x6f>
movzbl -0x19(%rbp),%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
jmp    1181 <vSetStrBit+0x81>
movzbl -0x19(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vSetStrBit>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%r8d
and    $0xfffffff8,%eax
sub    %eax,%esi
mov    $0x7,%cl
sub    %sil,%cl
mov    $0x1,%esi
shl    %cl,%esi
sar    $0x3,%r8d
movslq %r8d,%r8
mov    (%rdi,%r8,1),%cl
mov    %esi,%eax
not    %al
and    %cl,%al
or     %sil,%cl
test   %edx,%edx
movzbl %cl,%ecx
movzbl %al,%eax
cmovne %ecx,%eax
mov    %al,(%rdi,%r8,1)
ret

LLVM IR (-O0):
define void @vSetStrBit(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 8
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8* %13, i8** %7
%14 = load i32, i32* %5
%15 = srem i32 %14, 8
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = sub nsw i32 7, %16
%18 = shl i32 1, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %3
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = load i8*, i8** %7
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = or i32 %27, %24
%29 = trunc i32 %28 to i8
store i8 %29, i8* %25
br label %39
30: ; preds = %3
%31 = load i8, i8* %8
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = load i8*, i8** %7
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = and i32 %36, %33
%38 = trunc i32 %37 to i8
store i8 %38, i8* %34
br label %39
39: ; preds = %30, %22
ret void
}

LLVM IR (-O2):
define void @vSetStrBit(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sdiv i32 %1, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = srem i32 %1, 8
%8 = sub nsw i32 7, %7
%9 = shl nuw nsw i32 1, %8
%10 = icmp eq i32 %2, 0
%11 = load i8, i8* %6
%12 = trunc i32 %9 to i8
%13 = xor i8 %12, -1
%14 = and i8 %11, %13
%15 = or i8 %11, %12
%16 = select i1 %10, i8 %14, i8 %15
store i8 %16, i8* %6
ret void
}
int __signbitl(long double x) {
  unsigned short sw;
  __asm__("fxam; fstsw %%ax;" : "=a"(sw) : "t"(x));
  return (sw & 0x0200) != 0;
}


x86 assembly (clang, -O0):
<__signbitl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fxam
fstsw  %ax
fstp   %st(0)
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__signbitl>:
fldt   0x8(%rsp)
fxam
fstsw  %ax
fstp   %st(0)
shr    $0x9,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @__signbitl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i16
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call i16 asm "fxam; fstsw %ax;", "={ax},{st},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = and i32 %7, 512
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__signbitl(x86_fp80 %0) {
%2 = tail call i16 asm "fxam; fstsw %ax;", "={ax},{st},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
%3 = lshr i16 %2, 9
%4 = and i16 %3, 1
%5 = zext i16 %4 to i32
ret i32 %5
}