xunge/DecIR huggingface dataset:
/* Variables and functions */
float area(double);
int /*<<< orphan*/ printf(char *, float);
int main() {
  float size = area(3.0 * 2.0);
  printf("Area is %f\n", size);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
call   1040 <area@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <area@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Area is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float @area(double 6.000000e+00)
store float %3, float* %2
%4 = load float, float* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Area is %f\0A\00"
define i32 @main() {
%1 = tail call float @area(double 6.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(float *);
int /*<<< orphan*/ generate(int /*<<< orphan*/ *, float *, int);
int getsize(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ mergesort(float *, int);
int /*<<< orphan*/ print(float *, int);
int sort(FILE *fp) {
  int size = getsize(fp);
  float *array = (float *)malloc(size * sizeof(float));
  generate(fp, array, size);
  mergesort(array, size);
  print(array, size);
  free(array);
  return 1;
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <getsize@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1080 <generate@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <mergesort@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <print@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1070 <getsize@plt>
mov    %eax,%r15d
lea    0x0(,%r15,4),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
mov    %r15d,%edx
call   1080 <generate@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1060 <mergesort@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @sort(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca float*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @getsize(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to float*
store float* %12, float** %4
%13 = load i32*, i32** %2
%14 = load float*, float** %4
%15 = load i32, i32* %3
%16 = call i32 @generate(i32* %13, float* %14, i32 %15)
%17 = load float*, float** %4
%18 = load i32, i32* %3
%19 = call i32 @mergesort(float* %17, i32 %18)
%20 = load float*, float** %4
%21 = load i32, i32* %3
%22 = call i32 @print(float* %20, i32 %21)
%23 = load float*, float** %4
%24 = call i32 @free(float* %23)
ret i32 1
}

LLVM IR (-O2):
define i32 @sort(i32* %0) {
%2 = tail call i32 @getsize(i32* %0)
%3 = shl i32 %2, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to float*
%6 = tail call i32 @generate(i32* %0, float* %5, i32 %2)
%7 = tail call i32 @mergesort(float* %5, i32 %2)
%8 = tail call i32 @print(float* %5, i32 %2)
%9 = tail call i32 @free(float* %5)
ret i32 1
}
/* Variables and functions */
int spawnvpe(int, char const *, char const **, char const **);
int spawnlpe(int mode, const char *path, const char *argv0, ...) {
  char const **ptr;
  for (ptr = &argv0; *ptr; ptr++)
    ;
  ptr = (char const **)(*++ptr);
  ;
  return spawnvpe(mode, path, &argv0, ptr);
}


x86 assembly (clang, -O0):
<spawnlpe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <spawnlpe+0x3f>
jmp    113e <spawnlpe+0x2e>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <spawnlpe+0x1b>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x18(%rbp),%rdx
call   1030 <spawnvpe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spawnlpe>:
push   %rax
mov    %rdx,(%rsp)
test   %rdx,%rdx
je     1130 <spawnlpe+0x20>
mov    %rsp,%rcx
nopl   (%rax)
lea    0x8(%rcx),%rax
cmpq   $0x0,0x8(%rcx)
mov    %rax,%rcx
jne    1120 <spawnlpe+0x10>
jmp    1133 <spawnlpe+0x23>
mov    %rsp,%rax
mov    0x8(%rax),%rcx
mov    %rsp,%rdx
call   1030 <spawnvpe@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @spawnlpe(i32 %0, i8* %1, i8* %2, ...) {
%4 = alloca i8*
store i8* %2, i8** %4
%5 = icmp eq i8* %2, null
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8** [ %8, %6 ], [ %4, %3 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %3
%12 = phi i8** [ %4, %3 ], [ %8, %6 ]
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = bitcast i8** %13 to i8***
%15 = load i8**, i8*** %14
%16 = call i32 @spawnvpe(i32 %0, i8* %1, i8** %4, i8** %15)
ret i32 %16
}
int f_eq_rr2(float a1, float a2) { return !(((a1) == (a2))); }


x86 assembly (clang, -O0):
<f_eq_rr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eq_rr2>:
cmpneqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_eq_rr2(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 = fcmp oeq float %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_eq_rr2(float %0, float %1) {
%3 = fcmp une float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ x1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  struct X {
    int a;
    char b;
    int c;
  } x1;
  struct Y {
    int a;
    char b;
    int c;
    char d;
  } y1;
  printf("sizeof X = %d\n", sizeof(struct X));
  printf("sizeof x = %d\n\n", sizeof(x1));
  printf("sizeof Y = %d\n", sizeof(struct Y));
  printf("sizeof Y = %d\n", sizeof y1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.X = type { i32, i8, i32 }
%struct.Y = type { i32, i8, i32, i8 }
@.str = [15 x i8] c"sizeof X = %d\0A\00"
@.str.1 = [16 x i8] c"sizeof x = %d\0A\0A\00"
@.str.2 = [15 x i8] c"sizeof Y = %d\0A\00"
define void @main() {
%1 = alloca %struct.X
%2 = alloca %struct.Y
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 12)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 16)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
%struct.X = type { i32, i8, i32 }
%struct.Y = type { i32, i8, i32, i8 }
@.str = [15 x i8] c"sizeof X = %d\0A\00"
@.str.1 = [16 x i8] c"sizeof x = %d\0A\0A\00"
@.str.2 = [15 x i8] c"sizeof Y = %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 12)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 16)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret void
}
/* Variables and functions */
void SNDDMA_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @SNDDMA_Shutdown() {
ret void
}
int main(void) {
  int counter = 0;
  while (counter < 5) {
    counter++;
    if (2 == counter) {
      continue;
    }
    if (3 == counter) {
      continue;
    }
    if (4 == counter) {
      continue;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1163 <main+0x63>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jne    1138 <main+0x38>
jmp    1112 <main+0x12>
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jne    114b <main+0x4b>
jmp    1112 <main+0x12>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
jne    115e <main+0x5e>
jmp    1112 <main+0x12>
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, int);
void BSP_OtherHandlerEntry(int core, unsigned int vectorNum) {
  printf("unresolved interrupt request %d from core %d\n", vectorNum, core);
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"unresolved interrupt request %d from core %d\0A\00"
define void @BSP_OtherHandlerEntry(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"unresolved interrupt request %d from core %d\0A\00"
define void @BSP_OtherHandlerEntry(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ om_sysfs_set(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int om_screen_brightness_set(int val) {
  char sval[20];
  snprintf(sval, 20, "%d", val);
  return om_sysfs_set("brightness", sval) == 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<om_screen_brightness_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x14,%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <om_sysfs_set@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_screen_brightness_set>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <snprintf@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <om_sysfs_set@plt>
neg    %rax
sbb    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"brightness\00"
define i32 @om_screen_brightness_set(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i64 @om_sysfs_set(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
ret i32 %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"brightness\00"
define i32 @om_screen_brightness_set(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i64 @om_sysfs_set(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int getVal();
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a = getVal();
  test_assert(a == 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getVal@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getVal@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
call   1040 <test_assert@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 (...) @getVal()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 9
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getVal()
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @test_assert(i32 %3)
ret i32 0
}
void memory_barrier(void) { asm volatile("" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @memory_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int test_imm_42uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x42 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_42uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4325376
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bar(struct S *);
void foo1(struct S *s) { bar(s); }


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

x86 assembly (clang, -O2):
<foo1>:
jmp    1030 <bar@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @foo1(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = load %struct.S*, %struct.S** %2
%4 = call i32 @bar(%struct.S* %3)
ret void
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @foo1(%struct.S* %0) {
%2 = tail call i32 @bar(%struct.S* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tls_set() {
  printf("NOT IMPLEMENTED:"
         "pa_tls_set"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"NOT IMPLEMENTED:pa_tls_set\0A\00"
define i32 @pa_tls_set() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [27 x i8] c"NOT IMPLEMENTED:pa_tls_set\00"
define i32 @pa_tls_set() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ EOF;
int EXIT_SUCCESS;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", getchar() != EOF);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @getchar()
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Type definitions */
struct stat {
  scalar_t__ st_nlink;
};

/* Variables and functions */
int file_linked(const struct stat *stat) { return stat->st_nlink == 0; }


x86 assembly (clang, -O0):
<file_linked>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_linked>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @file_linked(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @file_linked(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned char *calloc(int, int);
unsigned char *ltoc(long num) {
  unsigned char *temp = calloc(1, sizeof(char) * 4);
  temp[0] = num;
  temp[1] = num >> 8;
  temp[2] = num >> 16;
  temp[3] = num >> 24;
  return temp;
}


x86 assembly (clang, -O0):
<ltoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
sar    $0x18,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @ltoc(i64 %0) {
%2 = tail call dereferenceable_or_null(4) i8* @calloc(i32 1, i32 4)
%3 = trunc i64 %0 to i8
store i8 %3, i8* %2
%4 = lshr i64 %0, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %2, i64 1
store i8 %5, i8* %6
%7 = lshr i64 %0, 16
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %2, i64 2
store i8 %8, i8* %9
%10 = lshr i64 %0, 24
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %2, i64 3
store i8 %11, i8* %12
ret i8* %2
}
void TestGenericSelectionExpressions(int i) {
  _Generic(i, int : 12);
  _Generic(i, int : 12, default : 0);
  _Generic(i, default : 0, int : 12);
  _Generic(i, int : 12, float : 10, default : 100);
  int j = _Generic(i, int : 12);
}


x86 assembly (clang, -O0):
<TestGenericSelectionExpressions>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @TestGenericSelectionExpressions(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 12, i32* %3
ret void
}

LLVM IR (-O2):
define void @TestGenericSelectionExpressions(i32 %0) {
ret void
}
void hand_call(void) {}


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

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

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

LLVM IR (-O2):
define void @hand_call() {
ret void
}
void gtk_drag_dest_add_image_targets() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drag_dest_add_image_targets() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ probme3();
int /*<<< orphan*/ prtusage();
int main(int argc, char *argv[]) {
  if (argc != 1) {
    prtusage();
    exit(EXIT_FAILURE);
  }
  probme3();
  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)
cmpl   $0x1,-0x8(%rbp)
je     1165 <main+0x35>
mov    $0x0,%al
call   1030 <prtusage@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1040 <probme3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
cmp    $0x1,%edi
jne    1141 <main+0x11>
call   1040 <probme3@plt>
xor    %eax,%eax
pop    %rcx
ret
call   1030 <prtusage@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
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 i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = call i32 (...) @prtusage()
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
%13 = call i32 (...) @probme3()
ret i32 0
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (...) @prtusage()
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
%9 = tail call i32 (...) @probme3()
ret i32 0
}
int min(int X, int Y) { return ((X) < (Y)) ? (X) : (Y); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int c(int i) { return i + 3; }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
lea    0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @c(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
void steal_shield(struct battle_char *origin, struct battle_char *target) {}


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

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

LLVM IR (-O0):
%struct.battle_char = type opaque
define void @steal_shield(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
ret void
}

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @steal_shield(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adjustC(int);
int /*<<< orphan*/ storesudirript();
void lua_storesudirript(void) {
  adjustC(3);
  storesudirript();
}


x86 assembly (clang, -O0):
<lua_storesudirript>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <adjustC@plt>
mov    $0x0,%al
call   1030 <storesudirript@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_storesudirript>:
push   %rax
mov    $0x3,%edi
call   1040 <adjustC@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <storesudirript@plt>

LLVM IR (-O0):
define void @lua_storesudirript() {
%1 = call i32 @adjustC(i32 3)
%2 = call i32 (...) @storesudirript()
ret void
}

LLVM IR (-O2):
define void @lua_storesudirript() {
%1 = tail call i32 @adjustC(i32 3)
%2 = tail call i32 (...) @storesudirript()
ret void
}
void gtk_tree_model_filter_convert_iter_to_child_iter() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_filter_convert_iter_to_child_iter() {
ret void
}
void lockdep_register_key(struct lock_class_key *key) {}


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

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

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

LLVM IR (-O2):
%struct.lock_class_key = type opaque
define void @lockdep_register_key(%struct.lock_class_key* nocapture %0) {
ret void
}
/* Variables and functions */
void *secCalloc(int, size_t);
void *secMalloc(size_t size) { return secCalloc(1, size); }


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

x86 assembly (clang, -O2):
<secMalloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <secCalloc@plt>

LLVM IR (-O0):
define i8* @secMalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @secCalloc(i32 1, i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @secMalloc(i64 %0) {
%2 = tail call i8* @secCalloc(i32 1, i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ attribute;

/* Variables and functions */
char *get_sysfs_str(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
char *get_DiskState(char *scsi) {
  char attribute[256];
  memset(attribute, 0, sizeof(attribute));
  snprintf(attribute, sizeof(attribute) - 1,
           "/sys/class/scsi_device/%s/device/state", scsi);
  return (get_sysfs_str(attribute));
}


x86 assembly (clang, -O0):
<get_DiskState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0xff,%esi
lea    0xe97(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <get_sysfs_str@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_DiskState>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    0xeaa(%rip),%rdx
mov    %r14,%rdi
mov    $0xff,%esi
mov    %rbx,%rcx
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1050 <get_sysfs_str@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"/sys/class/scsi_device/%s/device/state\00"
define i8* @get_DiskState(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %6, i32 255, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i8* @get_sysfs_str(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [39 x i8] c"/sys/class/scsi_device/%s/device/state\00"
define i8* @get_DiskState(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 256)
%5 = call i32 @snprintf(i8* %3, i32 255, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i8* @get_sysfs_str(i8* %3)
ret i8* %6
}
int mylib2_fct1(void) {
  printf("%s\n", __FUNCTION__);
  mylib3_fct1();
  return 0;
}


x86 assembly (clang, -O0):
<mylib2_fct1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <mylib3_fct1@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__FUNCTION__.mylib2_fct1 = [12 x i8] c"mylib2_fct1\00"
define i32 @mylib2_fct1() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.mylib2_fct1, i64 0, i64 0))
%2 = call i32 (...) @mylib3_fct1()
ret i32 0
}

LLVM IR (-O2):
@__FUNCTION__.mylib2_fct1 = [12 x i8] c"mylib2_fct1\00"
define i32 @mylib2_fct1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.mylib2_fct1, i64 0, i64 0))
%2 = tail call i32 (...) @mylib3_fct1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PSRLD(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xd2);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_PSRLD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xd2,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PSRLD>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xd2,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PSRLD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 210)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PSRLD(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 210)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
void write_byte(unsigned char **dest, unsigned char value) {
  assert(dest);
  assert(*dest);
  **dest = value;
  (*dest)++;
}


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

x86 assembly (clang, -O2):
<write_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <assert@plt>
mov    (%rbx),%rdi
xor    %eax,%eax
call   1030 <assert@plt>
mov    (%rbx),%rax
mov    %bpl,(%rax)
addq   $0x1,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @write_byte(i8** %0, i8 zeroext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8**, i8*** %3
%6 = call i32 (i8**, ...) bitcast (i32 (...)* @assert to i32 (i8**, ...)*)(i8** %5)
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %8)
%10 = load i8, i8* %4
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
store i8 %10, i8* %12
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %13
ret void
}

LLVM IR (-O2):
define void @write_byte(i8** %0, i8 zeroext %1) {
%3 = tail call i32 (i8**, ...) bitcast (i32 (...)* @assert to i32 (i8**, ...)*)(i8** %0)
%4 = load i8*, i8** %0
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %4)
%6 = load i8*, i8** %0
store i8 %1, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
ret void
}
unsigned xrop3_174_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = S & stk3;
  stk1 = D | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_174_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_174_0_0>:
shl    $0x8,%edi
shl    $0x8,%esi
not    %esi
and    %edi,%esi
lea    0xff(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @xrop3_174_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_174_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
%9 = or i32 %8, 255
ret i32 %9
}
int test_imm_84int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x84 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_84int64_highword_mem>:
testb  $0x84,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_84int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 566935683072
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main() {
  int i, sn = 0;
  for (i = 1; i <= 8; i++) {
    sn = sn + (2);
  }
  __VERIFIER_assert(sn == 8 * (2) || sn == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    $0x1,%al
cmpl   $0x10,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1167 <main+0x57>
cmpl   $0x0,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 8
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 2
store i32 %9, i32* %3
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 16
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 0
br label %19
19: ; preds = %16, %13
%20 = phi i1 [ true, %13 ], [ %18, %16 ]
%21 = zext i1 %20 to i32
%22 = call i32 @__VERIFIER_assert(i32 %21)
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) { printf("hello!\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"hello!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_file(const char *filename) {
  struct stat buf;
  if (stat(filename, &buf) < 0) {
    return -1;
  }
  if (S_ISREG(buf.st_mode)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    114f <is_file+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <is_file+0x54>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
je     116d <is_file+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <is_file+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1143 <is_file+0x23>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i64 @S_ISREG(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %16
15: ; preds = %9
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ -1, %1 ], [ %11, %6 ]
ret i32 %13
}