xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ TestBinString();
int /*<<< orphan*/ TestGetBitVals();
int /*<<< orphan*/ TestGetCharFromArray();
int /*<<< orphan*/ TestGetMaxChars();
int /*<<< orphan*/ TestPutCharIntoArray();
int /*<<< orphan*/ TestPutGetIntoArray();
int /*<<< orphan*/ TestSetMessageBit();
int main(int argc, char *argv[]) {
  TestGetMaxChars();
  TestBinString();
  TestGetBitVals();
  TestSetMessageBit();
  TestGetCharFromArray();
  TestPutCharIntoArray();
  TestPutGetIntoArray();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <TestGetMaxChars@plt>
mov    $0x0,%al
call   1040 <TestBinString@plt>
mov    $0x0,%al
call   1050 <TestGetBitVals@plt>
mov    $0x0,%al
call   1080 <TestSetMessageBit@plt>
mov    $0x0,%al
call   1090 <TestGetCharFromArray@plt>
mov    $0x0,%al
call   1030 <TestPutCharIntoArray@plt>
mov    $0x0,%al
call   1060 <TestPutGetIntoArray@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <TestGetMaxChars@plt>
xor    %eax,%eax
call   1040 <TestBinString@plt>
xor    %eax,%eax
call   1050 <TestGetBitVals@plt>
xor    %eax,%eax
call   1080 <TestSetMessageBit@plt>
xor    %eax,%eax
call   1090 <TestGetCharFromArray@plt>
xor    %eax,%eax
call   1030 <TestPutCharIntoArray@plt>
xor    %eax,%eax
call   1060 <TestPutGetIntoArray@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @TestGetMaxChars()
%7 = call i32 (...) @TestBinString()
%8 = call i32 (...) @TestGetBitVals()
%9 = call i32 (...) @TestSetMessageBit()
%10 = call i32 (...) @TestGetCharFromArray()
%11 = call i32 (...) @TestPutCharIntoArray()
%12 = call i32 (...) @TestPutGetIntoArray()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TestGetMaxChars()
%4 = tail call i32 (...) @TestBinString()
%5 = tail call i32 (...) @TestGetBitVals()
%6 = tail call i32 (...) @TestSetMessageBit()
%7 = tail call i32 (...) @TestGetCharFromArray()
%8 = tail call i32 (...) @TestPutCharIntoArray()
%9 = tail call i32 (...) @TestPutGetIntoArray()
ret i32 0
}
int main() {
  char buf[] = "";
  void *shellcode = buf;
  typedef unsigned (*function)(void);
  function func = (function)shellcode;
  unsigned out = func();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x1(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
call   *-0x18(%rbp)
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x7(%rsp),%rax
call   *%rax
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = bitcast [1 x i8]* %1 to i32 ()*
%4 = call i32 %3()
ret i32 0
}
/* Type definitions */
struct aa_tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ aa_tree_remove_with(struct aa_tree *, void *,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
void aa_tree_remove(struct aa_tree *t, void *v) {
  aa_tree_remove_with(t, v, 0, 0);
}


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

x86 assembly (clang, -O2):
<aa_tree_remove>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <aa_tree_remove_with@plt>

LLVM IR (-O0):
%struct.aa_tree = type { i32 }
define void @aa_tree_remove(%struct.aa_tree* %0, i8* %1) {
%3 = alloca %struct.aa_tree*
%4 = alloca i8*
store %struct.aa_tree* %0, %struct.aa_tree** %3
store i8* %1, i8** %4
%5 = load %struct.aa_tree*, %struct.aa_tree** %3
%6 = load i8*, i8** %4
%7 = call i32 @aa_tree_remove_with(%struct.aa_tree* %5, i8* %6, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.aa_tree = type { i32 }
define void @aa_tree_remove(%struct.aa_tree* %0, i8* %1) {
%3 = tail call i32 @aa_tree_remove_with(%struct.aa_tree* %0, i8* %1, i32 0, i32 0)
ret void
}
write_color_byte(n) int n;
{ write_byte(pixel_convert(n)); }


x86 assembly (clang, -O0):
<write_color_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <pixel_convert@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <write_byte@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_color_byte>:
push   %rax
xor    %eax,%eax
call   1030 <pixel_convert@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <write_byte@plt>

LLVM IR (-O0):
define i32 @write_color_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @pixel_convert to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @write_byte to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @write_color_byte(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @pixel_convert to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @write_byte to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ XWindowAttributes;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XWindowAttributes(void) {
  XWindowAttributes *_p =
      (XWindowAttributes *)malloc(sizeof(XWindowAttributes));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XWindowAttributes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XWindowAttributes+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XWindowAttributes>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XWindowAttributes+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XWindowAttributes() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XWindowAttributes() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_server_start_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_server@%p::start (rtpp_server_start) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_server_start_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_server_start_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_server@%p::start (rtpp_server_start) is invoked after destruction\0A\00"
define void @rtpp_server_start_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_server@%p::start (rtpp_server_start) is invoked after destruction\0A\00"
define void @rtpp_server_start_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
unsigned char f24(unsigned char x, long int y) {
  return (x >> (8 - y)) ^ (x << y);
}


x86 assembly (clang, -O0):
<f24>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f24>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f24(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = sub nsw i64 8, %7
%9 = trunc i64 %8 to i32
%10 = ashr i32 %6, %9
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = shl i32 %12, %14
%16 = xor i32 %10, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f24(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 8, %4
%6 = lshr i32 %3, %5
%7 = shl i32 %3, %4
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}
int tegra_dvfs_late_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tegra_dvfs_late_init() {
ret i32 0
}
void f3(void *para) {}


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

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

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

LLVM IR (-O2):
define void @f3(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xyzCode(char *, char *, char *, char *);
void movetoFn(char *p1, char *p2, char *p3) { xyzCode(p1, p2, p3, "G90\nG1"); }


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

x86 assembly (clang, -O2):
<movetoFn>:
lea    0xee9(%rip),%rcx
jmp    1030 <xyzCode@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"G90\0AG1\00"
define void @movetoFn(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 i32 @xyzCode(i8* %7, i8* %8, i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"G90\0AG1\00"
define void @movetoFn(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @xyzCode(i8* %0, i8* %1, i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int m_calculate_hash(const char *key) {
  unsigned int result = 0;
  while (*key != 0) {
    result += *key;
    key++;
  }
  return result;
}


x86 assembly (clang, -O0):
<m_calculate_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <m_calculate_hash+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <m_calculate_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_calculate_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <m_calculate_hash+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <m_calculate_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @m_calculate_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add i32 %6, %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %14
}
/* Variables and functions */
int sum(int, int);
int addsum(int i, int j) {
  int s = sum(i, j);
  return s;
}


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

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

LLVM IR (-O0):
define i32 @addsum(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 = call i32 @sum(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @addsum(i32 %0, i32 %1) {
%3 = tail call i32 @sum(i32 %0, i32 %1)
ret i32 %3
}
void write_nothingd() {}


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

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

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

LLVM IR (-O2):
define void @write_nothingd() {
ret void
}
int main() {
  struct s *ptr2;
  {
    struct s {
      char x;
    };
    struct s s_x;
  }
  struct s {
    short y;
  };
  struct s s_y;
}


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

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

LLVM IR (-O0):
%struct.s = type { i16 }
%struct.s.0 = type { i8 }
define i32 @main() {
%1 = alloca %struct.s*
%2 = alloca %struct.s.0
%3 = alloca %struct.s
ret i32 0
}

LLVM IR (-O2):
%struct.s = type { i16 }
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ compile(char *);
int main() { compile("teste.cel"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"teste.cel\00"
define i32 @main() {
%1 = call i32 @compile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"teste.cel\00"
define i32 @main() {
%1 = tail call i32 @compile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char const *, int /*<<< orphan*/);
int getbootfilelen(const char *file) {
  int fd, len;
  fd = open(file, O_RDONLY);
  assert(fd != -1);
  len = lseek(fd, 0, SEEK_END);
  close(fd);
  return len;
}


x86 assembly (clang, -O0):
<getbootfilelen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0xc(%rbp),%edi
mov    0x2e6c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbootfilelen>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0xffffffff,%eax
setne  %dil
call   1050 <assert@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
define i32 @getbootfilelen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, -1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* @SEEK_END
%14 = call i32 @lseek(i32 %12, i32 0, i32 %13)
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = call i32 @close(i32 %15)
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
define i32 @getbootfilelen(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* @SEEK_END
%8 = tail call i32 @lseek(i32 %3, i32 0, i32 %7)
%9 = tail call i32 @close(i32 %3)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char name[30];
  printf("Enter your name: ");
  gets(name);
  printf("\nHello: ");
  puts(name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <gets@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter your name: \00"
@.str.1 = [9 x i8] c"\0AHello: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter your name: \00"
@.str.1 = [9 x i8] c"\0AHello: \00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
ret i32 0
}
void i2d_OCSP_SIGNATURE(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OCSP_SIGNATURE() {
ret void
}
void test_libsym1_3(void) {}


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

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

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

LLVM IR (-O2):
define void @test_libsym1_3() {
ret void
}
int vde_chain_nm2_n_in(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @vde_chain_nm2_n_in() {
ret i32 4
}

LLVM IR (-O2):
define i32 @vde_chain_nm2_n_in() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fxn(int no1) {
  printf("\nno1 is %d", no1);
  no1++;
}


x86 assembly (clang, -O0):
<fxn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxn>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0Ano1 is %d\00"
define void @fxn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0Ano1 is %d\00"
define void @fxn(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void get_template_info() { abort(); }


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

x86 assembly (clang, -O2):
<get_template_info>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @get_template_info() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @get_template_info() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ free(char *);
char *raw_input(char *);
float raw_input_float(char *input) {
  char *get_input = raw_input(input);
  float numero = atof(get_input);
  free(get_input);
  return numero;
}


x86 assembly (clang, -O0):
<raw_input_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <raw_input@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atof@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_input_float>:
push   %rbx
sub    $0x10,%rsp
call   1050 <raw_input@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <atof@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @raw_input_float(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @raw_input(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call float @atof(i8* %7)
store float %8, float* %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load float, float* %4
ret float %11
}

LLVM IR (-O2):
define float @raw_input_float(i8* %0) {
%2 = tail call i8* @raw_input(i8* %0)
%3 = tail call float @atof(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ choose_mode();
int /*<<< orphan*/ init_app();
void main(void) {
  init_app();
  while (1) {
    choose_mode();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_app@plt>
mov    $0x0,%al
call   1040 <choose_mode@plt>
jmp    112b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_app@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <choose_mode@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @init_app()
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @choose_mode()
br label %2
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init_app()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @choose_mode()
br label %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t bytes_r16net(const uint8_t *data) {
  return ((uint16_t)data[1]) | (((uint16_t)data[0]) << 8);
}


x86 assembly (clang, -O0):
<bytes_r16net>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_r16net>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bytes_r16net(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @bytes_r16net(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = load i64, i64* %0
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void f() { exit(1); }


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

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

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

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int substr_cmp(char *first, char *sec) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @substr_cmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
char *firstblank(char *str) {
  register char *ptr;
  for (ptr = str; *ptr && *ptr != ' ' && *ptr != '\t'; ptr++)
    ;
  return ptr;
}


x86 assembly (clang, -O0):
<firstblank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114a <firstblank+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     114a <firstblank+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115a <firstblank+0x5a>
jmp    1170 <firstblank+0x70>
jmp    115f <firstblank+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <firstblank+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstblank>:
mov    %rdi,%rax
movabs $0x100000201,%rcx
jmp    1114 <firstblank+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1110 <firstblank+0x10>
bt     %rdx,%rcx
jae    1110 <firstblank+0x10>
ret

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

LLVM IR (-O2):
define i8* @firstblank(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
ret i8* %3
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  int z = __VERIFIER_nondet_int();
  while (x > 0) {
    x = x + y;
    y = y + z;
    z--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1167 <main+0x57>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Type definitions */
struct OlLrc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ol_lrc_free(struct OlLrc *);
struct OlLrc *ol_lrc_new(char *);
int /*<<< orphan*/ prepare_data();
void gbk_test() {
  prepare_data();
  struct OlLrc *lrc = ol_lrc_new("/tmp/"
                                 "lrc_basic.lrc");
  struct OlLrc *gbklrc = ol_lrc_new("/tmp/"
                                    "lrc_gbk.lrc");
  ol_lrc_free(lrc);
  ol_lrc_free(gbklrc);
}


x86 assembly (clang, -O0):
<gbk_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <prepare_data@plt>
lea    0xeba(%rip),%rdi
call   1030 <ol_lrc_new@plt>
mov    %rax,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <ol_lrc_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ol_lrc_free@plt>
mov    -0x10(%rbp),%rdi
call   1050 <ol_lrc_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbk_test>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <prepare_data@plt>
lea    0xebe(%rip),%rdi
call   1030 <ol_lrc_new@plt>
mov    %rax,%r14
lea    0xec2(%rip),%rdi
call   1030 <ol_lrc_new@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <ol_lrc_free@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <ol_lrc_free@plt>

LLVM IR (-O0):
%struct.OlLrc = type { i32 }
@.str = [19 x i8] c"/tmp/lrc_basic.lrc\00"
@.str.1 = [17 x i8] c"/tmp/lrc_gbk.lrc\00"
define void @gbk_test() {
%1 = alloca %struct.OlLrc*
%2 = alloca %struct.OlLrc*
%3 = call i32 (...) @prepare_data()
%4 = call %struct.OlLrc* @ol_lrc_new(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store %struct.OlLrc* %4, %struct.OlLrc** %1
%5 = call %struct.OlLrc* @ol_lrc_new(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store %struct.OlLrc* %5, %struct.OlLrc** %2
%6 = load %struct.OlLrc*, %struct.OlLrc** %1
%7 = call i32 @ol_lrc_free(%struct.OlLrc* %6)
%8 = load %struct.OlLrc*, %struct.OlLrc** %2
%9 = call i32 @ol_lrc_free(%struct.OlLrc* %8)
ret void
}

LLVM IR (-O2):
%struct.OlLrc = type { i32 }
@.str = [19 x i8] c"/tmp/lrc_basic.lrc\00"
@.str.1 = [17 x i8] c"/tmp/lrc_gbk.lrc\00"
define void @gbk_test() {
%1 = tail call i32 (...) @prepare_data()
%2 = tail call %struct.OlLrc* @ol_lrc_new(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call %struct.OlLrc* @ol_lrc_new(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @ol_lrc_free(%struct.OlLrc* %2)
%5 = tail call i32 @ol_lrc_free(%struct.OlLrc* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_byte(unsigned char);
void __console_tx_nibble(unsigned nibble) {
  unsigned char digit;
  digit = nibble + '0';
  if (digit > '9') {
    digit += 39;
  }
  __console_tx_byte(digit);
}


x86 assembly (clang, -O0):
<__console_tx_nibble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    113b <__console_tx_nibble+0x2b>
movzbl -0x5(%rbp),%eax
add    $0x27,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <__console_tx_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__console_tx_nibble>:
lea    0x30(%rdi),%eax
add    $0x57,%dil
cmp    $0x3a,%al
movzbl %dil,%ecx
movzbl %al,%eax
cmovae %ecx,%eax
movzbl %al,%edi
jmp    1030 <__console_tx_byte@plt>

LLVM IR (-O0):
define void @__console_tx_nibble(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 48
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = icmp sgt i32 %8, 57
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = add nsw i32 %12, 39
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %15
15: ; preds = %10, %1
%16 = load i8, i8* %3
%17 = call i32 @__console_tx_byte(i8 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @__console_tx_nibble(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
%4 = icmp ugt i8 %3, 57
%5 = add i8 %2, 87
%6 = select i1 %4, i8 %5, i8 %3
%7 = tail call i32 @__console_tx_byte(i8 zeroext %6)
ret void
}
/* Type definitions */
struct vec4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec4(float *, float, float, float, float);
__attribute__((always_)) struct vec4 *psvec4(struct vec4 *result, float x,
                                             float y, float z, float w) {
  vec4((float *)result, x, y, z, w);
  return result;
}


x86 assembly (clang, -O0):
<psvec4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1030 <vec4@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4(%struct.vec4* %0, float %1, float %2, float %3, float %4) {
%6 = alloca %struct.vec4*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store %struct.vec4* %0, %struct.vec4** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load %struct.vec4*, %struct.vec4** %6
%12 = bitcast %struct.vec4* %11 to float*
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = load float, float* %10
%17 = call i32 @vec4(float* %12, float %13, float %14, float %15, float %16)
%18 = load %struct.vec4*, %struct.vec4** %6
ret %struct.vec4* %18
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4(%struct.vec4* returned %0, float %1, float %2, float %3, float %4) {
%6 = bitcast %struct.vec4* %0 to float*
%7 = tail call i32 @vec4(float* %6, float %1, float %2, float %3, float %4)
ret %struct.vec4* %0
}
void g_atomic_int_add() {}


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

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

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

LLVM IR (-O2):
define void @g_atomic_int_add() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int setjmp(void *env) {
  printk("Write setjmp()\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Write setjmp()\0A\00"
define i32 @setjmp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Write setjmp()\0A\00"
define i32 @setjmp(i8* nocapture readnone %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ _plibc_syscall(int);
pid_t getpid(void) { return _plibc_syscall(39); }


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

x86 assembly (clang, -O2):
<getpid>:
mov    $0x27,%edi
jmp    1030 <_plibc_syscall@plt>

LLVM IR (-O0):
define i32 @getpid() {
%1 = call i32 @_plibc_syscall(i32 39)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpid() {
%1 = tail call i32 @_plibc_syscall(i32 39)
ret i32 %1
}
/* Variables and functions */
scalar_t__ isspace(char);
char *remove_leading_spaces(char *value) {
  if (value == NULL) {
    return NULL;
  }
  for (; isspace(*value); value++)
    ;
  return value;
}


x86 assembly (clang, -O0):
<remove_leading_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <remove_leading_spaces+0x24>
movq   $0x0,-0x8(%rbp)
jmp    116d <remove_leading_spaces+0x5d>
jmp    1139 <remove_leading_spaces+0x29>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1165 <remove_leading_spaces+0x55>
jmp    1154 <remove_leading_spaces+0x44>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <remove_leading_spaces+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_leading_spaces>:
push   %rbx
test   %rdi,%rdi
je     1134 <remove_leading_spaces+0x24>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <remove_leading_spaces+0x10>
jmp    1136 <remove_leading_spaces+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @remove_leading_spaces(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 0x89ABCDEF;
  int y = 0x76543210;
  int result = (x & 0xFF) | (y ^ (y & 0xFF));
  printf("The result is: %x\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x89abcdef,-0x8(%rbp)
movl   $0x76543210,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%edx
and    $0xff,%edx
xor    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"The result is: %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 -1985229329, i32* %2
store i32 1985229328, i32* %3
%5 = load i32, i32* %2
%6 = and i32 %5, 255
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = and i32 %8, 255
%10 = xor i32 %7, %9
%11 = or i32 %6, %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"The result is: %x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1985229551)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char *c = (char *)malloc(0xfffffffffff);
  *c = 'p';
  *(c + 1) = '\0';
  printf("malloc char: %s\n", c);
  printf("I should break now!!\n");
  *(c + (0xffffffffffe)) = '\0';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x70,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x18(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movabs $0xffffffffffe,%rax
add    -0x18(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movw   $0x70,(%rax)
lea    0xeb6(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
movabs $0xffffffffffe,%rax
movb   $0x0,(%rbx,%rax,1)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"malloc char: %s\0A\00"
@.str.1 = [22 x i8] c"I should break now!!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i64 @malloc(i32 -1)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %5
store i8 112, i8* %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 0, i8* %10
%11 = load i8*, i8** %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 17592186044414
store i8 0, i8* %15
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"malloc char: %s\0A\00"
@str = [21 x i8] c"I should break now!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 -1)
%4 = inttoptr i64 %3 to i8*
store i8 112, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %5
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%8 = getelementptr inbounds i8, i8* %4, i64 17592186044414
store i8 0, i8* %8
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ warn(char const *);
void die(const char *msg, ...) {
  warn(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <warn@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <warn@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @warn(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die(i8* %0, ...) {
%2 = tail call i32 @warn(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}