xunge/DecIR huggingface dataset:
/* Variables and functions */
char *_crypt_retval_magic(int /*<<< orphan*/, char const *, char *, int);
int /*<<< orphan*/ crypt_rn(char const *, char const *, void *, int);
char *crypt_r(const char *key, const char *setting, void *data) {
  return _crypt_retval_magic(crypt_rn(key, setting, data, (7 + 22 + 31 + 1)),
                             setting, (char *)data, (7 + 22 + 31 + 1));
}


x86 assembly (clang, -O0):
<crypt_r>:
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
mov    $0x3d,%ecx
call   1030 <crypt_rn@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x3d,%ecx
call   1040 <_crypt_retval_magic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_r>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0x3d,%ecx
call   1030 <crypt_rn@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x3d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_crypt_retval_magic@plt>

LLVM IR (-O0):
define i8* @crypt_r(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 @crypt_rn(i8* %7, i8* %8, i8* %9, i32 61)
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i8* @_crypt_retval_magic(i32 %10, i8* %11, i8* %12, i32 61)
ret i8* %13
}

LLVM IR (-O2):
define i8* @crypt_r(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @crypt_rn(i8* %0, i8* %1, i8* %2, i32 61)
%5 = tail call i8* @_crypt_retval_magic(i32 %4, i8* %1, i8* %2, i32 61)
ret i8* %5
}
/* Variables and functions */
int isValidIp4(char const *);
int verifyInetVariable(int *port, const char *ip) {
  if (*port <= 0) {
    *port = 9000;
  } else {
  }
  return isValidIp4(ip);
}


x86 assembly (clang, -O0):
<verifyInetVariable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jg     113c <verifyInetVariable+0x2c>
mov    -0x8(%rbp),%rax
movl   $0x2328,(%rax)
jmp    1141 <verifyInetVariable+0x31>
jmp    1141 <verifyInetVariable+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <isValidIp4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifyInetVariable>:
cmpl   $0x0,(%rdi)
jle    111d <verifyInetVariable+0xd>
mov    %rsi,%rdi
jmp    1030 <isValidIp4@plt>
movl   $0x2328,(%rdi)
mov    %rsi,%rdi
jmp    1030 <isValidIp4@plt>

LLVM IR (-O0):
define i32 @verifyInetVariable(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32*, i32** %3
store i32 9000, i32* %9
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %4
%13 = call i32 @isValidIp4(i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @verifyInetVariable(i32* nocapture %0, i8* %1) {
%3 = load i32, i32* %0
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 9000, i32* %0
br label %6
6: ; preds = %2, %5
%7 = tail call i32 @isValidIp4(i8* %1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int yyparse();
int main(int argc, const char **argv) {
  printf("> ");
  return yyparse();
}


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)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <yyparse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <yyparse@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"> \00"
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 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @yyparse()
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @yyparse()
ret i32 %4
}
long double pass_longdouble(long double arg) { return arg; }


x86 assembly (clang, -O0):
<pass_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pass_longdouble>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @pass_longdouble(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @pass_longdouble(x86_fp80 returned %0) {
ret x86_fp80 %0
}
int baz(int x, int y) { return x + y; }


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

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

LLVM IR (-O0):
define i32 @baz(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 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @baz(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
char *filename_completion_function(s, i) const char *s;
int i;
{ return rl_filename_completion_function(s, i); }


x86 assembly (clang, -O0):
<filename_completion_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <rl_filename_completion_function@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @filename_completion_function(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rl_filename_completion_function to i32 (i8*, i32, ...)*)(i8* %5, i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @filename_completion_function(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @rl_filename_completion_function to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
int symlink(const char *oldpath, const char *newpath) {
  printf("tcl>>> %s\n", __func__);
  return -1;
}


x86 assembly (clang, -O0):
<symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
lea    0xedd(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.symlink = [8 x i8] c"symlink\00"
define i32 @symlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.symlink, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.symlink = [8 x i8] c"symlink\00"
define i32 @symlink(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.symlink, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ UINT32_MAX;
int /*<<< orphan*/ __VERIFIER_assert(int);
int main() {
  uint32_t value = UINT32_MAX;
  ++value;
  __VERIFIER_assert(value == UINT32_MAX);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
sete   %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):
@UINT32_MAX = global i64 0
define i32 @main() {
%1 = alloca i64
%2 = load i64, i64* @UINT32_MAX
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = add nsw i64 %3, 1
store i64 %4, i64* %1
%5 = load i64, i64* %1
%6 = load i64, i64* @UINT32_MAX
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @__VERIFIER_assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@UINT32_MAX = global i64 0
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cos(double);
double luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_cos(void) {
  lua_pushnumber(cos(
      ((luaL_check_number(1)) * (((double)3.14159265358979323846) / 180.0))));
}


x86 assembly (clang, -O0):
<math_cos>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_cos>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mulsd  0xebd(%rip),%xmm0
call   1050 <cos@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_cos() {
%1 = call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = call i32 @cos(double %2)
%4 = call i32 @lua_pushnumber(i32 %3)
ret void
}

LLVM IR (-O2):
define void @math_cos() {
%1 = tail call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = tail call i32 @cos(double %2)
%4 = tail call i32 @lua_pushnumber(i32 %3)
ret void
}
int get_screen_col() {
  int col;
  return col;
}


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

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

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

LLVM IR (-O2):
define i32 @get_screen_col() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
void *shmat(int shmid, const void *shmaddr, int shmflg) {
  __set_errno(ENOSYS);
  return (void *)-1;
}


x86 assembly (clang, -O0):
<shmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffffffffffff,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmat>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i8* @shmat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i8* inttoptr (i64 -1 to i8*)
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i8* @shmat(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i8* inttoptr (i64 -1 to i8*)
}
void _on_bootstrap() {}


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

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

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

LLVM IR (-O2):
define void @_on_bootstrap() {
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
int is_abs_path(const char *path) {
  const char *p;
  p = strchr(path, ':');
  if (p)
    p++;
  else
    p = path;
  return *p == '/';
}


x86 assembly (clang, -O0):
<is_abs_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <is_abs_path+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <is_abs_path+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_abs_path>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3a,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
xor    %eax,%eax
cmpb   $0x2f,(%rcx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_abs_path(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ setsockopt(int const, int /*<<< orphan*/, int const,
                              int const *, int);
void sock_enopt(const int fd, const int optname) {
  static const int opt = 1;
  (void)setsockopt(fd, SOL_SOCKET, optname, &opt, sizeof(int));
}


x86 assembly (clang, -O0):
<sock_enopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
lea    0xecc(%rip),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_enopt>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
lea    0xede(%rip),%rcx
mov    $0x4,%r8d
jmp    1030 <setsockopt@plt>

LLVM IR (-O0):
@sock_enopt.opt = internal constant i32 1
@SOL_SOCKET = global i32 0
define void @sock_enopt(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 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* %4
%8 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i32* @sock_enopt.opt, i32 4)
ret void
}

LLVM IR (-O2):
@sock_enopt.opt = internal constant i32 1
@SOL_SOCKET = global i32 0
define void @sock_enopt(i32 %0, i32 %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = tail call i32 @setsockopt(i32 %0, i32 %3, i32 %1, i32* @sock_enopt.opt, i32 4)
ret void
}
void MSG_Plain_Footer(void) {}


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

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

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

LLVM IR (-O2):
define void @MSG_Plain_Footer() {
ret void
}
unsigned sizeint(int n) {
  unsigned size = (n < 0) ? 1 : 0;
  if (n == 0) {
    ++size;
  }
  while (n > 0) {
    ++size;
    n /= 10;
  }
  return size;
}


x86 assembly (clang, -O0):
<sizeint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112d <sizeint+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <sizeint+0x32>
cmpl   $0x0,-0x4(%rbp)
jle    1158 <sizeint+0x58>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1132 <sizeint+0x32>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeint>:
mov    %edi,%ecx
shr    $0x1f,%ecx
xor    %eax,%eax
test   %edi,%edi
sete   %al
add    %ecx,%eax
test   %edi,%edi
jle    1134 <sizeint+0x34>
mov    $0xcccccccd,%ecx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1120 <sizeint+0x20>
ret

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

LLVM IR (-O2):
define i32 @sizeint(i32 %0) {
%2 = lshr i32 %0, 31
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = add nuw nsw i32 %2, %4
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ %5, %1 ]
%9 = phi i32 [ %11, %7 ], [ %0, %1 ]
%10 = add i32 %8, 1
%11 = udiv i32 %9, 10
%12 = icmp ult i32 %9, 10
br i1 %12, label %13, label %7
13: ; preds = %7, %1
%14 = phi i32 [ %5, %1 ], [ %10, %7 ]
ret i32 %14
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_start_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(7, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_start_solutions_to_container>:
mov    $0x7,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @copy_start_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 7, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ hello();
int main(int argc, char *argv[]) {
  hello();
  exit(EXIT_SUCCESS);
}


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   1030 <hello@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <hello@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @hello()
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @hello()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int is_character(char c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
          (c >= '0' && c <= '9'));
}


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

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

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

LLVM IR (-O2):
define i32 @is_character(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct sk_node {
  int dummy;
};

/* Variables and functions */
struct sk_node *sk_insert_i(struct sk_node *root, int data) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.sk_node = type { i32 }
define %struct.sk_node* @sk_insert_i(%struct.sk_node* %0, i32 %1) {
%3 = alloca %struct.sk_node*
%4 = alloca i32
store %struct.sk_node* %0, %struct.sk_node** %3
store i32 %1, i32* %4
ret %struct.sk_node* null
}

LLVM IR (-O2):
%struct.sk_node = type { i32 }
define noalias %struct.sk_node* @sk_insert_i(%struct.sk_node* nocapture readnone %0, i32 %1) {
ret %struct.sk_node* null
}
/* Variables and functions */
int /*<<< orphan*/ TransformCounterC__0__CounterFrom__overflow();
int /*<<< orphan*/ TransformCounterC__1__CounterFrom__overflow();
void Msp430CounterC__0__Counter__overflow(void) {
  TransformCounterC__1__CounterFrom__overflow();
  TransformCounterC__0__CounterFrom__overflow();
}


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

x86 assembly (clang, -O2):
<Msp430CounterC__0__Counter__overflow>:
push   %rax
xor    %eax,%eax
call   1040 <TransformCounterC__1__CounterFrom__overflow@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <TransformCounterC__0__CounterFrom__overflow@plt>

LLVM IR (-O0):
define void @Msp430CounterC__0__Counter__overflow() {
%1 = call i32 (...) @TransformCounterC__1__CounterFrom__overflow()
%2 = call i32 (...) @TransformCounterC__0__CounterFrom__overflow()
ret void
}

LLVM IR (-O2):
define void @Msp430CounterC__0__Counter__overflow() {
%1 = tail call i32 (...) @TransformCounterC__1__CounterFrom__overflow()
%2 = tail call i32 (...) @TransformCounterC__0__CounterFrom__overflow()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long subwindow;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
void set_XEnterWindowEvent_subwindow(void *_p, unsigned long _v) {
  ((XEnterWindowEvent *)_p)->subwindow = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEnterWindowEvent_subwindow>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XEnterWindowEvent_subwindow(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XEnterWindowEvent_subwindow(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int strspn(char *, char *);
char *pe_utils_str_inplace_ltrim(char *str) {
  return str + strspn(str, " \f\n\r\t\v");
}


x86 assembly (clang, -O0):
<pe_utils_str_inplace_ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strspn@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pe_utils_str_inplace_ltrim>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strspn@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" \0C\0A\0D\09\0B\00"
define i8* @pe_utils_str_inplace_ltrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strspn(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
ret i8* %7
}

LLVM IR (-O2):
@.str = [7 x i8] c" \0C\0A\0D\09\0B\00"
define i8* @pe_utils_str_inplace_ltrim(i8* %0) {
%2 = tail call i32 @strspn(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
unsigned ZSTD_versionNumber(void) { return (0 * 100 * 100 + 8 * 100 + 0); }


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

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

LLVM IR (-O0):
define i32 @ZSTD_versionNumber() {
ret i32 800
}

LLVM IR (-O2):
define i32 @ZSTD_versionNumber() {
ret i32 800
}
/* Variables and functions */
int string_array_pos_case(char **, size_t, char const *);
int is_in_string_array_case(char *array[], size_t len, const char item[]) {
  const int pos = string_array_pos_case(array, len, item);
  return pos >= 0;
}


x86 assembly (clang, -O0):
<is_in_string_array_case>:
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
call   1030 <string_array_pos_case@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_string_array_case>:
push   %rax
call   1030 <string_array_pos_case@plt>
not    %eax
shr    $0x1f,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_in_string_array_case(i8** %0, i64 %1, i8* %2) {
%4 = tail call i32 @string_array_pos_case(i8** %0, i64 %1, i8* %2)
%5 = xor i32 %4, -1
%6 = lshr i32 %5, 31
ret i32 %6
}
void foo_2_1_2_1_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_2_2_1_2_1() {
ret void
}
/* Variables and functions */
size_t strtol(char const *, char **, int);
size_t parse_number_of_columns(const char *p) {
  size_t number_of_columns;
  char *q;
  number_of_columns = strtol(p, &q, 10);
  if (*q != '\0')
    number_of_columns = 0;
  return number_of_columns;
}


x86 assembly (clang, -O0):
<parse_number_of_columns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <parse_number_of_columns+0x3a>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_number_of_columns>:
push   %rax
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
xor    %edx,%edx
cmpb   $0x0,(%rcx)
cmovne %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @parse_number_of_columns(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strtol(i8* %5, i8** %4, i32 10)
store i64 %6, i64* %3
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i64 0, i64* %3
br label %12
12: ; preds = %11, %1
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @parse_number_of_columns(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i64 %4, i64 0
ret i64 %8
}
int main(void) {
  int n = 0;
  for (int i = 0; i < 10; i = i + 1) {
    n = n + i;
  }
  return n;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 45
}
int main() {
  int x = (-0x7fffffff - 1);
  int y = 0;
  int z;
  asm("" : "+g"(y));
  asm("" : "+g"(x));
  z = y - (-x);
  asm("" : "+g"(z));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x80000000,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x80000000,-0x8(%rsp)
80
movl   $0x0,-0xc(%rsp)
xor    %eax,%eax
mov    %eax,-0xc(%rsp)
mov    $0x80000000,%eax
mov    %eax,-0x8(%rsp)
add    -0xc(%rsp),%eax
mov    %eax,-0x4(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 -2147483648, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = sub nsw i32 0, %7
%9 = sub nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 -2147483648, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %7
store i32 %9, i32* %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cmdline_set_text(char *);
int /*<<< orphan*/ enter_command_mode();
void cmd_push(char *arg) {
  cmdline_set_text(arg);
  enter_command_mode();
}


x86 assembly (clang, -O0):
<cmd_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cmdline_set_text@plt>
mov    $0x0,%al
call   1040 <enter_command_mode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_push>:
push   %rax
call   1030 <cmdline_set_text@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <enter_command_mode@plt>

LLVM IR (-O0):
define void @cmd_push(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cmdline_set_text(i8* %3)
%5 = call i32 (...) @enter_command_mode()
ret void
}

LLVM IR (-O2):
define void @cmd_push(i8* %0) {
%2 = tail call i32 @cmdline_set_text(i8* %0)
%3 = tail call i32 (...) @enter_command_mode()
ret void
}
/* Type definitions */
struct avltree_node {
  int dummy;
};
struct avltree {
  int dummy;
};

/* Variables and functions */
struct avltree_node *do_lookup(struct avltree_node const *,
                               struct avltree const *, struct avltree_node **,
                               struct avltree_node **, int *);
struct avltree_node *avltree_lookup(const struct avltree_node *key,
                                    const struct avltree *tree) {
  struct avltree_node *parent, *unbalanced;
  int is_left;
  return do_lookup(key, tree, &parent, &unbalanced, &is_left);
}


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

x86 assembly (clang, -O2):
<avltree_lookup>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
call   1030 <do_lookup@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.avltree_node = type { i32 }
%struct.avltree = type { i32 }
define %struct.avltree_node* @avltree_lookup(%struct.avltree_node* %0, %struct.avltree* %1) {
%3 = alloca %struct.avltree_node*
%4 = alloca %struct.avltree*
%5 = alloca %struct.avltree_node*
%6 = alloca %struct.avltree_node*
%7 = alloca i32
store %struct.avltree_node* %0, %struct.avltree_node** %3
store %struct.avltree* %1, %struct.avltree** %4
%8 = load %struct.avltree_node*, %struct.avltree_node** %3
%9 = load %struct.avltree*, %struct.avltree** %4
%10 = call %struct.avltree_node* @do_lookup(%struct.avltree_node* %8, %struct.avltree* %9, %struct.avltree_node** %5, %struct.avltree_node** %6, i32* %7)
ret %struct.avltree_node* %10
}

LLVM IR (-O2):
%struct.avltree_node = type { i32 }
%struct.avltree = type { i32 }
define %struct.avltree_node* @avltree_lookup(%struct.avltree_node* %0, %struct.avltree* %1) {
%3 = alloca %struct.avltree_node*
%4 = alloca %struct.avltree_node*
%5 = alloca i32
%6 = bitcast %struct.avltree_node** %3 to i8*
%7 = bitcast %struct.avltree_node** %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call %struct.avltree_node* @do_lookup(%struct.avltree_node* %0, %struct.avltree* %1, %struct.avltree_node** %3, %struct.avltree_node** %4, i32* %5)
ret %struct.avltree_node* %9
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void GPIOIntEnable(uint32_t ui32Port, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(ui32Port + 0x00000410))) |= ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<GPIOIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x410(%rcx)
ret

LLVM IR (-O0):
define void @GPIOIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 1040
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @GPIOIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 1040
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
float flmax(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<flmax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <flmax+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <flmax+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flmax>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @flmax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void finish() { printf("Goodbye!\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"Goodbye!\00"
define void @finish() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int unfair();
int fair() {
  while (1) {
    int toss1 = unfair();
    int toss2 = unfair();
    if (toss1 != toss2)
      return toss1;
  }
}


x86 assembly (clang, -O0):
<fair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unfair@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <unfair@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1141 <fair+0x31>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1118 <fair+0x8>

x86 assembly (clang, -O2):
<fair>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <unfair@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <unfair@plt>
cmp    %eax,%ebx
je     1120 <fair+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fair() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %0, %11
%4 = call i32 (...) @unfair()
store i32 %4, i32* %1
%5 = call i32 (...) @unfair()
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i32, i32* %1
ret i32 %10
11: ; preds = %3
br label %3
}

LLVM IR (-O2):
define i32 @fair() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @unfair()
%3 = tail call i32 (...) @unfair()
%4 = icmp eq i32 %2, %3
br i1 %4, label %1, label %5
5: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int select_db(char const *, char const *, int);
int use_db(const char *u_name, const char *u_passwd, int Login) {
  int result = select_db(u_name, u_passwd, Login);
  if (result)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<use_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <select_db@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     114c <use_db+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <use_db+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_db>:
push   %rax
call   1030 <select_db@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @use_db(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @select_db(i8* %0, i8* %1, i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int do_669() { return 669; }


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

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

LLVM IR (-O0):
define i32 @do_669() {
ret i32 669
}

LLVM IR (-O2):
define i32 @do_669() {
ret i32 669
}
/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void LockDeviceConfig(void) {
  SendChar((0XEE) & 0xFF);
  SendChar((0x09) & 0xFF);
  SendChar((0xDE) & 0xFF);
  SendChar((0xED) & 0xFF);
  SendChar((0x13) & 0xFF);
  SendChar((0x31) & 0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<LockDeviceConfig>:
push   %rbp
mov    %rsp,%rbp
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x9,%edi
call   1030 <SendChar@plt>
mov    $0xde,%edi
call   1030 <SendChar@plt>
mov    $0xed,%edi
call   1030 <SendChar@plt>
mov    $0x13,%edi
call   1030 <SendChar@plt>
mov    $0x31,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LockDeviceConfig>:
push   %rax
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x9,%edi
call   1030 <SendChar@plt>
mov    $0xde,%edi
call   1030 <SendChar@plt>
mov    $0xed,%edi
call   1030 <SendChar@plt>
mov    $0x13,%edi
call   1030 <SendChar@plt>
mov    $0x31,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rax
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @LockDeviceConfig() {
%1 = call i32 @SendChar(i32 238)
%2 = call i32 @SendChar(i32 9)
%3 = call i32 @SendChar(i32 222)
%4 = call i32 @SendChar(i32 237)
%5 = call i32 @SendChar(i32 19)
%6 = call i32 @SendChar(i32 49)
%7 = call i32 @SendChar(i32 255)
%8 = call i32 @SendChar(i32 252)
%9 = call i32 @SendChar(i32 255)
%10 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @LockDeviceConfig() {
%1 = tail call i32 @SendChar(i32 238)
%2 = tail call i32 @SendChar(i32 9)
%3 = tail call i32 @SendChar(i32 222)
%4 = tail call i32 @SendChar(i32 237)
%5 = tail call i32 @SendChar(i32 19)
%6 = tail call i32 @SendChar(i32 49)
%7 = tail call i32 @SendChar(i32 255)
%8 = tail call i32 @SendChar(i32 252)
%9 = tail call i32 @SendChar(i32 255)
%10 = tail call i32 @SendChar(i32 255)
ret void
}
/* Variables and functions */
int matGetNextVariable_int_array_w_sz(int *, int **, int, unsigned char *, int);
int matGetNextVariable_uint_array_w_sz(int *outsz, unsigned int **out, int dsz,
                                       unsigned char *data_ptr, int nvals) {
  return matGetNextVariable_int_array_w_sz(outsz, (int **)out, dsz, data_ptr,
                                           nvals);
}


x86 assembly (clang, -O0):
<matGetNextVariable_uint_array_w_sz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <matGetNextVariable_int_array_w_sz@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @matGetNextVariable_uint_array_w_sz(i32* %0, i32** %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @matGetNextVariable_int_array_w_sz(i32* %0, i32** %1, i32 %2, i8* %3, i32 %4)
ret i32 %6
}
int test_imm_71int8_mem(signed char *val) {
  return ((*val) & (-0x71 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_71int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff8f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_71int8_mem>:
testb  $0x8f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_71int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -113
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}