xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char const *, ...);
int /*<<< orphan*/ stdout;
void fmtst2chk(const char *fmt) {
  (void)fputs(fmt, stdout);
  (void)printf(":\t`");
  (void)printf(fmt, 4, 4, 0x12);
  (void)printf("'\n");
}


x86 assembly (clang, -O0):
<fmtst2chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%edx
mov    $0x12,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmtst2chk>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1050 <fputs@plt>
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
mov    $0x12,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c":\09`\00"
@.str.1 = [3 x i8] c"'\0A\00"
define void @fmtst2chk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* %7, i32 4, i32 4, i32 18)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c":\09`\00"
@str = [2 x i8] c"'\00"
define void @fmtst2chk(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 4, i32 4, i32 18)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
int dbd_get_compiler(char **argv, char ***compile_args) {}


x86 assembly (clang, -O0):
<dbd_get_compiler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dbd_get_compiler(i8** nocapture readnone %0, i8*** nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double atan2l(long double y, long double x) {
  return __infer_nondet_long_double();
}


x86 assembly (clang, -O0):
<atan2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @atan2l(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @atan2l(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void PrintTwoNumbers(int (*numberSource)(void)) {
  printf("%d and %d\n", numberSource(), numberSource());
}


x86 assembly (clang, -O0):
<PrintTwoNumbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
mov    %eax,-0xc(%rbp)
call   *-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintTwoNumbers>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   *%rdi
mov    %eax,%ebp
call   *%rbx
lea    0xedd(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d and %d\0A\00"
define void @PrintTwoNumbers(i32 ()* nocapture %0) {
%2 = tail call i32 %0()
%3 = tail call i32 %0()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret void
}
/* Type definitions */
struct mpd_error_info {
  int dummy;
};

/* Variables and functions */
bool mpd_socket_global_init(struct mpd_error_info *error) {
  (void)error;
  return true;
}


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

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

LLVM IR (-O0):
%struct.mpd_error_info = type { i32 }
define i32 @mpd_socket_global_init(%struct.mpd_error_info* %0) {
%2 = alloca %struct.mpd_error_info*
store %struct.mpd_error_info* %0, %struct.mpd_error_info** %2
%3 = load %struct.mpd_error_info*, %struct.mpd_error_info** %2
ret i32 1
}

LLVM IR (-O2):
%struct.mpd_error_info = type { i32 }
define i32 @mpd_socket_global_init(%struct.mpd_error_info* nocapture readnone %0) {
ret i32 1
}
int B(int x, int y) {
  int g, h, i;
  printf("enter B\n");
  printf("&g: %x\n&h: %x\n&i: %x\n", &g, &h, &i);
  g = 6;
  h = 7;
  i = 8;
  C(g, h);
  printf("exit B\n");
}


x86 assembly (clang, -O0):
<B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x6,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1040 <C@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B>:
sub    $0x18,%rsp
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x6,0x14(%rsp)
movl   $0x7,0x10(%rsp)
movl   $0x8,0xc(%rsp)
mov    $0x6,%edi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <C@plt>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"enter B\0A\00"
@.str.1 = [22 x i8] c"&g: %x\0A&h: %x\0A&i: %x\0A\00"
@.str.2 = [8 x i8] c"exit B\0A\00"
define i32 @B(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
store i32 6, i32* %6
store i32 7, i32* %7
store i32 8, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @C to i32 (i32, i32, ...)*)(i32 %11, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"&g: %x\0A&h: %x\0A&i: %x\0A\00"
@str = [8 x i8] c"enter B\00"
@str.3 = [7 x i8] c"exit B\00"
define i32 @B(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
store i32 6, i32* %3
store i32 7, i32* %4
store i32 8, i32* %5
%11 = call i32 (i32, i32, ...) bitcast (i32 (...)* @C to i32 (i32, i32, ...)*)(i32 6, i32 7)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
ret i32 undef
}
struct timeval *dhcp_timeleft(struct dhcp_t *this, struct timeval *tvp) {
  (void)this;
  return tvp;
}


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

x86 assembly (clang, -O2):
<dhcp_timeleft>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
%struct.dhcp_t = type opaque
%struct.timeval = type opaque
define %struct.timeval* @dhcp_timeleft(%struct.dhcp_t* %0, %struct.timeval* %1) {
%3 = alloca %struct.dhcp_t*
%4 = alloca %struct.timeval*
store %struct.dhcp_t* %0, %struct.dhcp_t** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.dhcp_t*, %struct.dhcp_t** %3
%6 = load %struct.timeval*, %struct.timeval** %4
ret %struct.timeval* %6
}

LLVM IR (-O2):
%struct.dhcp_t = type opaque
%struct.timeval = type opaque
define %struct.timeval* @dhcp_timeleft(%struct.dhcp_t* nocapture readnone %0, %struct.timeval* readnone returned %1) {
ret %struct.timeval* %1
}
int test_imm_20int16_reg(short val) {
  return ((val) & (-0x20 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_20int16_reg>:
cmp    $0x20,%di
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_20int16_reg(i16 signext %0) {
%2 = icmp ult i16 %0, 32
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
int ignore(char *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ignore(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cgpop2();
int /*<<< orphan*/ cgshr();
int /*<<< orphan*/ cgswap();
int /*<<< orphan*/ gentext();
void genshr(int swap) {
  gentext();
  cgpop2();
  if (swap)
    cgswap();
  cgshr();
}


x86 assembly (clang, -O0):
<genshr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <gentext@plt>
mov    $0x0,%al
call   1040 <cgpop2@plt>
cmpl   $0x0,-0x4(%rbp)
je     116a <genshr+0x2a>
mov    $0x0,%al
call   1030 <cgswap@plt>
mov    $0x0,%al
call   1050 <cgshr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genshr>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <gentext@plt>
xor    %eax,%eax
call   1040 <cgpop2@plt>
test   %ebx,%ebx
je     115c <genshr+0x1c>
xor    %eax,%eax
call   1030 <cgswap@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <cgshr@plt>

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

LLVM IR (-O2):
define void @genshr(i32 %0) {
%2 = tail call i32 (...) @gentext()
%3 = tail call i32 (...) @cgpop2()
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @cgswap()
br label %7
7: ; preds = %5, %1
%8 = tail call i32 (...) @cgshr()
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
           struct timeval *timeout) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<select>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @select(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, %struct.timeval* nocapture readnone %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
/* Variables and functions */
unsigned int _blsi_u32(unsigned int);
unsigned int func_blsi32_2(unsigned int X) { return _blsi_u32(X); }


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

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

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

LLVM IR (-O2):
define i32 @func_blsi32_2(i32 %0) {
%2 = tail call i32 @_blsi_u32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int *twoSum(int *, int, int /*<<< orphan*/);
int main() {
  int mNums[4] = {-3, 4, 3, 90};
  int *mResult = twoSum(mNums, 4, 0);
  printf("[%d,%d]", mResult[0], mResult[1]);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <twoSum@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <twoSum@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.mNums = [4 x i32] [i32 -3, i32 4, i32 3, i32 90]
@.str = [8 x i8] c"[%d,%d]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%6 = call i32* @twoSum(i32* %5, i32 4, i32 0)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12)
ret i32 1
}

LLVM IR (-O2):
@__const.main.mNums = [4 x i32] [i32 -3, i32 4, i32 3, i32 90]
@.str = [8 x i8] c"[%d,%d]\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32* @twoSum(i32* %3, i32 4, i32 0)
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ test6_f();
void test6_foo(void) { test6_f(); }


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

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

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

LLVM IR (-O2):
define void @test6_foo() {
%1 = tail call i32 (...) @test6_f()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @close_i2c(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
int is_open(int fd) {
  int n = 0;
  ioctl(fd, FIONREAD, &n);
  return n != 0;
}


x86 assembly (clang, -O0):
<is_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_open>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
xor    %eax,%eax
cmpl   $0x0,0x4(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i32 @is_open(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONREAD
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @is_open(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @FIONREAD
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
f(x) {
  int *(p[25]);
  int m[25 * 7];
  int i;
  for (i = 0; i < 25; i++)
    p[i] = m + x * i;
  p[1][0] = 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x320,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x394(%rbp)
cmpl   $0x19,-0x394(%rbp)
jge    1162 <f+0x62>
lea    -0x390(%rbp),%rcx
mov    -0x8(%rbp),%eax
imul   -0x394(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
movslq -0x394(%rbp),%rax
mov    %rcx,-0xd0(%rbp,%rax,8)
ff
mov    -0x394(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x394(%rbp)
jmp    1118 <f+0x18>
mov    -0xc8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x320,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump_data_dec(unsigned char *buf, int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%c", buf[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_data_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <dump_data_dec+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_data_dec+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_data_dec>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <dump_data_dec+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <dump_data_dec+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @dump_data_dec(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_btbasedir(char *s) { return (char *)mock(s); }


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

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

LLVM IR (-O0):
define i8* @cf_s_btbasedir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_btbasedir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ b();
int main(int argc, char **argv) {
  b();
  b();
  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   1030 <b@plt>
mov    $0x0,%al
call   1030 <b@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
call   1030 <b@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 (...) @b()
%7 = call i32 (...) @b()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @b()
%4 = tail call i32 (...) @b()
ret i32 0
}
SzToStInPlace(pch) char *pch;
{
  int cch = strlen(pch);
  bltb(pch, pch + 1, cch);
  *pch = cch;
}


x86 assembly (clang, -O0):
<SzToStInPlace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <bltb@plt>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SzToStInPlace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r14
lea    0x1(%rbx),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <bltb@plt>
mov    %r14b,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @SzToStInPlace(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i32, i32* %4
%12 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bltb to i32 (i8*, i8*, i32, ...)*)(i8* %8, i8* %10, i32 %11)
%13 = load i32, i32* %4
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
store i8 %14, i8* %15
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @SzToStInPlace(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bltb to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %4, i32 %3)
%6 = trunc i64 %2 to i8
store i8 %6, i8* %0
ret i32 undef
}
float quantum_imag(float _Complex a) {
  float *p = (float *)&a;
  return p[1];
}


x86 assembly (clang, -O0):
<quantum_imag>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantum_imag>:
shufps $0x55,%xmm0,%xmm0
ret

LLVM IR (-O0):
define float @quantum_imag(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca float*
%4 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = bitcast { float, float }* %2 to float*
store float* %5, float** %3
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 1
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @quantum_imag(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 1
ret float %2
}
double f4_sum_pre_int_int(int v0, int v) { return (double)v0 + ((double)(v)); }


x86 assembly (clang, -O0):
<f4_sum_pre_int_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int(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 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fadd double %3, %4
ret double %5
}
int cs_diag(int i, int j, double aij, void *other) {
  return (i != j);
  (void)aij;
  (void)other;
}


x86 assembly (clang, -O0):
<cs_diag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_diag>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @cs_diag(i32 %0, i32 %1, double %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp ne i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cs_diag(i32 %0, i32 %1, double %2, i8* nocapture readnone %3) {
%5 = icmp ne i32 %0, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_help(void) { fprintf(stderr, "usage: scinf\n"); }


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"usage: scinf\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"usage: scinf\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *safe_allocate() {
  int *p = NULL;
  while (!p) {
    p = (int *)malloc(sizeof(int));
  }
  return p;
}


x86 assembly (clang, -O0):
<safe_allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1137 <safe_allocate+0x27>
jmp    114a <safe_allocate+0x3a>
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1120 <safe_allocate+0x10>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_allocate>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1120 <safe_allocate+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32* @safe_allocate() {
%1 = alloca i32*
store i32* null, i32** %1
br label %2
2: ; preds = %6, %0
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
%5 = xor i1 %4, true
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = call i64 @malloc(i32 4)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %1
br label %2
9: ; preds = %2
%10 = load i32*, i32** %1
ret i32* %10
}

LLVM IR (-O2):
define i32* @safe_allocate() {
br label %1
1: ; preds = %0, %1
%2 = tail call i64 @malloc(i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i32*
ret i32* %5
}
void internal2(void) {}


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

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

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

LLVM IR (-O2):
define void @internal2() {
ret void
}
int findComplement(int num) {
  int k = 0;
  for (k; num >> k; ++k)
    ;
  return ((~num) & ((1 << k) - 1));
}


x86 assembly (clang, -O0):
<findComplement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
cmp    $0x0,%eax
je     1132 <findComplement+0x32>
jmp    1124 <findComplement+0x24>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <findComplement+0xe>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findComplement>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    %edi,%eax
sar    %cl,%eax
test   %eax,%eax
jne    1110 <findComplement+0x10>
mov    $0xffffffff,%eax
shl    %cl,%eax
or     %edi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @findComplement(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = ashr i32 %0, %3
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = shl nsw i32 -1, %3
%9 = or i32 %8, %0
%10 = xor i32 %9, -1
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test2(uint8_t *c, uint16_t *d) {
  printf("Works\n");
  return 3;
}


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

x86 assembly (clang, -O2):
<test2>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"Works\00"
define i32 @test2(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int symcmp(const void *key1, const void *key2) {
  const char *keyp1, *keyp2;
  keyp1 = key1;
  keyp2 = key2;
  return strcmp(keyp1, keyp2);
}


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

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

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

LLVM IR (-O2):
define i32 @symcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
scalar_t__ system(char *);
int run_ifconfig(char *ifconfig) {
  char nt[1024 + 1];
  snprintf(nt, 1024, "ifconfig %s | grep PROMISC > /dev/null 2>&1", ifconfig);
  if (system(nt) == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<run_ifconfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x400,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x420(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
jne    116d <run_ifconfig+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <run_ifconfig+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_ifconfig>:
push   %rbx
sub    $0x410,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"ifconfig %s | grep PROMISC > /dev/null 2>&1\00"
define i32 @run_ifconfig(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [1025 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @snprintf(i8* %5, i32 1024, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 0
%9 = call i64 @system(i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [44 x i8] c"ifconfig %s | grep PROMISC > /dev/null 2>&1\00"
define i32 @run_ifconfig(i8* %0) {
%2 = alloca [1025 x i8]
%3 = getelementptr inbounds [1025 x i8], [1025 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 1024, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i64 @system(i8* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void clear_bit(int nr, volatile void *addr) {
  int mask;
  volatile unsigned int *a = addr;
  unsigned long flags;
  a += nr >> 5;
  mask = 1 << (nr & 0x1f);
  local_irq_save(flags);
  *a &= ~mask;
  local_irq_restore(flags);
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1030 <local_irq_save@plt>
mov    -0x14(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1040 <local_irq_restore@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %edi,%eax
sar    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <local_irq_save@plt>
mov    $0xfffffffe,%eax
mov    %ebp,%ecx
rol    %cl,%eax
and    %eax,(%r14,%rbx,4)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <local_irq_restore@plt>

LLVM IR (-O0):
define void @clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %6
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = load i32*, i32** %6
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32* %14, i32** %6
%15 = load i32, i32* %3
%16 = and i32 %15, 31
%17 = shl i32 1, %16
store i32 %17, i32* %5
%18 = load i64, i64* %7
%19 = call i32 (i64, ...) bitcast (i32 (...)* @local_irq_save to i32 (i64, ...)*)(i64 %18)
%20 = load i32, i32* %5
%21 = xor i32 %20, -1
%22 = load i32*, i32** %6
%23 = load volatile i32, i32* %22
%24 = and i32 %23, %21
store volatile i32 %24, i32* %22
%25 = load i64, i64* %7
%26 = call i32 (i64, ...) bitcast (i32 (...)* @local_irq_restore to i32 (i64, ...)*)(i64 %25)
ret void
}

LLVM IR (-O2):
define void @clear_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 5
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = and i32 %0, 31
%8 = shl nuw i32 1, %7
%9 = tail call i32 (i64, ...) bitcast (i32 (...)* @local_irq_save to i32 (i64, ...)*)(i64 undef)
%10 = xor i32 %8, -1
%11 = load volatile i32, i32* %6
%12 = and i32 %11, %10
store volatile i32 %12, i32* %6
%13 = tail call i32 (i64, ...) bitcast (i32 (...)* @local_irq_restore to i32 (i64, ...)*)(i64 undef)
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ inet_pton(int /*<<< orphan*/, char const *, void *);
int inet_aton(const char *cp, struct in_addr *inp) {
  return inet_pton(AF_INET, cp, (void *)inp) > 0;
}


x86 assembly (clang, -O0):
<inet_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <inet_pton@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_aton>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
call   1030 <inet_pton@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i32 @inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = alloca i8*
%4 = alloca %struct.in_addr*
store i8* %0, i8** %3
store %struct.in_addr* %1, %struct.in_addr** %4
%5 = load i32, i32* @AF_INET
%6 = load i8*, i8** %3
%7 = load %struct.in_addr*, %struct.in_addr** %4
%8 = bitcast %struct.in_addr* %7 to i8*
%9 = call i64 @inet_pton(i32 %5, i8* %6, i8* %8)
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i32 @inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = load i32, i32* @AF_INET
%4 = bitcast %struct.in_addr* %1 to i8*
%5 = tail call i64 @inet_pton(i32 %3, i8* %0, i8* %4)
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void gcode_parce(void) {}


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

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

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

LLVM IR (-O2):
define void @gcode_parce() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void go_free(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @go_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ EEXIST;
scalar_t__ errno;
scalar_t__ mkdir(char const *, int);
int util_mkdir(const char *directory, int mode) {
  if (!directory)
    return 0;
  if (mkdir(directory, mode) < 0) {
    if (errno != EEXIST)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<util_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <util_mkdir+0x26>
movl   $0x0,-0x4(%rbp)
jmp    117e <util_mkdir+0x6e>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
jge    1177 <util_mkdir+0x67>
mov    0x2e85(%rip),%rax
mov    (%rax),%rax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
je     1172 <util_mkdir+0x62>
movl   $0x0,-0x4(%rbp)
jmp    117e <util_mkdir+0x6e>
jmp    1177 <util_mkdir+0x67>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_mkdir>:
push   %rbx
xor    %ebx,%ebx
test   %rdi,%rdi
je     113d <util_mkdir+0x2d>
call   1030 <mkdir@plt>
test   %rax,%rax
jns    1138 <util_mkdir+0x28>
mov    0x2eaf(%rip),%rax
mov    (%rax),%rax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%rax
jne    113d <util_mkdir+0x2d>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @util_mkdir(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
store i32 0, i32* %3
br label %21
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i64 @mkdir(i8* %10, i32 %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i64, i64* @errno
%16 = load i64, i64* @EEXIST
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 0, i32* %3
br label %21
19: ; preds = %14
br label %20
20: ; preds = %19, %9
store i32 1, i32* %3
br label %21
21: ; preds = %20, %18, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @util_mkdir(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i64 @mkdir(i8* %0, i32 %1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EEXIST
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7, %4
br label %12
12: ; preds = %7, %2, %11
%13 = phi i32 [ 1, %11 ], [ 0, %2 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ MsgBox27(char const *);
void msgbox(const char *s) { MsgBox27(s); }


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

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

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

LLVM IR (-O2):
define void @msgbox(i8* %0) {
%2 = tail call i32 @MsgBox27(i8* %0)
ret void
}