xunge/DecIR huggingface dataset:
/* Variables and functions */
int const calclen_l1b(unsigned int);
const int calclen_l0a(unsigned int i, int z) {
  static int l[4] = {0x7fffffff, 4, 8, 16};
  z = l[z];
  if (i <= z)
    return i;
  return z + calclen_l1b(i - z);
}


x86 assembly (clang, -O0):
<calclen_l0a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
lea    0x2f07(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
ja     1146 <calclen_l0a+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <calclen_l0a+0x51>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <calclen_l1b@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calclen_l0a>:
push   %rbx
mov    %edi,%eax
movslq %esi,%rcx
lea    0xee3(%rip),%rdx
mov    (%rdx,%rcx,4),%ebx
cmp    %edi,%ebx
jae    112f <calclen_l0a+0x1f>
sub    %ebx,%eax
mov    %eax,%edi
call   1030 <calclen_l1b@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@calclen_l0a.l = internal global [4 x i32] [i32 2147483647, i32 4, i32 8, i32 16]
define i32 @calclen_l0a(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [4 x i32], [4 x i32]* @calclen_l0a.l, i64 0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = icmp ule i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %22
15: ; preds = %2
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sub i32 %17, %18
%20 = call i32 @calclen_l1b(i32 %19)
%21 = add nsw i32 %16, %20
store i32 %21, i32* %3
br label %22
22: ; preds = %15, %13
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@calclen_l0a.l = internal unnamed_addr constant [4 x i32] [i32 2147483647, i32 4, i32 8, i32 16]
define i32 @calclen_l0a(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x i32], [4 x i32]* @calclen_l0a.l, i64 0, i64 %3
%5 = load i32, i32* %4
%6 = icmp ult i32 %5, %0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = sub i32 %0, %5
%9 = tail call i32 @calclen_l1b(i32 %8)
%10 = add nsw i32 %9, %5
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ %10, %7 ], [ %0, %2 ]
ret i32 %12
}
int size() { return size; }


x86 assembly (clang, -O0):
<size>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size>:
mov    0x2eda(%rip),%eax
ret

LLVM IR (-O0):
define i32 @size() {
ret i32 ptrtoint (i32 ()* @size to i32)
}

LLVM IR (-O2):
define i32 @size() {
ret i32 ptrtoint (i32 ()* @size to i32)
}
/* Variables and functions */
int /*<<< orphan*/ xsi_register_didat(char *, char *);
extern void work_a_0408172235_2320432267_init() {
  xsi_register_didat(
      "work_a_0408172235_2320432267",
      "isim/TopLevel_tb_isim_beh.exe.sim/work/a_0408172235_2320432267.didat");
}


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

x86 assembly (clang, -O2):
<work_a_0408172235_2320432267_init>:
lea    0xee9(%rip),%rdi
lea    0xeff(%rip),%rsi
jmp    1030 <xsi_register_didat@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"work_a_0408172235_2320432267\00"
@.str.1 = [69 x i8] c"isim/TopLevel_tb_isim_beh.exe.sim/work/a_0408172235_2320432267.didat\00"
define void @work_a_0408172235_2320432267_init() {
%1 = call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"work_a_0408172235_2320432267\00"
@.str.1 = [69 x i8] c"isim/TopLevel_tb_isim_beh.exe.sim/work/a_0408172235_2320432267.didat\00"
define void @work_a_0408172235_2320432267_init() {
%1 = tail call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *strcopy(char *dp, char *sp) {
  while (*sp != '\0') {
    *dp = *sp;
  }
  *dp = '\0';
  return dp;
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <strcopy+0x2d>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    110c <strcopy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi),%ecx
test   %cl,%cl
je     111b <strcopy+0x1b>
mov    %cl,(%rax)
jmp    1110 <strcopy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @strcopy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %7, %5 ], [ %3, %2 ]
store i8 %6, i8* %0
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %2
store i8 0, i8* %0
ret i8* %0
}
/* Variables and functions */
double derotate_180_double(double);
double derotate_180_small_double(double a) {
  double y;
  y = derotate_180_double(a);
  if (y >= 90.0)
    y = y - 180.0;
  return y;
}


x86 assembly (clang, -O0):
<derotate_180_small_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <derotate_180_double@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1159 <derotate_180_small_double+0x49>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derotate_180_small_double>:
push   %rax
call   1030 <derotate_180_double@plt>
movsd  0xee2(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xede(%rip),%xmm2
cmpnlesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @derotate_180_small_double(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @derotate_180_double(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp oge double %6, 9.000000e+01
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fsub double %9, 1.800000e+02
store double %10, double* %3
br label %11
11: ; preds = %8, %1
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @derotate_180_small_double(double %0) {
%2 = tail call double @derotate_180_double(double %0)
%3 = fcmp ult double %2, 9.000000e+01
%4 = fadd double %2, -1.800000e+02
%5 = select i1 %3, double %2, double %4
ret double %5
}
void glGetTexEnvfv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetTexEnvfv() {
ret void
}
int PyMPELog_NewState(int commID, const char name[], const char color[],
                      const char format[], int stateID[2]) {
  int ierr = 0;
  return ierr;
}


x86 assembly (clang, -O0):
<PyMPELog_NewState>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @PyMPELog_NewState(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32* nocapture readnone %4) {
ret i32 0
}
long ppb_to_scaled_ppm(int ppb) { return (long)(ppb * 65.536); }


x86 assembly (clang, -O0):
<ppb_to_scaled_ppm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppb_to_scaled_ppm>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @ppb_to_scaled_ppm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 6.553600e+01
%6 = fptosi double %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @ppb_to_scaled_ppm(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 6.553600e+01
%4 = fptosi double %3 to i64
ret i64 %4
}
void t3xeem(void) { return; }


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

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

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

LLVM IR (-O2):
define void @t3xeem() {
ret void
}
/* Variables and functions */
double acos(double);
double aSec(double x) { return acos(1.0 / x); }


x86 assembly (clang, -O0):
<aSec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <acos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aSec>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <acos@plt>

LLVM IR (-O0):
define double @aSec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = call double @acos(double %4)
ret double %5
}

LLVM IR (-O2):
define double @aSec(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = tail call double @acos(double %2)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void md_img(FILE *fw, int term, char *img, char *id, char *comment) {
  switch (term) {
  case 0:
    break;
  case 1:
    break;
  case 2:
    break;
  }
}


x86 assembly (clang, -O0):
<md_img>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
test   %eax,%eax
je     114c <md_img+0x4c>
jmp    112a <md_img+0x2a>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
je     1151 <md_img+0x51>
jmp    113b <md_img+0x3b>
mov    -0x2c(%rbp),%eax
sub    $0x2,%eax
je     1156 <md_img+0x56>
jmp    115b <md_img+0x5b>
jmp    115b <md_img+0x5b>
jmp    115b <md_img+0x5b>
jmp    115b <md_img+0x5b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @md_img(i32* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
switch i32 %11, label %15 [
i32 0, label %12
i32 1, label %13
i32 2, label %14
]
12: ; preds = %5
br label %15
13: ; preds = %5
br label %15
14: ; preds = %5
br label %15
15: ; preds = %5, %14, %13, %12
ret void
}

LLVM IR (-O2):
define void @md_img(i32* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4) {
ret void
}
int float_cmp(void const *a, void const *b) {
  int const *ia = (int const *)a;
  int const *ib = (int const *)b;
  return *ia - *ib;
}


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

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

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

LLVM IR (-O2):
define i32 @float_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
void rop3_84_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_84_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_84_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
not    %cl
and    %dl,%cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_84_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %4
store i8 %43, i8* %44
ret void
}

LLVM IR (-O2):
define void @rop3_84_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %5, -1
%7 = and i8 %6, %2
%8 = and i8 %4, %1
%9 = or i8 %7, %8
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
int /*<<< orphan*/ foo(int *, int *);
int main(void) {
  int x = 0;
  int y = 0;
  (x = 1) + y;
  x + (y = 1);
  (x = 1) / (y = 1);
  f(x = 0, y);
  ++x + y;
  "hi0"[0] + x++;
  "hi1"[0] + x++ + "hi2"[0];
  foo(&x, &y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   1030 <f@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <f@plt>
movl   $0x3,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"hi0\00"
@.str.1 = [4 x i8] c"hi1\00"
@.str.2 = [4 x i8] c"hi2\00"
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
store i32 1, i32* %2
%4 = load i32, i32* %3
%5 = add nsw i32 1, %4
%6 = load i32, i32* %2
store i32 1, i32* %3
%7 = add nsw i32 %6, 1
store i32 1, i32* %2
store i32 1, i32* %3
store i32 0, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @f(i32 0, i32 %8)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%15 = sext i8 %14 to i32
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
%18 = add nsw i32 %15, %16
%19 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%20 = sext i8 %19 to i32
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
%23 = add nsw i32 %20, %21
%24 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%25 = sext i8 %24 to i32
%26 = add nsw i32 %23, %25
%27 = call i32 @foo(i32* %2, i32* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%5 = tail call i32 @f(i32 0, i32 1)
store i32 3, i32* %1
%6 = call i32 @foo(i32* %1, i32* %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_motion_mask_x(void) {
  char int_ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1F, &int_ctrl_reg2, 1) == 0) {
    int_ctrl_reg2 |= 0x80;
    KIONIX_ACCEL_write_byte(0x1F, int_ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_motion_mask_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1f,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116f <KIONIX_ACCEL_motion_mask_x+0x4f>
movsbl -0x1(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x1(%rbp)
mov    $0x1f,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1176 <KIONIX_ACCEL_motion_mask_x+0x56>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_motion_mask_x>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1f,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_motion_mask_x+0x41>
movsbl 0xf(%rsp),%esi
or     $0xffffff80,%esi
mov    %sil,0xf(%rsp)
mov    $0x1f,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_motion_mask_x() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 31, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = or i32 %7, 128
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 31, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_motion_mask_x() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 31, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = or i8 %5, -128
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 31, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
int STDOUT_FILENO;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
void pipe_get(int fd, int *p) {
  dup2(fd == STDOUT_FILENO ? 1 : 0, fd);
  close(p[0]);
  close(p[1]);
}


x86 assembly (clang, -O0):
<pipe_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
mov    $0x1,%eax
cmp    %edx,%ecx
cmove  %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <dup2@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_get>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
mov    0x2ec3(%rip),%rax
xor    %edi,%edi
cmp    %esi,(%rax)
sete   %dil
call   1030 <dup2@plt>
mov    (%rbx),%edi
call   1040 <close@plt>
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @pipe_get(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* @STDOUT_FILENO
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = load i32, i32* %3
%11 = call i32 @dup2(i32 %9, i32 %10)
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = call i32 @close(i32 %14)
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = call i32 @close(i32 %18)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @pipe_get(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* @STDOUT_FILENO
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
%6 = tail call i32 @dup2(i32 %5, i32 %0)
%7 = load i32, i32* %1
%8 = tail call i32 @close(i32 %7)
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = tail call i32 @close(i32 %10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void write_to_pipe(int file) {
  FILE *stream;
  stream = fdopen(file, "w");
  fprintf(stream, "hello, world!\n");
  fprintf(stream, "goodbye, world!\n");
  fclose(stream);
}


x86 assembly (clang, -O0):
<write_to_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xebb(%rip),%rsi
call   1050 <fdopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to_pipe>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1040 <fdopen@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
lea    0xeb1(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [15 x i8] c"hello, world!\0A\00"
@.str.2 = [17 x i8] c"goodbye, world!\0A\00"
define void @write_to_pipe(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32* @fdopen(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = call i32 @fclose(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [15 x i8] c"hello, world!\0A\00"
@.str.2 = [17 x i8] c"goodbye, world!\0A\00"
define void @write_to_pipe(i32 %0) {
%2 = tail call i32* @fdopen(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i64 14, i64 1, i32* %2)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i64 16, i64 1, i32* %2)
%5 = tail call i32 @fclose(i32* %2)
ret void
}
/* Type definitions */
typedef int c;

/* Variables and functions */
scalar_t__ isdigit(char);
int deoct(char c) {
  if (isdigit(c))
    return (((c) - '0'));
  return (0);
}


x86 assembly (clang, -O0):
<deoct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1140 <deoct+0x30>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <deoct+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deoct>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
add    $0xffffffd0,%ebx
xor    %ecx,%ecx
test   %rax,%rax
cmovne %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @deoct(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int innetgr(const char *netgroup, const char *host, const char *user,
            const char *domain) {
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @innetgr(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @innetgr(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
char *setlocale(int category, const char *locale) { return locale; }


x86 assembly (clang, -O0):
<setlocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @setlocale(i32 %0, i8* readnone returned %1) {
ret i8* %1
}
int test4(int x) { return x / 10 != 0; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
add    $0xfffffff6,%edi
xor    %eax,%eax
cmp    $0xffffffed,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, -19
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ readfile(char *);
int main(int argc, char **argv) {
  readfile(argv[1]);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <readfile@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <readfile@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @readfile(i8* %4)
ret i32 0
}
int switch_dev_register(struct switch_dev *sdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.switch_dev = type opaque
define i32 @switch_dev_register(%struct.switch_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
long long PAPI_get_real_nsec();
void PAPIF_GET_REAL_NSEC(long long *time) { *time = PAPI_get_real_nsec(); }


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

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

LLVM IR (-O0):
define void @PAPIF_GET_REAL_NSEC(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @PAPI_get_real_nsec()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
ret void
}

LLVM IR (-O2):
define void @PAPIF_GET_REAL_NSEC(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_get_real_nsec()
store i64 %2, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void limpa(void) {
  system("cls");
  printf("\n    IA para Estudos e desenvolvimento  - Digite: (sair) Para "
         "fechar a aplicação\n");
  printf("           Comandos: ");
  printf("Help - abrir navegador - pesquisa - word - limpa a tela... \n\n");
}


x86 assembly (clang, -O0):
<limpa>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
lea    0xf15(%rip),%rdi
call   1040 <printf@plt>
lea    0xf1f(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpa>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <system@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [84 x i8] c"\0A IA para Estudos e desenvolvimento - Digite: (sair) Para fechar a aplica\C3\A7\C3\A3o\0A\00"
@.str.2 = [22 x i8] c" Comandos: \00"
@.str.3 = [62 x i8] c"Help - abrir navegador - pesquisa - word - limpa a tela... \0A\0A\00"
define void @limpa() {
%1 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.2 = [22 x i8] c" Comandos: \00"
@str = [83 x i8] c"\0A IA para Estudos e desenvolvimento - Digite: (sair) Para fechar a aplica\C3\A7\C3\A3o\00"
@str.4 = [61 x i8] c"Help - abrir navegador - pesquisa - word - limpa a tela... \0A\00"
define void @limpa() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.4, i64 0, i64 0))
ret void
}
float u2f(unsigned x) { return *(float *)&x; }


x86 assembly (clang, -O0):
<u2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<u2f>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
define float @u2f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to float*
%4 = load float, float* %3
ret float %4
}

LLVM IR (-O2):
define float @u2f(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int hide() {
  int a;
  a = 4;
  printf("a in hide %d\n", a);
  {
    int a;
    a = 16;
    printf("a in in hide %d\n", a);
  }
  printf("a in hide %d\n", a);
}


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

x86 assembly (clang, -O2):
<hide>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"a in hide %d\0A\00"
@.str.1 = [17 x i8] c"a in in hide %d\0A\00"
define i32 @hide() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 4, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 16, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"a in hide %d\0A\00"
@.str.1 = [17 x i8] c"a in in hide %d\0A\00"
define i32 @hide() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 16)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 undef
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int add_raw_data(struct buffer *, int, unsigned char *, int);
int add_challenge_avp(struct buffer *buf, unsigned char *c, int len) {
  return add_raw_data(buf, 11, c, len);
}


x86 assembly (clang, -O0):
<add_challenge_avp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xb,%esi
call   1030 <add_raw_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_challenge_avp>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xb,%esi
jmp    1030 <add_raw_data@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @add_challenge_avp(%struct.buffer* %0, i8* %1, i32 %2) {
%4 = alloca %struct.buffer*
%5 = alloca i8*
%6 = alloca i32
store %struct.buffer* %0, %struct.buffer** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.buffer*, %struct.buffer** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @add_raw_data(%struct.buffer* %7, i32 11, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @add_challenge_avp(%struct.buffer* %0, i8* %1, i32 %2) {
%4 = tail call i32 @add_raw_data(%struct.buffer* %0, i32 11, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _ptrc_glDepthRange(float, float);
__attribute__((visibility("default"))) void emu_glDepthRangef(float n,
                                                              float f) {
  _ptrc_glDepthRange(n, f);
}


x86 assembly (clang, -O0):
<emu_glDepthRangef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <_ptrc_glDepthRange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emu_glDepthRangef>:
jmp    1030 <_ptrc_glDepthRange@plt>

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

LLVM IR (-O2):
define void @emu_glDepthRangef(float %0, float %1) {
%3 = tail call i32 @_ptrc_glDepthRange(float %0, float %1)
ret void
}
/* Variables and functions */
size_t coucal_hash_size(void) { return 32; }


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

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

LLVM IR (-O0):
define i64 @coucal_hash_size() {
ret i64 32
}

LLVM IR (-O2):
define i64 @coucal_hash_size() {
ret i64 32
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__6__IO__makeOutput();
void Msp430GpioC__13__HplGeneralIO__makeOutput(void) {
  HplMsp430GeneralIOP__6__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__13__HplGeneralIO__makeOutput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__6__IO__makeOutput()
ret void
}
void local_addr_noalias_ok(int *p) {
  int *q = 0;
  int x = 1;
  if (&x == p) {
    *q = 42;
  }
}


x86 assembly (clang, -O0):
<local_addr_noalias_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    112f <local_addr_noalias_ok+0x2f>
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @local_addr_noalias_ok(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %2
store i32* null, i32** %3
store i32 1, i32* %4
%5 = load i32*, i32** %2
%6 = icmp eq i32* %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32*, i32** %3
store i32 42, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @local_addr_noalias_ok(i32* nocapture %0) {
ret void
}
/* Variables and functions */
char **stb_readdir_rec(int /*<<< orphan*/ *, char *, char *);
char **stb_readdir_recursive(char *dir, char *filespec) {
  return stb_readdir_rec(NULL, dir, filespec);
}


x86 assembly (clang, -O0):
<stb_readdir_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <stb_readdir_rec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_readdir_recursive>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <stb_readdir_rec@plt>

LLVM IR (-O0):
define i8** @stb_readdir_recursive(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** @stb_readdir_rec(i32* null, i8* %5, i8* %6)
ret i8** %7
}

LLVM IR (-O2):
define i8** @stb_readdir_recursive(i8* %0, i8* %1) {
%3 = tail call i8** @stb_readdir_rec(i32* null, i8* %0, i8* %1)
ret i8** %3
}
/* Variables and functions */
int read(int, char *, int);
int receive_ticket() {
  char buf[6];
  return read(34, buf, 6);
}


x86 assembly (clang, -O0):
<receive_ticket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x6(%rbp),%rsi
mov    $0x22,%edi
mov    $0x6,%edx
call   1030 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_ticket>:
push   %rax
lea    0x2(%rsp),%rsi
mov    $0x22,%edi
mov    $0x6,%edx
call   1030 <read@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @receive_ticket() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 34, i8* %2, i32 6)
ret i32 %3
}

LLVM IR (-O2):
define i32 @receive_ticket() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 34, i8* %2, i32 6)
ret i32 %3
}
void USBHostHubAddrSet(unsigned long ulBase, unsigned long ulEndpoint,
                       unsigned long ulAddr, unsigned long ulFlags) {
  ;

  ;
  if (ulFlags & 0x00002000) {
    (*((volatile unsigned char *)(ulBase + 0x00000082 + (ulEndpoint >> 1)))) =
        ulAddr;
  } else {
    (*((volatile unsigned char *)(ulBase + 0x00000082 + 4 +
                                  (ulEndpoint >> 1)))) = ulAddr;
  }
}


x86 assembly (clang, -O0):
<USBHostHubAddrSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
and    $0x2000,%rax
cmp    $0x0,%rax
je     114a <USBHostHubAddrSet+0x4a>
mov    -0x18(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
add    $0x82,%rax
mov    -0x10(%rbp),%rdx
shr    $0x1,%rdx
add    %rdx,%rax
mov    %cl,(%rax)
jmp    116b <USBHostHubAddrSet+0x6b>
mov    -0x18(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
add    $0x82,%rax
add    $0x4,%rax
mov    -0x10(%rbp),%rdx
shr    $0x1,%rdx
add    %rdx,%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostHubAddrSet>:
xor    %eax,%eax
test   $0x2000,%ecx
sete   %al
lea    (%rdi,%rax,4),%rax
shr    %rsi
mov    %dl,0x82(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @USBHostHubAddrSet(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = and i64 %9, 8192
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i64, i64* %7
%14 = trunc i64 %13 to i8
%15 = load i64, i64* %5
%16 = add i64 %15, 130
%17 = load i64, i64* %6
%18 = lshr i64 %17, 1
%19 = add i64 %16, %18
%20 = inttoptr i64 %19 to i8*
store volatile i8 %14, i8* %20
br label %31
21: ; preds = %4
%22 = load i64, i64* %7
%23 = trunc i64 %22 to i8
%24 = load i64, i64* %5
%25 = add i64 %24, 130
%26 = add i64 %25, 4
%27 = load i64, i64* %6
%28 = lshr i64 %27, 1
%29 = add i64 %26, %28
%30 = inttoptr i64 %29 to i8*
store volatile i8 %23, i8* %30
br label %31
31: ; preds = %21, %12
ret void
}

LLVM IR (-O2):
define void @USBHostHubAddrSet(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = and i64 %3, 8192
%6 = icmp eq i64 %5, 0
%7 = trunc i64 %2 to i8
%8 = select i1 %6, i64 134, i64 130
%9 = add i64 %8, %0
%10 = lshr i64 %1, 1
%11 = add i64 %9, %10
%12 = inttoptr i64 %11 to i8*
store volatile i8 %7, i8* %12
ret void
}
int istreintauno(int mes) {
  if (mes == 1 || mes == 3 || mes == 5 || mes == 7 || mes == 8 || mes == 10 ||
      mes == 12)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<istreintauno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     114d <istreintauno+0x4d>
cmpl   $0x3,-0x8(%rbp)
je     114d <istreintauno+0x4d>
cmpl   $0x5,-0x8(%rbp)
je     114d <istreintauno+0x4d>
cmpl   $0x7,-0x8(%rbp)
je     114d <istreintauno+0x4d>
cmpl   $0x8,-0x8(%rbp)
je     114d <istreintauno+0x4d>
cmpl   $0xa,-0x8(%rbp)
je     114d <istreintauno+0x4d>
cmpl   $0xc,-0x8(%rbp)
jne    1159 <istreintauno+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1160 <istreintauno+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<istreintauno>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0xb,%edi
ja     1117 <istreintauno+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @istreintauno(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %24, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 3
br i1 %8, label %24, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 5
br i1 %11, label %24, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 7
br i1 %14, label %24, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 8
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 10
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 12
br i1 %23, label %24, label %25
24: ; preds = %21, %18, %15, %12, %9, %6, %1
store i32 1, i32* %2
br label %26
25: ; preds = %21
store i32 0, i32* %2
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@switch.table.istreintauno = [12 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define i32 @istreintauno(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.istreintauno, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int unix_fcntl_o_exlock() { return -1; }


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

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

LLVM IR (-O0):
define i32 @unix_fcntl_o_exlock() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @unix_fcntl_o_exlock() {
ret i32 -1
}