xunge/DecIR huggingface dataset:
int do_603() { return 603; }


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

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

LLVM IR (-O0):
define i32 @do_603() {
ret i32 603
}

LLVM IR (-O2):
define i32 @do_603() {
ret i32 603
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int mylib_hello_world(void) {
  printf("mylib says: Hello World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"mylib says: Hello World!\0A\00"
define i32 @mylib_hello_world() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"mylib says: Hello World!\00"
define i32 @mylib_hello_world() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ json_valueList(char *, int *, char **, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *json_data(char *buffer, char *name, int *timestamps, char **values,
                int nbOfValues) {
  char payload[1024];
  json_valueList(payload, timestamps, values, nbOfValues);
  sprintf(buffer, "{\"%s\": %s}", name, payload);
  return buffer;
}


x86 assembly (clang, -O0):
<json_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <json_valueList@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0x430(%rbp),%rcx
lea    0xe94(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_data>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
call   1040 <json_valueList@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <sprintf@plt>
mov    %rbx,%rax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"{\22%s\22: %s}\00"
define i8* @json_data(i8* %0, i8* %1, i32* %2, i8** %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i8**
%10 = alloca i32
%11 = alloca [1024 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i8** %3, i8*** %9
store i32 %4, i32* %10
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%13 = load i32*, i32** %8
%14 = load i8**, i8*** %9
%15 = load i32, i32* %10
%16 = call i32 @json_valueList(i8* %12, i32* %13, i8** %14, i32 %15)
%17 = load i8*, i8** %6
%18 = load i8*, i8** %7
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%20 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19)
%21 = load i8*, i8** %6
ret i8* %21
}

LLVM IR (-O2):
@.str = [11 x i8] c"{\22%s\22: %s}\00"
define i8* @json_data(i8* returned writeonly %0, i8* %1, i32* %2, i8** %3, i32 %4) {
%6 = alloca [1024 x i8]
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%8 = call i32 @json_valueList(i8* %7, i32* %2, i8** %3, i32 %4)
%9 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %7)
ret i8* %0
}
void no_data() {}


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

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

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

LLVM IR (-O2):
define void @no_data() {
ret void
}
void mmc_crypto_prepare_req(struct mmc_queue_req *mqrq) {}


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

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

LLVM IR (-O0):
%struct.mmc_queue_req = type opaque
define void @mmc_crypto_prepare_req(%struct.mmc_queue_req* %0) {
%2 = alloca %struct.mmc_queue_req*
store %struct.mmc_queue_req* %0, %struct.mmc_queue_req** %2
ret void
}

LLVM IR (-O2):
%struct.mmc_queue_req = type opaque
define void @mmc_crypto_prepare_req(%struct.mmc_queue_req* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
int rest(int c) { return isalpha(c) || c == '_'; }


x86 assembly (clang, -O0):
<rest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <rest+0x2f>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rest>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 95
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @rest(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_TYPE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ANY_it;
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void ASN1_TYPE_free(ASN1_TYPE *a) {
  ASN1_item_free((ASN1_VALUE *)a, &ASN1_ANY_it);
}


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

x86 assembly (clang, -O2):
<ASN1_TYPE_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@ASN1_ANY_it = global i32 0
define void @ASN1_TYPE_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @ASN1_ANY_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum();
int main(int argc, char **argv) {
  printf("hello world %d\n", sum());
  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   1040 <sum@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"hello world %d\0A\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 (...) @sum()
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"hello world %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sum()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
_clenf(s) char *s;
{
  int n;
  for (n = 0; *s++ != '\0'; n++)
    ;
  return (n);
}


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

x86 assembly (clang, -O2):
<_clenf>:
cmpb   $0x0,(%rdi)
je     111c <_clenf+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <_clenf+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_clenf(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %4
br label %11
11: ; preds = %10
%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* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @_clenf(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__30__IO__set();
void Msp430GpioC__7__HplGeneralIO__set(void) {
  HplMsp430GeneralIOP__30__IO__set();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__7__HplGeneralIO__set() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__30__IO__set()
ret void
}
/* Variables and functions */
scalar_t__ COND_VS();
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_svs_8_aw(void) { m68ki_write_8(EA_AW_8(), COND_VS() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_svs_8_aw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AW_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_VS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_svs_8_aw>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AW_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_VS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_svs_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i64 (...) @COND_VS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_svs_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i64 (...) @COND_VS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void RC_cache_invalidate() { return; }


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

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

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

LLVM IR (-O2):
define void @RC_cache_invalidate() {
ret void
}
void RTSemMutexDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemMutexDestroy() {
ret void
}
int isxdigit(int c) {
  return ((unsigned)c - '0' < 10) | (((unsigned)c | 32) - 'a' < 6);
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
or     $0x20,%ecx
sub    $0x61,%ecx
cmp    $0x6,%ecx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
or     $0x20,%edi
add    $0xffffff9f,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 48
%5 = icmp ult i32 %4, 10
%6 = zext i1 %5 to i32
%7 = load i32, i32* %2
%8 = or i32 %7, 32
%9 = sub i32 %8, 97
%10 = icmp ult i32 %9, 6
%11 = zext i1 %10 to i32
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = or i32 %0, 32
%5 = add i32 %4, -97
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void ff_hevc_put_hevc_bi_qpel_h32_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_h32_10_sse4() {
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int handle_failure(char const *component) {
  fprintf(stderr, "%s failed", component);
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<handle_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_failure>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"%s failed\00"
@EXIT_FAILURE = global i32 0
define i32 @handle_failure(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s failed\00"
@EXIT_FAILURE = global i32 0
define i32 @handle_failure(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *openFile(char const *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, int);
FILE *openFileI(const char *a, const char *b, int i) {
  char ary[5000];
  snprintf(ary, 5000, "%s%d", b, i);
  return openFile(a, ary);
}


x86 assembly (clang, -O0):
<openFileI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x13a0(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x1388,%esi
lea    0xeaf(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x13a0(%rbp),%rsi
call   1030 <openFile@plt>
add    $0x13a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFileI>:
push   %r14
push   %rbx
sub    $0x1388,%rsp
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xec6(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x1388,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <openFile@plt>
add    $0x1388,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%d\00"
define i32* @openFileI(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [5000 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [5000 x i8], [5000 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @snprintf(i8* %8, i32 5000, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [5000 x i8], [5000 x i8]* %7, i64 0, i64 0
%14 = call i32* @openFile(i8* %12, i8* %13)
ret i32* %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%d\00"
define i32* @openFileI(i8* %0, i8* %1, i32 %2) {
%4 = alloca [5000 x i8]
%5 = getelementptr inbounds [5000 x i8], [5000 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 5000, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
%7 = call i32* @openFile(i8* %0, i8* %5)
ret i32* %7
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ printf(char *, long, long);
int main() {
  int sec = 1;
  struct timespec ts_start;
  struct timespec ts_end;
  clock_gettime(CLOCK_MONOTONIC, &ts_start);
  printf("%lu.%lu \n", (long)ts_start.tv_sec, (long)ts_start.tv_nsec);
  ts_end = ts_start;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x1,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
@.str = [10 x i8] c"%lu.%lu \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
store i32 1, i32* %1
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %9)
%11 = bitcast %struct.timespec* %3 to i8*
%12 = bitcast %struct.timespec* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
@.str = [10 x i8] c"%lu.%lu \0A\00"
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __mmask8;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_mask_fpclass_ss_mask(int /*<<< orphan*/,
                                            int /*<<< orphan*/, int);
__mmask8 test_mm_mask_fpclass_ss_mask(__mmask8 __U, __m128 __A) {
  return _mm_mask_fpclass_ss_mask(__U, __A, 2);
}


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

x86 assembly (clang, -O2):
<test_mm_mask_fpclass_ss_mask>:
mov    $0x2,%edx
jmp    1030 <_mm_mask_fpclass_ss_mask@plt>

LLVM IR (-O0):
define i32 @test_mm_mask_fpclass_ss_mask(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 = call i32 @_mm_mask_fpclass_ss_mask(i32 %5, i32 %6, i32 2)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_mask_fpclass_ss_mask(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mask_fpclass_ss_mask(i32 %0, i32 %1, i32 2)
ret i32 %3
}
void *current_sp_value(void *arg1, void *arg2, void *arg3, void *arg4,
                       void *arg5, void *arg6, void *arg7, void *arg8,
                       void *arg9) {
  return &arg9 - 9;
}


x86 assembly (clang, -O0):
<current_sp_value>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0x20(%rbp),%rax
add    $0xffffffffffffffb8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_sp_value>:
lea    -0x50(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @current_sp_value(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
store i8* %0, i8** %10
store i8* %1, i8** %11
store i8* %2, i8** %12
store i8* %3, i8** %13
store i8* %4, i8** %14
store i8* %5, i8** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i8* %8, i8** %18
%19 = getelementptr inbounds i8*, i8** %18, i64 -9
%20 = bitcast i8** %19 to i8*
ret i8* %20
}

LLVM IR (-O2):
define noalias i8* @current_sp_value(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6, i8* nocapture readnone %7, i8* %8) {
%10 = alloca i8*
%11 = getelementptr inbounds i8*, i8** %10, i64 -9
%12 = bitcast i8** %11 to i8*
ret i8* %12
}
void subtract(int *x, int *y, int *result) { *result = *x - *y; }


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

x86 assembly (clang, -O2):
<subtract>:
mov    (%rdi),%eax
sub    (%rsi),%eax
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @subtract(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = sub nsw i32 %4, %5
store i32 %6, i32* %2
ret void
}
int swap(int *a, int *b) {
  int t = *a;
  *a = *b;
  *b = t;
}


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

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

LLVM IR (-O0):
define i32 @swap(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %6
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stopHandler(int i) { printf("Stop Signal Catch\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Stop Signal Catch\0A\00"
define void @stopHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Stop Signal Catch\00"
define void @stopHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int v_klen(int /*<<< orphan*/);
int /*<<< orphan*/ v_lookup(int, char const *);
int v_len(int vs, const char *name) { return v_klen(v_lookup(vs, name)); }


x86 assembly (clang, -O0):
<v_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <v_lookup@plt>
mov    %eax,%edi
call   1030 <v_klen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_len>:
push   %rax
call   1040 <v_lookup@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <v_klen@plt>

LLVM IR (-O0):
define i32 @v_len(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 i8*, i8** %4
%7 = call i32 @v_lookup(i32 %5, i8* %6)
%8 = call i32 @v_klen(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @v_len(i32 %0, i8* %1) {
%3 = tail call i32 @v_lookup(i32 %0, i8* %1)
%4 = tail call i32 @v_klen(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_indent(int indent) {
  while (indent > 0) {
    printf("|");
    for (int i = 0; i < 5; ++i) {
      printf(" ");
    }
    indent -= 5;
  }
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    116a <print_indent+0x5a>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    115c <print_indent+0x4c>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <print_indent+0x28>
mov    -0x4(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <print_indent+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %rbx
test   %edi,%edi
jle    1164 <print_indent+0x54>
mov    %edi,%ebx
add    $0x5,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xfffffffb,%ebx
cmp    $0x5,%ebx
ja     1120 <print_indent+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ %0, %1 ]
%5 = tail call i32 @putchar(i32 124)
%6 = tail call i32 @putchar(i32 32)
%7 = tail call i32 @putchar(i32 32)
%8 = tail call i32 @putchar(i32 32)
%9 = tail call i32 @putchar(i32 32)
%10 = tail call i32 @putchar(i32 32)
%11 = add nsw i32 %4, -5
%12 = icmp ugt i32 %4, 5
br i1 %12, label %3, label %13
13: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_settype(char *);
void setascii(void) { do_settype("ascii"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"ascii\00"
define void @setascii() {
%1 = call i32 @do_settype(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ascii\00"
define void @setascii() {
%1 = tail call i32 @do_settype(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void empty(struct Foo *f) {}


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

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

LLVM IR (-O0):
%struct.Foo = type opaque
define void @empty(%struct.Foo* %0) {
%2 = alloca %struct.Foo*
store %struct.Foo* %0, %struct.Foo** %2
ret void
}

LLVM IR (-O2):
%struct.Foo = type opaque
define void @empty(%struct.Foo* nocapture %0) {
ret void
}
char toupper(c)
char c;
{ return islower(c) ? c - 32 : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     113f <toupper+0x2f>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <toupper+0x36>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movsbl %bl,%ebp
mov    %ebp,%edi
call   1030 <islower@plt>
add    $0xe0,%bpl
test   %eax,%eax
movzbl %bpl,%eax
cmove  %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @toupper(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 @islower(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %10, 32
br label %15
12: ; preds = %1
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
br label %15
15: ; preds = %12, %8
%16 = phi i32 [ %11, %8 ], [ %14, %12 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @toupper(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 @islower(i32 %3)
%5 = icmp eq i32 %4, 0
%6 = add i32 %0, 224
%7 = select i1 %5, i32 %0, i32 %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void null_close() { printf("close\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"close\00"
define void @null_close() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void ch8_EXIT() {
  printf("CH8 Exits...\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<ch8_EXIT>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"CH8 Exits...\0A\00"
define void @ch8_EXIT() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"CH8 Exits...\00"
define void @ch8_EXIT() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Prime numbers research tool\n"
         "\t-W <b>\tsearch Wagstaff prime of base b\n");
}


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

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

LLVM IR (-O0):
@.str = [69 x i8] c"Prime numbers research tool\0A\09-W <b>\09search Wagstaff prime of base b\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [68 x i8] c"Prime numbers research tool\0A\09-W <b>\09search Wagstaff prime of base b\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void glyph_WriteS16(FILE *output, int v) {
  fputc(v & 0xff, output);
  fputc((v & 0xff00) >> 8, output);
}


x86 assembly (clang, -O0):
<glyph_WriteS16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
and    $0xff00,%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glyph_WriteS16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @glyph_WriteS16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = load i32*, i32** %3
%8 = call i32 @fputc(i32 %6, i32* %7)
%9 = load i32, i32* %4
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = load i32*, i32** %3
%13 = call i32 @fputc(i32 %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @glyph_WriteS16(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @fputc(i32 %3, i32* %0)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %0)
ret void
}
/* Variables and functions */
int GetCurrentProcessId();
int wbt_getpid() { return GetCurrentProcessId(); }


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

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

LLVM IR (-O0):
define i32 @wbt_getpid() {
%1 = call i32 (...) @GetCurrentProcessId()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wbt_getpid() {
%1 = tail call i32 (...) @GetCurrentProcessId()
ret i32 %1
}
const char *skip_ws(const char *s) {
  while (*s == ' ' || *s == '\t' || *s == '\r' || *s == '\n')
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_ws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_ws+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_ws+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_ws+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <skip_ws+0x67>
jmp    1178 <skip_ws+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_ws+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ws>:
mov    %rdi,%rax
movabs $0x100002600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <skip_ws+0x25>
bt     %rdx,%rcx
jae    1125 <skip_ws+0x25>
add    $0x1,%rax
jmp    1110 <skip_ws+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_ws(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int);
int main(void) {
  printf("%d 7%%5: %d\n"
         "%d 7%%-5: %d\n"
         "%d -7%%5: %d\n"
         "%d -7%%-5: %d\n",
         7 / 5, 7 % 5, 7 / -5, 7 % -5, -7 / 5, -7 % 5, -7 % -5, -7 % -5);
  printf("%d 3%%5: %d\n"
         "%d 3%%-5: %d\n"
         "%d -3%%5: %d\n"
         "%d -3%%-5: %d\n",
         3 / 5, 3 % 5, 3 / -5, 3 % -5, -3 / 5, -3 % 5, -3 % -5, -3 % -5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%r8d
mov    $0xffffffff,%r9d
mov    %r8d,%edx
mov    %r9d,%ecx
movl   $0xfffffffe,(%rsp)
movl   $0xfffffffe,0x8(%rsp)
ff
movl   $0xfffffffe,0x10(%rsp)
ff
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
xor    %r9d,%r9d
mov    $0x3,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
mov    %r9d,%ecx
movl   $0xfffffffd,(%rsp)
movl   $0xfffffffd,0x8(%rsp)
ff
movl   $0xfffffffd,0x10(%rsp)
ff
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
lea    0xee4(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0xffffffff,%ecx
mov    $0x2,%r8d
mov    $0xffffffff,%r9d
push   $0xfffffffffffffffe
push   $0xfffffffffffffffe
push   $0xfffffffffffffffe
call   1030 <printf@plt>
add    $0x18,%rsp
lea    0xee8(%rip),%rdi
xor    %esi,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %r9d,%r9d
push   $0xfffffffffffffffd
push   $0xfffffffffffffffd
push   $0xfffffffffffffffd
call   1030 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [53 x i8] c"%d 7%%5: %d\0A%d 7%%-5: %d\0A%d -7%%5: %d\0A%d -7%%-5: %d\0A\00"
@.str.1 = [53 x i8] c"%d 3%%5: %d\0A%d 3%%-5: %d\0A%d -3%%5: %d\0A%d -3%%-5: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 -1, i32 2, i32 -1, i32 -2, i32 -2, i32 -2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 3, i32 0, i32 3, i32 0, i32 -3, i32 -3, i32 -3)
ret i32 0
}
int hiddenSectors(char one, char two) {
  char num[1];
  num[0] = two;
  num[1] = one;
  int b = (num[0] << 8) | num[1];
  return b;
}


x86 assembly (clang, -O0):
<hiddenSectors>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movsbl -0x3(%rbp),%eax
shl    $0x8,%eax
movsbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hiddenSectors(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca [1 x i8]
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i8, i8* %3
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = or i32 %14, %17
store i32 %18, i32* %6
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
define i32 @hiddenSectors(i8 signext %0, i8 signext %1) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  if (a % 2 == 0) {
    printf("%d\n", a);
  } else {
    printf("%d\n", a - 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <main+0x47>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x59>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
and    $0xfffffffe,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %14
10: ; preds = %0
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, -2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}