xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ __bswap_variable_64(int /*<<< orphan*/);
__attribute__((always_)) void __bswap_64s(uint64_t *x) {
  *x = __bswap_variable_64(*x);
}


x86 assembly (clang, -O0):
<__bswap_64s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <__bswap_variable_64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bswap_64s>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <__bswap_variable_64@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__bswap_64s(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @__bswap_variable_64(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ bsR(int);
unsigned char bsGetUChar(void) { return (unsigned char)bsR(8); }


x86 assembly (clang, -O0):
<bsGetUChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <bsR@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsGetUChar>:
push   %rax
mov    $0x8,%edi
call   1030 <bsR@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @bsGetUChar() {
%1 = call i64 @bsR(i32 8)
%2 = trunc i64 %1 to i8
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @bsGetUChar() {
%1 = tail call i64 @bsR(i32 8)
%2 = trunc i64 %1 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ usl_signal_notify(int);
void usl_sigusr2(int sig) { usl_signal_notify(sig); }


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

x86 assembly (clang, -O2):
<usl_sigusr2>:
jmp    1030 <usl_signal_notify@plt>

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

LLVM IR (-O2):
define void @usl_sigusr2(i32 %0) {
%2 = tail call i32 @usl_signal_notify(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(unsigned long);
int /*<<< orphan*/ rtx_dbug_outs(char *);
void rtx_dbug_outs_int(char *s, unsigned long int n) {
  rtx_dbug_outs(s);
  print_int(n);
  rtx_dbug_outs("\r\n");
}


x86 assembly (clang, -O0):
<rtx_dbug_outs_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rtx_dbug_outs@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print_int@plt>
lea    0xeb7(%rip),%rdi
call   1030 <rtx_dbug_outs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtx_dbug_outs_int>:
push   %rbx
mov    %rsi,%rbx
call   1030 <rtx_dbug_outs@plt>
mov    %rbx,%rdi
call   1040 <print_int@plt>
lea    0xec8(%rip),%rdi
pop    %rbx
jmp    1030 <rtx_dbug_outs@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @rtx_dbug_outs_int(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @rtx_dbug_outs(i8* %5)
%7 = load i64, i64* %4
%8 = call i32 @print_int(i64 %7)
%9 = call i32 @rtx_dbug_outs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @rtx_dbug_outs_int(i8* %0, i64 %1) {
%3 = tail call i32 @rtx_dbug_outs(i8* %0)
%4 = tail call i32 @print_int(i64 %1)
%5 = tail call i32 @rtx_dbug_outs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_02(volatile int *x) { return x[5]; }


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

x86 assembly (clang, -O2):
<test_02>:
mov    0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test_02(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_02(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load volatile i32, i32* %2
ret i32 %3
}
int is_leap(unsigned y) {
  y += 1900;
  return (y % 4) == 0 && ((y % 100) != 0 || (y % 400) == 0);
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    115b <is_leap+0x5b>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    1155 <is_leap+0x55>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap+0x9>
ret
add    $0x76c,%edi
imul   $0xc28f5c29,%edi,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1900
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = urem i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 100
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = urem i32 %13, 400
%15 = icmp eq i32 %14, 0
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ true, %8 ], [ %15, %12 ]
br label %18
18: ; preds = %16, %1
%19 = phi i1 [ false, %1 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = add i32 %0, 1900
%3 = and i32 %0, 3
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = urem i32 %2, 100
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = urem i32 %2, 400
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %8, %1
%13 = phi i32 [ 0, %1 ], [ 1, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_serial_close();
int drv_EA232graphic_close(void) {
  drv_generic_serial_close();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @drv_EA232graphic_close() {
%1 = call i32 (...) @drv_generic_serial_close()
ret i32 0
}

LLVM IR (-O2):
define i32 @drv_EA232graphic_close() {
%1 = tail call i32 (...) @drv_generic_serial_close()
ret i32 0
}
void foo_1_2_2_1_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_1_1_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void spAppend(char *buf, char *str) {
  if (buf[0] == '\0') {
    strcpy(buf, str);
  } else {
    strcat(buf, " ");
    strcat(buf, str);
  }
}


x86 assembly (clang, -O0):
<spAppend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1152 <spAppend+0x32>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    116f <spAppend+0x4f>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spAppend>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1150 <spAppend+0x30>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @spAppend(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %10
7: ; preds = %2
%8 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @strcat(i8* %0, i8* %1)
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int aty_ld_le32(int);
int ati_is_interlace(void) { return aty_ld_le32(0x001C) & 0x00000002; }


x86 assembly (clang, -O0):
<ati_is_interlace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
call   1030 <aty_ld_le32@plt>
and    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ati_is_interlace>:
push   %rax
mov    $0x1c,%edi
call   1030 <aty_ld_le32@plt>
and    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ati_is_interlace() {
%1 = call i32 @aty_ld_le32(i32 28)
%2 = and i32 %1, 2
ret i32 %2
}

LLVM IR (-O2):
define i32 @ati_is_interlace() {
%1 = tail call i32 @aty_ld_le32(i32 28)
%2 = and i32 %1, 2
ret i32 %2
}
int fn1(int *p) {
  int i = p;
  i = p;
  fn2(p);
  return p;
}


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

x86 assembly (clang, -O2):
<fn1>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <fn2@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fn1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = ptrtoint i32* %4 to i32
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = ptrtoint i32* %6 to i32
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @fn2 to i32 (i32*, ...)*)(i32* %8)
%10 = load i32*, i32** %2
%11 = ptrtoint i32* %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @fn1(i32* %0) {
%2 = tail call i32 (i32*, ...) bitcast (i32 (...)* @fn2 to i32 (i32*, ...)*)(i32* %0)
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *read_key(char const *, char const *, int);
char *textfile_caseget(const char *pathname, const char *key) {
  return read_key(pathname, key, 1);
}


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

x86 assembly (clang, -O2):
<textfile_caseget>:
mov    $0x1,%edx
jmp    1030 <read_key@plt>

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

LLVM IR (-O2):
define i8* @textfile_caseget(i8* %0, i8* %1) {
%3 = tail call i8* @read_key(i8* %0, i8* %1, i32 1)
ret i8* %3
}
float f(float x) { return x * (x > 0.f ? -1.f : 1.f); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xee5(%rip),%xmm4
movss  0xee1(%rip),%xmm3
xorps  %xmm1,%xmm1
cmpltss %xmm2,%xmm1
movaps %xmm1,%xmm2
andps  %xmm4,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm1,%xmm1
cmpltss %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp ogt float %4, 0.000000e+00
%6 = zext i1 %5 to i64
%7 = select i1 %5, float -1.000000e+00, float 1.000000e+00
%8 = fmul float %3, %7
ret float %8
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DH;

/* Variables and functions */
int PEM_ASN1_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, void *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_DHPARAMS;
scalar_t__ i2d_DHparams;
int PEM_write_DHparams(FILE *fp, const DH *x) {
  return PEM_ASN1_write((i2d_of_void *)i2d_DHparams, PEM_STRING_DHPARAMS, fp,
                        (void *)x, NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_DHparams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%rdi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_DHparams>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec7(%rip),%rax
mov    (%rax),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_DHparams = global i64 0
@PEM_STRING_DHPARAMS = global i32 0
define i32 @PEM_write_DHparams(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_DHparams
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_DHPARAMS
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = bitcast i32* %9 to i8*
%11 = call i32 @PEM_ASN1_write(i32* %6, i32 %7, i32* %8, i8* %10, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %11
}

LLVM IR (-O2):
@i2d_DHparams = global i64 0
@PEM_STRING_DHPARAMS = global i32 0
define i32 @PEM_write_DHparams(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_DHparams
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_DHPARAMS
%6 = bitcast i32* %1 to i8*
%7 = tail call i32 @PEM_ASN1_write(i32* %4, i32 %5, i32* %0, i8* %6, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %7
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ inet_pton(int /*<<< orphan*/, char const *, struct in_addr *);
int isvalip4(const char *ip) {
  struct in_addr adr;
  if (ip == NULL)
    return 0;
  return (inet_pton(AF_INET, ip, &adr) > 0);
}


x86 assembly (clang, -O0):
<isvalip4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <isvalip4+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1158 <isvalip4+0x48>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <inet_pton@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvalip4>:
test   %rdi,%rdi
je     113a <isvalip4+0x2a>
push   %rax
mov    %rdi,%rsi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
call   1030 <inet_pton@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i32 @isvalip4(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.in_addr
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* @AF_INET
%10 = load i8*, i8** %3
%11 = call i64 @inet_pton(i32 %9, i8* %10, %struct.in_addr* %4)
%12 = icmp sgt i64 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i32 @isvalip4(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @AF_INET
%7 = call i64 @inet_pton(i32 %6, i8* %0, %struct.in_addr* %2)
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void setnewconf(void) { nocall("setnewconf"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"setnewconf\00"
define void @setnewconf() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  double tv_sec;
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ clock_gettime(int, struct timespec *);
double get_time(int clock) {
  struct timespec ts;
  clock_gettime(clock, &ts);
  return ts.tv_sec + (ts.tv_nsec / 1000000000.0);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed4(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, double }
define double @get_time(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %3)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+09
%11 = fadd double %7, %10
ret double %11
}

LLVM IR (-O2):
%struct.timespec = type { double, double }
define double @get_time(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = call i32 @clock_gettime(i32 %0, %struct.timespec* %2)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+09
%10 = fadd double %6, %9
ret double %10
}
int test_imm_53int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x53 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_53int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5439488
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test_plot_create_dataframe();
int /*<<< orphan*/ test_plot_dataframe_slice();
int /*<<< orphan*/ test_plot_save();
void run_plot_tests() {
  test_plot_create_dataframe();
  test_plot_dataframe_slice();
  test_plot_save();
}


x86 assembly (clang, -O0):
<run_plot_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_plot_create_dataframe@plt>
mov    $0x0,%al
call   1030 <test_plot_dataframe_slice@plt>
mov    $0x0,%al
call   1050 <test_plot_save@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_plot_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_plot_create_dataframe@plt>
xor    %eax,%eax
call   1030 <test_plot_dataframe_slice@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_plot_save@plt>

LLVM IR (-O0):
define void @run_plot_tests() {
%1 = call i32 (...) @test_plot_create_dataframe()
%2 = call i32 (...) @test_plot_dataframe_slice()
%3 = call i32 (...) @test_plot_save()
ret void
}

LLVM IR (-O2):
define void @run_plot_tests() {
%1 = tail call i32 (...) @test_plot_create_dataframe()
%2 = tail call i32 (...) @test_plot_dataframe_slice()
%3 = tail call i32 (...) @test_plot_save()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void set_bit(uint8_t *a, unsigned int bit) { a[bit / 8] |= (1 << (bit % 8)); }


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x3,%esi
or     %eax,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @set_bit(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 = urem i32 %5, 8
%7 = shl i32 1, %6
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = udiv i32 %9, 8
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %12
%14 = or i32 %13, %7
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @set_bit(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = lshr i32 %1, 3
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %4
store i32 %9, i32* %7
ret void
}
/* Type definitions */
typedef scalar_t__ x;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t ntp32_substract(uint32_t x, uint32_t y) {
  return ((x) > (y)) ? ((x) - (y)) : (((x) - (y)) + 0x7fffffff);
}


x86 assembly (clang, -O0):
<ntp32_substract>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    112b <ntp32_substract+0x2b>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    113d <ntp32_substract+0x3d>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x7fffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntp32_substract>:
mov    %rdi,%rax
sub    %rsi,%rax
add    $0x7fffffff,%rax
sub    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @ntp32_substract(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = sub nsw i64 %0, %1
%5 = add nsw i64 %4, 2147483647
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
/* Type definitions */
struct tasklet_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ smp_mb();
int /*<<< orphan*/ tasklet_disable_nosync(struct tasklet_struct *);
void tasklet_disable(struct tasklet_struct *t) {
  tasklet_disable_nosync(t);
  do {
  } while (0);
  smp_mb();
}


x86 assembly (clang, -O0):
<tasklet_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <tasklet_disable_nosync@plt>
jmp    113a <tasklet_disable+0x1a>
mov    $0x0,%al
call   1040 <smp_mb@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tasklet_struct = type { i32 }
define void @tasklet_disable(%struct.tasklet_struct* %0) {
%2 = alloca %struct.tasklet_struct*
store %struct.tasklet_struct* %0, %struct.tasklet_struct** %2
%3 = load %struct.tasklet_struct*, %struct.tasklet_struct** %2
%4 = call i32 @tasklet_disable_nosync(%struct.tasklet_struct* %3)
br label %5
5: ; preds = %1
br label %6
6: ; preds = %5
%7 = call i32 (...) @smp_mb()
ret void
}

LLVM IR (-O2):
%struct.tasklet_struct = type { i32 }
define void @tasklet_disable(%struct.tasklet_struct* %0) {
%2 = tail call i32 @tasklet_disable_nosync(%struct.tasklet_struct* %0)
%3 = tail call i32 (...) @smp_mb()
ret void
}
void rte_prefetch_non_temporal(const volatile void *p) { rte_prefetch0(p); }


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

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

LLVM IR (-O0):
define void @rte_prefetch_non_temporal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @rte_prefetch0 to i32 (i8*, ...)*)(i8* %3)
ret void
}

LLVM IR (-O2):
define void @rte_prefetch_non_temporal(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @rte_prefetch0 to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t cube(int64_t n) { return n * n * n; }


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

x86 assembly (clang, -O2):
<cube>:
mov    %edi,%eax
imul   %edi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @cube(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @cube(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}
main() {
  register int i __asm("edi");
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
long int byteToIntLong(unsigned char *bytefield) {
  return (((unsigned int)(bytefield[3]) * 256 * 256 * 256) +
          ((unsigned int)(bytefield[2]) * 256 * 256) +
          ((unsigned int)(bytefield[1]) * 256) + (unsigned int)(bytefield[0]));
}


x86 assembly (clang, -O0):
<byteToIntLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x8,%eax
shl    $0x8,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @byteToIntLong(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = mul i32 %6, 256
%8 = mul i32 %7, 256
%9 = mul i32 %8, 256
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = mul i32 %13, 256
%15 = mul i32 %14, 256
%16 = add i32 %9, %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = mul i32 %20, 256
%22 = add i32 %16, %21
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = add i32 %22, %26
%28 = zext i32 %27 to i64
ret i64 %28
}

LLVM IR (-O2):
define i64 @byteToIntLong(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = shl nuw nsw i64 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i64
%9 = shl nuw nsw i64 %8, 16
%10 = or i64 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = shl nuw nsw i64 %13, 8
%15 = or i64 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Type definitions */
struct slre_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ re_rng2set(struct slre_env *, char, int);
void re_D_2set(struct slre_env *e) {
  re_rng2set(e, 0, '0' - 1);
  re_rng2set(e, '9' + 1, 0xFFFF);
}


x86 assembly (clang, -O0):
<re_D_2set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2f,%edx
call   1030 <re_rng2set@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
mov    $0xffff,%edx
call   1030 <re_rng2set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_D_2set>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x2f,%edx
call   1030 <re_rng2set@plt>
mov    %rbx,%rdi
mov    $0x3a,%esi
mov    $0xffff,%edx
pop    %rbx
jmp    1030 <re_rng2set@plt>

LLVM IR (-O0):
%struct.slre_env = type { i32 }
define void @re_D_2set(%struct.slre_env* %0) {
%2 = alloca %struct.slre_env*
store %struct.slre_env* %0, %struct.slre_env** %2
%3 = load %struct.slre_env*, %struct.slre_env** %2
%4 = call i32 @re_rng2set(%struct.slre_env* %3, i8 signext 0, i32 47)
%5 = load %struct.slre_env*, %struct.slre_env** %2
%6 = call i32 @re_rng2set(%struct.slre_env* %5, i8 signext 58, i32 65535)
ret void
}

LLVM IR (-O2):
%struct.slre_env = type { i32 }
define void @re_D_2set(%struct.slre_env* %0) {
%2 = tail call i32 @re_rng2set(%struct.slre_env* %0, i8 signext 0, i32 47)
%3 = tail call i32 @re_rng2set(%struct.slre_env* %0, i8 signext 58, i32 65535)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
void _makepath(char *path, const char *drive, const char *dir,
               const char *fname, const char *ext) {
  strcpy(path, dir);
  strcat(path, fname);
  strcat(path, ".");
  strcat(path, ext);
}


x86 assembly (clang, -O0):
<_makepath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_makepath>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strcat@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define void @_makepath(i8* %0, i8* nocapture readnone %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @strcpy(i8* %0, i8* %2)
%7 = tail call i32 @strcat(i8* %0, i8* %3)
%8 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @strcat(i8* %0, i8* %4)
ret void
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] - 51238316UL) - (unsigned char)191;
    local1 = 0UL;
    while (local1 < (unsigned char)0) {
      state[0UL] |= (state[0UL] & (unsigned char)15) << 3UL;
      state[local1] = state[0UL] - state[local1];
      local1++;
    }
    output[0UL] = state[0UL] + (787497705UL >> (unsigned char)255);
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sub    $0x30dd5ac,%rax
sub    $0xbf,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jge    116c <RandomFunc+0x6c>
movzbl -0x11(%rbp),%ecx
and    $0xf,%ecx
shl    $0x3,%ecx
movzbl -0x11(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
movzbl -0x12(%rbp),%ecx
movzbl -0x11(%rbp,%rcx,1),%ecx
sub    %ecx,%eax
mov    %al,%cl
movzbl -0x12(%rbp),%eax
mov    %cl,-0x11(%rbp,%rax,1)
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    1126 <RandomFunc+0x26>
movzbl -0x11(%rbp),%eax
add    %rcx,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = sub i64 %10, 51238316
%12 = sub i64 %11, 191
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %19, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %45
19: ; preds = %15
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = and i32 %22, 15
%24 = shl i32 %23, 3
%25 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = or i32 %27, %24
%29 = trunc i32 %28 to i8
store i8 %29, i8* %25
%30 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i64
%35 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = sub nsw i32 %32, %37
%39 = trunc i32 %38 to i8
%40 = load i8, i8* %6
%41 = zext i8 %40 to i64
%42 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %41
store i8 %39, i8* %42
%43 = load i8, i8* %6
%44 = add i8 %43, 1
store i8 %44, i8* %6
br label %15
45: ; preds = %15
%46 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%47 = load i8, i8* %46
%48 = zext i8 %47 to i64
%49 = add i64 %48, poison
%50 = trunc i64 %49 to i8
%51 = load i8*, i8** %4
%52 = getelementptr inbounds i8, i8* %51, i64 0
store i8 %50, i8* %52
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float real;
  printf("Insira um numero real: ");
  scanf("%f", &real);
  real = real / 5;
  printf("A quinta parte deste numero eh: %f\n", real);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea6(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
divss  0xeb2(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Insira um numero real: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [36 x i8] c"A quinta parte deste numero eh: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fdiv float %5, 5.000000e+00
store float %6, float* %2
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Insira um numero real: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [36 x i8] c"A quinta parte deste numero eh: %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fdiv float %5, 5.000000e+00
store float %6, float* %1
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
int main() {
  int a = 0;
  for (int i = 0; i < 1000; i++) {
    a += i;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int f172(int *);
int f173(int *p) { return f172(p); }


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

x86 assembly (clang, -O2):
<f173>:
jmp    1030 <f172@plt>

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

LLVM IR (-O2):
define i32 @f173(i32* %0) {
%2 = tail call i32 @f172(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void op_jne() { puts("JNE"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"JNE\00"
define void @op_jne() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_mgmt(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c)) == __cpu_to_le16(0x0000);
}


x86 assembly (clang, -O0):
<ieee80211_is_mgmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_mgmt>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
xor    %edi,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_mgmt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 12)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 0)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_mgmt(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 12)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 0)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
void *unknown_func();
void *f() {
  void *res;
  res = unknown_func();
  return res;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown_func@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @f() {
%1 = alloca i8*
%2 = call i8* (...) @unknown_func()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @f() {
%1 = tail call i8* (...) @unknown_func()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help07(void) {
  printf("  #                 show PC\n");
  printf("  #  <addr>         set PC to <addr>\n");
}


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

x86 assembly (clang, -O2):
<help07>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c" # show PC\0A\00"
@.str.1 = [38 x i8] c" # <addr> set PC to <addr>\0A\00"
define void @help07() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c" # show PC\00"
@str.2 = [37 x i8] c" # <addr> set PC to <addr>\00"
define void @help07() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.2, i64 0, i64 0))
ret void
}