xunge/DecIR huggingface dataset:
void strcut(char *str, int nb) {
  char *ptr = str + nb;
  while (*ptr)
    *str++ = *ptr++;
  *str = 0;
}


x86 assembly (clang, -O0):
<strcut>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strcut+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111a <strcut+0x1a>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcut>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%cl
test   %cl,%cl
je     1126 <strcut+0x26>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rdi),%rdx
mov    %cl,(%rdi)
movzbl 0x1(%rdi,%rax,1),%ecx
mov    %rdx,%rdi
test   %cl,%cl
jne    1110 <strcut+0x10>
movb   $0x0,(%rdx)
ret
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @strcut(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %2, %7
%8 = phi i8 [ %13, %7 ], [ %5, %2 ]
%9 = phi i8* [ %11, %7 ], [ %4, %2 ]
%10 = phi i8* [ %12, %7 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %8, i8* %10
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %2
%16 = phi i8* [ %0, %2 ], [ %12, %7 ]
store i8 0, i8* %16
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int bar(int a) { printf("XXXXXXXXXXXXXXXXXXXXX %x", a); }


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

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"XXXXXXXXXXXXXXXXXXXXX %x\00"
define i32 @bar(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
unsigned long clz(unsigned long i) { return __builtin_clzl(i); }


x86 assembly (clang, -O0):
<clz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<clz>:
bsr    %rdi,%rax
xor    $0x3f,%rax
ret

LLVM IR (-O0):
define i64 @clz(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctlz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @clz(i64 %0) {
%2 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
ret i64 %2
}
int fun1392() { return 1392; }


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

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

LLVM IR (-O0):
define i32 @fun1392() {
ret i32 1392
}

LLVM IR (-O2):
define i32 @fun1392() {
ret i32 1392
}
int test_imm_F7int16_mem(short *val) {
  return ((*val) & (-0xF7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F7int16_mem>:
movzwl (%rdi),%eax
test   $0xff09,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F7int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -247
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ initstate(int /*<<< orphan*/, char *, int);
int random();
int random_walk(void) {
  static char statebuf[255];
  static int s = 0;
  if (s == 0) {
    initstate(0, statebuf, 255);
    s++;
  }
  return random() % 4;
}


x86 assembly (clang, -O0):
<random_walk>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x3015(%rip)
jne    1153 <random_walk+0x33>
xor    %edi,%edi
lea    0x2f06(%rip),%rsi
mov    $0xff,%edx
call   1030 <initstate@plt>
mov    0x2ff6(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2fed(%rip)
mov    $0x0,%al
call   1040 <random@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_walk>:
push   %rax
cmpl   $0x0,0x3018(%rip)
jne    1144 <random_walk+0x24>
lea    0x2f0f(%rip),%rsi
xor    %edi,%edi
mov    $0xff,%edx
call   1030 <initstate@plt>
addl   $0x1,0x2ffc(%rip)
xor    %eax,%eax
call   1040 <random@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@random_walk.statebuf = internal global [255 x i8] zeroinitializer
@random_walk.s = internal global i32 0
define i32 @random_walk() {
%1 = load i32, i32* @random_walk.s
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @initstate(i32 0, i8* getelementptr inbounds ([255 x i8], [255 x i8]* @random_walk.statebuf, i64 0, i64 0), i32 255)
%5 = load i32, i32* @random_walk.s
%6 = add nsw i32 %5, 1
store i32 %6, i32* @random_walk.s
br label %7
7: ; preds = %3, %0
%8 = call i32 (...) @random()
%9 = srem i32 %8, 4
ret i32 %9
}

LLVM IR (-O2):
@random_walk.statebuf = internal global [255 x i8] zeroinitializer
@random_walk.s = internal unnamed_addr global i32 0
define i32 @random_walk() {
%1 = load i32, i32* @random_walk.s
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @initstate(i32 0, i8* getelementptr inbounds ([255 x i8], [255 x i8]* @random_walk.statebuf, i64 0, i64 0), i32 255)
%5 = load i32, i32* @random_walk.s
%6 = add nsw i32 %5, 1
store i32 %6, i32* @random_walk.s
br label %7
7: ; preds = %3, %0
%8 = tail call i32 (...) @random()
%9 = srem i32 %8, 4
ret i32 %9
}
/* Variables and functions */
float sqrtf(float);
float foof(float x) { return 1.0f / sqrtf(x); }


x86 assembly (clang, -O0):
<foof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foof>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <foof+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <foof+0x14>
call   1030 <sqrtf@plt>
movss  0xed4(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @foof(float %0) {
%2 = tail call float @sqrtf(float %0)
%3 = fdiv float 1.000000e+00, %2
ret float %3
}
void __attribute__((no, noclone)) set_double_imm0(double *a) {
  for (int i = 0; i < (1024 / sizeof(double)); i++)
    a[i] = 0;
}


x86 assembly (clang, -O0):
<set_double_imm0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x80,%rax
jae    113d <set_double_imm0+0x3d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <set_double_imm0+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_double_imm0>:
push   %rax
mov    $0x400,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @set_double_imm0(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, 128
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load double*, double** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %9, i64 %11
store double 0.000000e+00, double* %12
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @set_double_imm0(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to i8*
ret void
}
const char *TA_GetVersionExtra(void) { return "dev"; }


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

x86 assembly (clang, -O2):
<TA_GetVersionExtra>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"dev\00"
define i8* @TA_GetVersionExtra() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"dev\00"
define i8* @TA_GetVersionExtra() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
char *strrchr(const char *p, int ch) {
  char *save;
  for (save = 0;; ++p) {
    if (*p == ch)
      save = (char *)p;
    if (!*p)
      return (save);
  }
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    112b <strrchr+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113e <strrchr+0x3e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret
jmp    1143 <strrchr+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strrchr+0x13>

x86 assembly (clang, -O2):
<strrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %11, %3 ]
%5 = phi i8* [ null, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, %1
%9 = select i1 %8, i8* %4, i8* %5
%10 = icmp eq i8 %6, 0
%11 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %10, label %12, label %3
12: ; preds = %3
ret i8* %9
}
/* Variables and functions */
int f_time_processing(int, unsigned char **, float *, unsigned int, char *,
                      void **, char *, char *, char const *, char const *);
int f_fcst_ave(int mode, unsigned char **sec, float *data, unsigned int ndata,
               char *inv_out, void **local, const char *arg1,
               const char *arg2) {
  return f_time_processing(mode, sec, data, ndata, inv_out, local, "0", "2",
                           arg1, arg2);
}


x86 assembly (clang, -O0):
<f_fcst_ave>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
lea    0xea4(%rip),%rbx
lea    0xe9f(%rip),%r11
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <f_time_processing@plt>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_fcst_ave>:
sub    $0x28,%rsp
movaps 0x30(%rsp),%xmm0
movups %xmm0,0x10(%rsp)
lea    0xedd(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xecf(%rip),%rax
mov    %rax,(%rsp)
call   1030 <f_time_processing@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"2\00"
define i32 @f_fcst_ave(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6, i8* %7) {
%9 = tail call i32 @f_time_processing(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7)
ret i32 %9
}
/* Variables and functions */
int ioctl(int, unsigned long, unsigned long *);
int apr_ioctl(int sock, unsigned long cmd, unsigned long *argp) {
  int retval;
  retval = ioctl(sock, cmd, argp);
  return retval;
}


x86 assembly (clang, -O0):
<apr_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apr_ioctl>:
jmp    1030 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @apr_ioctl(i32 %0, i64 %1, i64* %2) {
%4 = tail call i32 @ioctl(i32 %0, i64 %1, i64* %2)
ret i32 %4
}
/* Type definitions */
struct usb_endpoint_descriptor {
  int dummy;
};

/* Variables and functions */
scalar_t__ usb_endpoint_dir_in(struct usb_endpoint_descriptor const *);
scalar_t__ usb_endpoint_xfer_bulk(struct usb_endpoint_descriptor const *);
int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd) {
  return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd));
}


x86 assembly (clang, -O0):
<usb_endpoint_is_bulk_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <usb_endpoint_xfer_bulk@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <usb_endpoint_is_bulk_in+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <usb_endpoint_dir_in@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_endpoint_is_bulk_in>:
push   %rbx
mov    %rdi,%rbx
call   1030 <usb_endpoint_xfer_bulk@plt>
test   %rax,%rax
je     1143 <usb_endpoint_is_bulk_in+0x23>
mov    %rbx,%rdi
call   1040 <usb_endpoint_dir_in@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_bulk_in(%struct.usb_endpoint_descriptor* %0) {
%2 = alloca %struct.usb_endpoint_descriptor*
store %struct.usb_endpoint_descriptor* %0, %struct.usb_endpoint_descriptor** %2
%3 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%4 = call i64 @usb_endpoint_xfer_bulk(%struct.usb_endpoint_descriptor* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%8 = call i64 @usb_endpoint_dir_in(%struct.usb_endpoint_descriptor* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_bulk_in(%struct.usb_endpoint_descriptor* %0) {
%2 = tail call i64 @usb_endpoint_xfer_bulk(%struct.usb_endpoint_descriptor* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @usb_endpoint_dir_in(%struct.usb_endpoint_descriptor* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int i;
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = i;
  printf("%d\n", i);
  int atext = 5;
  printf("%d\n", atext);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x5,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@i = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Type definitions */
typedef char *uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint64_t rdmsr64(uint32_t msr) {
  uint64_t r;
  __asm__ __volatile__("rdmsr" : "=A"(r) : "c"(msr));
  return r;
}


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

x86 assembly (clang, -O2):
<rdmsr64>:
mov    %edi,%ecx
rdmsr
ret

LLVM IR (-O0):
define i8* @rdmsr64(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @rdmsr64(i32 %0) {
%2 = tail call i8* asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t const);
void sulong_swap(char *buffer, void *vp1, void *vp2, const size_t size) {
  memcpy(buffer, vp1, size);
  memcpy(vp1, vp2, size);
  memcpy(vp2, buffer, size);
}


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

x86 assembly (clang, -O2):
<sulong_swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rcx,%rdx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @sulong_swap(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %8
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %7
%18 = load i8*, i8** %5
%19 = load i64, i64* %8
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
ret void
}

LLVM IR (-O2):
define void @sulong_swap(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %3)
%6 = tail call i32 @memcpy(i8* %1, i8* %2, i64 %3)
%7 = tail call i32 @memcpy(i8* %2, i8* %0, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getvar(char *);
int /*<<< orphan*/ gotoroom(int /*<<< orphan*/);
int /*<<< orphan*/ warnx(char *);
void cardinal(int argc, char *argv[]) {
  if (argc != 1) {
    warnx("Huh!?\n");
    return;
  }
  gotoroom(getvar(argv[0]));
}


x86 assembly (clang, -O0):
<cardinal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     115a <cardinal+0x2a>
lea    0xeb0(%rip),%rdi
call   1040 <warnx@plt>
jmp    116d <cardinal+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <getvar@plt>
mov    %eax,%edi
call   1050 <gotoroom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cardinal>:
cmp    $0x1,%edi
jne    1146 <cardinal+0x16>
push   %rax
mov    (%rsi),%rdi
call   1030 <getvar@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <gotoroom@plt>
lea    0xeb3(%rip),%rdi
jmp    1040 <warnx@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Huh!?\0A\00"
define void @cardinal(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @warnx(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %15
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @getvar(i8* %12)
%14 = call i32 @gotoroom(i32 %13)
br label %15
15: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Huh!?\0A\00"
define void @cardinal(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @warnx(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @getvar(i8* %7)
%9 = tail call i32 @gotoroom(i32 %8)
br label %10
10: ; preds = %6, %4
ret void
}
void nop2(void *a1, void *a2) { return; }


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

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

LLVM IR (-O0):
define void @nop2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @nop2(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int *malloc(int);
int main() {
  int *x;
  x = malloc(8);
  *x = 0;
  *x = *x + 1;
  *(x + 1) = 0;
  x = x + 1;
  return *x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 8)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
%8 = load i32*, i32** %2
store i32 %7, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
store i32 0, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32* %12, i32** %2
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: hibbert [-n -p percentage -t trigger -h -i interval]\nTrigger "
         "a script when battery reaches a certain percentage\n-i\tSpecify poll "
         "interval (seconds)\n-n\tDon't daemonize.\n-p\tSet percentage to "
         "trigger at.\n-t\tSet different trigger (defaults to ~/.hibbertt if "
         "it exists, /etc/hibbertt if not)\n");
}


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

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

LLVM IR (-O0):
@.str = [294 x i8] c"Usage: hibbert [-n -p percentage -t trigger -h -i interval]\0ATrigger a script when battery reaches a certain percentage\0A-i\09Specify poll interval (seconds)\0A-n\09Don't daemonize.\0A-p\09Set percentage to trigger at.\0A-t\09Set different trigger (defaults to ~/.hibbertt if it exists, /etc/hibbertt if not)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([294 x i8], [294 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [293 x i8] c"Usage: hibbert [-n -p percentage -t trigger -h -i interval]\0ATrigger a script when battery reaches a certain percentage\0A-i\09Specify poll interval (seconds)\0A-n\09Don't daemonize.\0A-p\09Set percentage to trigger at.\0A-t\09Set different trigger (defaults to ~/.hibbertt if it exists, /etc/hibbertt if not)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([293 x i8], [293 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int data[] = {1, 2, 3, 4};
  int *curarr = &data[1];
  printf("%d\n", curarr[-1]);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int get_uint32(unsigned char *, int);
int /*<<< orphan*/ memcpy(char *, unsigned char *, int);
uint32_t get_string(unsigned char *data, int offset, char *string) {
  uint32_t len, total = 0;
  len = get_uint32(data, offset);
  total += 4;
  memcpy(string, data + offset + 4, len);
  total += len;
  return total;
}


x86 assembly (clang, -O0):
<get_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <get_uint32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
add    $0x4,%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_string>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%r15
call   1030 <get_uint32@plt>
mov    %eax,%ebx
movslq %ebp,%rax
lea    (%r15,%rax,1),%rsi
add    $0x4,%rsi
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <memcpy@plt>
add    $0x4,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_string(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 0, i32* %8
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @get_uint32(i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %8
%13 = add nsw i32 %12, 4
store i32 %13, i32* %8
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = getelementptr inbounds i8, i8* %18, i64 4
%20 = load i32, i32* %7
%21 = call i32 @memcpy(i8* %14, i8* %19, i32 %20)
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = add nsw i32 %23, %22
store i32 %24, i32* %8
%25 = load i32, i32* %8
ret i32 %25
}

LLVM IR (-O2):
define i32 @get_string(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @get_uint32(i8* %0, i32 %1)
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = tail call i32 @memcpy(i8* %2, i8* %7, i32 %4)
%9 = add nsw i32 %4, 4
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getlong(int /*<<< orphan*/ *);
double getfixed(FILE *ttf) {
  int val = getlong(ttf);
  int mant = val & 0xffff;
  return ((double)(val >> 16) + (mant / 65536.0));
}


x86 assembly (clang, -O0):
<getfixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getlong@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xeb6(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfixed>:
push   %rax
call   1030 <getlong@plt>
movzwl %ax,%ecx
sar    $0x10,%eax
cvtsi2sd %eax,%xmm1
cvtsi2sd %ecx,%xmm0
mulsd  0xed4(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getfixed(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @getlong(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 65535
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = ashr i32 %9, 16
%11 = sitofp i32 %10 to double
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = fdiv double %13, 6.553600e+04
%15 = fadd double %11, %14
ret double %15
}

LLVM IR (-O2):
define double @getfixed(i32* %0) {
%2 = tail call i32 @getlong(i32* %0)
%3 = and i32 %2, 65535
%4 = ashr i32 %2, 16
%5 = sitofp i32 %4 to double
%6 = sitofp i32 %3 to double
%7 = fmul double %6, 0x3EF0000000000000
%8 = fadd double %7, %5
ret double %8
}
/* Variables and functions */
int d33(int);
int d34(int a) { return d33(d33(a)); }


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

x86 assembly (clang, -O2):
<d34>:
push   %rax
call   1030 <d33@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d33@plt>

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

LLVM IR (-O2):
define i32 @d34(i32 %0) {
%2 = tail call i32 @d33(i32 %0)
%3 = tail call i32 @d33(i32 %2)
ret i32 %3
}
extern unsigned char get_bit_1(const unsigned char c) { return (c & 0x2) > 0; }


x86 assembly (clang, -O0):
<get_bit_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit_1>:
mov    %edi,%eax
shr    %al
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_bit_1(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 2
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @get_bit_1(i8 zeroext %0) {
%2 = lshr i8 %0, 1
%3 = and i8 %2, 1
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int ftruncate(int fd, off_t length) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ftruncate(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *, int *, int *);
void main() {
  unsigned a;
  int start, end;
  unsigned getbits(unsigned, int, int);
  printf("enter the a,start,end:\n");
  scanf("%o %d %d", &a, &start, &end);
  printf("the change is:%o\n", getbits(a, start, end));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <getbits@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1060 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1050 <getbits@plt>
lea    0xe86(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"enter the a,start,end:\0A\00"
@.str.1 = [9 x i8] c"%o %d %d\00"
@.str.2 = [18 x i8] c"the change is:%o\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @getbits(i32 %6, i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%o %d %d\00"
@.str.2 = [18 x i8] c"the change is:%o\0A\00"
@str = [23 x i8] c"enter the a,start,end:\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @getbits(i32 %9, i32 %10, i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret void
}
int kmalloc_setup() { return 0; }


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

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

LLVM IR (-O0):
define i32 @kmalloc_setup() {
ret i32 0
}

LLVM IR (-O2):
define i32 @kmalloc_setup() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g();
int /*<<< orphan*/ h();
void f() {
  g();
  h();
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = call i32 (...) @g()
%2 = call i32 (...) @h()
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 (...) @g()
%2 = tail call i32 (...) @h()
ret void
}
int main(void) {
  int x = 0;
  return 1 / x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%eax
cltd
idivl  -0x8(%rbp)
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
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ pnp_write_config(unsigned char, int, int);
void pnp_set_enable(unsigned char port, int enable) {
  pnp_write_config(port, enable ? 0x1 : 0x0, 0x30);
}


x86 assembly (clang, -O0):
<pnp_set_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
xor    %esi,%esi
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%esi
mov    $0x30,%edx
movzbl %al,%edi
call   1030 <pnp_write_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnp_set_enable>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    %eax,%esi
mov    $0x30,%edx
jmp    1030 <pnp_write_config@plt>

LLVM IR (-O0):
define void @pnp_set_enable(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = call i32 @pnp_write_config(i8 zeroext %5, i32 %9, i32 48)
ret void
}

LLVM IR (-O2):
define void @pnp_set_enable(i8 zeroext %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @pnp_write_config(i8 zeroext %0, i32 %4, i32 48)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_shuffle_ps(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
__m128 test_mm_shuffle_ps(__m128 A, __m128 B) {
  return _mm_shuffle_ps(A, B, 0);
}


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

x86 assembly (clang, -O2):
<test_mm_shuffle_ps>:
xor    %edx,%edx
jmp    1030 <_mm_shuffle_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_shuffle_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_shuffle_ps(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int entrar_dados() {
  int op;
  printf("Informe o elemento: ");
  scanf("%d", &op);
  return op;
}


x86 assembly (clang, -O0):
<entrar_dados>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entrar_dados>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Informe o elemento: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @entrar_dados() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"Informe o elemento: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @entrar_dados() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
int expect_long_double_sum(long double (*f)(long double, long double)) {
  return f(-20.0, -22.0) == -42.0;
}


x86 assembly (clang, -O0):
<expect_long_double_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rsp,%rcx
flds   0xee7(%rip)
fstpt  0x10(%rcx)
flds   0xee2(%rip)
fstpt  (%rcx)
call   *%rax
flds   0xedc(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_long_double_sum>:
sub    $0x28,%rsp
flds   0xef6(%rip)
fstpt  0x10(%rsp)
flds   0xef0(%rip)
fstpt  (%rsp)
call   *%rdi
flds   0xee9(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @expect_long_double_sum(x86_fp80 (x86_fp80, x86_fp80)* %0) {
%2 = alloca x86_fp80 (x86_fp80, x86_fp80)*
store x86_fp80 (x86_fp80, x86_fp80)* %0, x86_fp80 (x86_fp80, x86_fp80)** %2
%3 = load x86_fp80 (x86_fp80, x86_fp80)*, x86_fp80 (x86_fp80, x86_fp80)** %2
%4 = call x86_fp80 %3(x86_fp80 0xKC003A000000000000000, x86_fp80 0xKC003B000000000000000)
%5 = fcmp oeq x86_fp80 %4, 0xKC004A800000000000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @expect_long_double_sum(x86_fp80 (x86_fp80, x86_fp80)* nocapture %0) {
%2 = tail call x86_fp80 %0(x86_fp80 0xKC003A000000000000000, x86_fp80 0xKC003B000000000000000)
%3 = fcmp oeq x86_fp80 %2, 0xKC004A800000000000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ esh_signal_fg(int);
void esh_signal_handler_int(int sig) {
  assert(sig == SIGINT);
  esh_signal_fg(sig);
}


x86 assembly (clang, -O0):
<esh_signal_handler_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
call   1030 <esh_signal_fg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esh_signal_handler_int>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
xor    %edi,%edi
cmp    %ebx,(%rax)
sete   %dil
call   1040 <assert@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <esh_signal_fg@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @esh_signal_handler_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @esh_signal_fg(i32 %8)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @esh_signal_handler_int(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @esh_signal_fg(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_square(uintptr_t, uintptr_t);
void fiat_p256_square(uint32_t out1[8], const uint32_t arg1[8]) {
  internal_fiat_p256_square((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_square>:
jmp    1030 <internal_fiat_p256_square@plt>

LLVM IR (-O0):
define void @fiat_p256_square(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p256_square(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_square(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p256_square(i64 %3, i64 %4)
ret void
}