xunge/DecIR huggingface dataset:
/* Type definitions */
typedef struct string const string;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ string_get(struct string const *);
int /*<<< orphan*/ string_set(struct string const *, int /*<<< orphan*/);
void string_copy(struct string *dst, struct string const *src) {
  assert(src != dst);
  string_set(dst, string_get(src));
}


x86 assembly (clang, -O0):
<string_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <string_get@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <string_set@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    %r14,%rsi
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <string_get@plt>
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <string_set@plt>

LLVM IR (-O0):
%struct.string = type opaque
define void @string_copy(%struct.string* %0, %struct.string* %1) {
%3 = alloca %struct.string*
%4 = alloca %struct.string*
store %struct.string* %0, %struct.string** %3
store %struct.string* %1, %struct.string** %4
%5 = load %struct.string*, %struct.string** %4
%6 = load %struct.string*, %struct.string** %3
%7 = icmp ne %struct.string* %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load %struct.string*, %struct.string** %3
%11 = load %struct.string*, %struct.string** %4
%12 = call i32 @string_get(%struct.string* %11)
%13 = call i32 @string_set(%struct.string* %10, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.string = type opaque
define void @string_copy(%struct.string* %0, %struct.string* %1) {
%3 = icmp ne %struct.string* %1, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @string_get(%struct.string* %1)
%7 = tail call i32 @string_set(%struct.string* %0, i32 %6)
ret void
}
/* Variables and functions */
int max_sum(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[9] = {-2, 1, -3, 4, -1, 2, 1, -5, 5};
  printf("max_sum = %d\n", max_sum(array, 9));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1030 <max_sum@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <max_sum@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

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


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

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

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

LLVM IR (-O2):
define void @g_queue_pop_tail() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EMACRxEnable(uint32_t ui32Base) {
  (*((volatile uint32_t *)(ui32Base + 0x00000C18))) |= 0x00000002;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) |= 0x00000004;
}


x86 assembly (clang, -O0):
<EMACRxEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc18,%eax
cltq
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
or     $0x4,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACRxEnable>:
movslq %edi,%rax
orl    $0x2,0xc18(%rax)
orl    $0x4,(%rax)
ret

LLVM IR (-O0):
define void @EMACRxEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3096
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 0
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = or i32 %13, 4
store volatile i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @EMACRxEnable(i32 %0) {
%2 = add nsw i32 %0, 3096
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 2
store volatile i32 %6, i32* %4
%7 = sext i32 %0 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = or i32 %9, 4
store volatile i32 %10, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ purgeline(int /*<<< orphan*/);
int strlen(char *);
int *stub1(int, char *, int);
void canit(int fd, int *func_write(int, char *, int)) {
  static char canistr[] = {24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 8,
                           8,  8,  8,  8,  8,  8,  8,  8,  8,  0};
  purgeline(0);
  (*func_write)(fd, canistr, strlen(canistr));
}


x86 assembly (clang, -O0):
<canit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <purgeline@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0x2ef5(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%edx
mov    -0x18(%rbp),%rax
lea    0x2ee0(%rip),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canit>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <purgeline@plt>
lea    0x2f08(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
jmp    *%rax

LLVM IR (-O0):
@canit.canistr = internal global [21 x i8] c"\18\18\18\18\18\18\18\18\18\18\08\08\08\08\08\08\08\08\08\08\00"
define void @canit(i32 %0, i32* (i32, i8*, i32)* %1) {
%3 = alloca i32
%4 = alloca i32* (i32, i8*, i32)*
store i32 %0, i32* %3
store i32* (i32, i8*, i32)* %1, i32* (i32, i8*, i32)** %4
%5 = call i32 @purgeline(i32 0)
%6 = load i32* (i32, i8*, i32)*, i32* (i32, i8*, i32)** %4
%7 = load i32, i32* %3
%8 = call i32 @strlen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @canit.canistr, i64 0, i64 0))
%9 = call i32* %6(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @canit.canistr, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@canit.canistr = internal global [21 x i8] c"\18\18\18\18\18\18\18\18\18\18\08\08\08\08\08\08\08\08\08\08\00"
define void @canit(i32 %0, i32* (i32, i8*, i32)* nocapture %1) {
%3 = tail call i32 @purgeline(i32 0)
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @canit.canistr, i64 0, i64 0))
%5 = tail call i32* %1(i32 %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @canit.canistr, i64 0, i64 0), i32 %4)
ret void
}
void ARGBToRGB565DitherRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB565DitherRow_Any_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *);
int skip_lines(FILE *stream, int lines) {
  for (int i = 0; i < lines; ++i) {
    fscanf(stream, "%*[^\n]\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<skip_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <skip_lines+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fscanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <skip_lines+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_lines>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1140 <skip_lines+0x30>
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <fscanf@plt>
add    $0xffffffff,%ebx
jne    1130 <skip_lines+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%*[^\0A]\0A\00"
define i32 @skip_lines(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret i32 0
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %4, label %5
}
void bar() { asm(""); }


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

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

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

LLVM IR (-O2):
define void @bar() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *, long *);
int main(void) {
  long a, b;
  scanf("%ld%ld", &a, &b);
  printf("%ld\n", a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rsi
add    -0x18(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%ld%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = add nsw i64 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %8)
ret i32 0
}
double fmin(double a, double b) {
  if (a < b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fmin+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <fmin+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmin>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @fmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ pr(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, char *, int *);
int main(int argc, char *argv[]) {
  char c;
  int scale;
  scanf("%c %d", &c, &scale);
  pr(&c, 1, scale, scale);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x11(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    -0x11(%rbp),%rdi
mov    $0x1,%esi
call   1030 <pr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xb(%rsp),%rbx
lea    0xc(%rsp),%rdx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ecx,%edx
call   1030 <pr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_background_area() {
ret void
}
/* Variables and functions */
unsigned int xatoull_range(char const *, unsigned int, unsigned int);
unsigned int xatou_range(const char *str, unsigned int l, unsigned int u) {
  return xatoull_range(str, l, u);
}


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

x86 assembly (clang, -O2):
<xatou_range>:
jmp    1030 <xatoull_range@plt>

LLVM IR (-O0):
define i32 @xatou_range(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @xatoull_range(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @xatou_range(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @xatoull_range(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_08(int Salt, int Parameter) {
  unsigned b = Salt * 0x3C23132D + 0x339B;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_08>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x3c23132d,-0x4(%rbp),%eax
add    $0x339b,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_08>:
imul   $0x3c23132d,%edi,%edi
add    $0x339b,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_08(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 1008931629
%8 = add nsw i32 %7, 13211
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_08(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 1008931629
%4 = add nsw i32 %3, 13211
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned long long);
void yuyv2uyvy(unsigned char *src, unsigned char *dest,
               unsigned long long int NumPixels) {
  memcpy(dest, src, NumPixels << 1);
}


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

x86 assembly (clang, -O2):
<yuyv2uyvy>:
mov    %rdi,%rax
add    %rdx,%rdx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @yuyv2uyvy(i8* %0, i8* %1, i64 %2) {
%4 = shl i64 %2, 1
%5 = tail call i32 @memcpy(i8* %1, i8* %0, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _ifconfig_error(char const *message, int ret) {
  fputs("ifconfig"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_ifconfig_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ifconfig_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"ifconfig: \00"
@stderr = global i32 0
define i32 @_ifconfig_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"ifconfig: \00"
@stderr = global i32 0
define i32 @_ifconfig_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
long long cpucycles_amd64tscfreq(void) {
  unsigned long long result;
  asm volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax"
               : "=a"(result)::"%rdx");
  return result;
}


x86 assembly (clang, -O0):
<cpucycles_amd64tscfreq>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpucycles_amd64tscfreq>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @cpucycles_amd64tscfreq() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @cpucycles_amd64tscfreq() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
int f2(int a) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
ret i32 2
}
/* Variables and functions */
scalar_t__ ft_atoll(char const *);
int ft_atoi(const char *str) { return ((int)(ft_atoll(str))); }


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

x86 assembly (clang, -O2):
<ft_atoi>:
jmp    1030 <ft_atoll@plt>

LLVM IR (-O0):
define i32 @ft_atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @ft_atoll(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ft_atoi(i8* %0) {
%2 = tail call i64 @ft_atoll(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, int *, int);
int /*<<< orphan*/ push_bytearray(char *, int);
void push_int(int value) {
  char object[sizeof(value)];
  int i = 0;
  memcpy(object, &value, sizeof(value));
  push_bytearray(object, sizeof(value));
}


x86 assembly (clang, -O0):
<push_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <push_bytearray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_int>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x8(%rsp)
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <push_bytearray@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @push_int(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = call i32 @memcpy(i8* %5, i32* %2, i32 4)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i32 @push_bytearray(i8* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @push_int(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i32* %2, i32 4)
%6 = call i32 @push_bytearray(i8* %4, i32 4)
ret void
}
/* Variables and functions */
char const *dgettext(char *, char const *);
const char *_(const char *msgid) { return dgettext("gtk", msgid); }


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

x86 assembly (clang, -O2):
<_>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <dgettext@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"gtk\00"
define i8* @_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @dgettext(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"gtk\00"
define i8* @_(i8* %0) {
%2 = tail call i8* @dgettext(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
double diff(double x) { return (3 * x * x - 4 * x - 4); }


x86 assembly (clang, -O0):
<diff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xedd(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm2
mulsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @diff(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.000000e+00, %3
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double 4.000000e+00, %6
%8 = fneg double %7
%9 = call double @llvm.fmuladd.f64(double %4, double %5, double %8)
%10 = fsub double %9, 4.000000e+00
ret double %10
}

LLVM IR (-O2):
define double @diff(double %0) {
%2 = fmul double %0, 3.000000e+00
%3 = fmul double %0, -4.000000e+00
%4 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %3)
%5 = fadd double %4, -4.000000e+00
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ endswap64(int /*<<< orphan*/);
scalar_t__ is_little_endian();
uint64_t be64_to_cpu(uint64_t x) {
  uint64_t ret = x;
  if (is_little_endian()) {
    ret = endswap64(x);
  }
  return ret;
}


x86 assembly (clang, -O0):
<be64_to_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <is_little_endian@plt>
cmp    $0x0,%rax
je     114d <be64_to_cpu+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <endswap64@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be64_to_cpu>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <is_little_endian@plt>
test   %rax,%rax
je     1137 <be64_to_cpu+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <endswap64@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @be64_to_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = call i64 (...) @is_little_endian()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @endswap64(i32 %8)
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @be64_to_cpu(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @endswap64(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
void ade7753_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @ade7753_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
int main(int argc, const char *argv[]) {
  unsigned char a;
  unsigned b = 256;
  a = b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x100,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %al,-0x11(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 256, i32* %7
%8 = load i32, i32* %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int socket_v_api(void) { return 0x20120804; }


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

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

LLVM IR (-O0):
define i32 @socket_v_api() {
ret i32 538052612
}

LLVM IR (-O2):
define i32 @socket_v_api() {
ret i32 538052612
}
/* Type definitions */
typedef void *__u8;
typedef int __u16;

/* Variables and functions */
void put_unaligned_le16(__u16 val, __u16 *cp) {
  __u8 *p = (void *)cp;
  *p++ = (__u8)val;
  *p++ = (__u8)(val >> 8);
}


x86 assembly (clang, -O0):
<put_unaligned_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_unaligned_le16>:
movslq %edi,%rax
mov    %rax,(%rsi)
sar    $0x8,%eax
cltq
mov    %rax,0x8(%rsi)
ret

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

LLVM IR (-O2):
define void @put_unaligned_le16(i32 %0, i32* nocapture writeonly %1) {
%3 = bitcast i32* %1 to i8**
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds i32, i32* %1, i64 2
%7 = bitcast i32* %6 to i8**
store i8* %5, i8** %3
%8 = ashr i32 %0, 8
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %7
ret void
}
void my_task_without_any_parameters(void) {}


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

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

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

LLVM IR (-O2):
define void @my_task_without_any_parameters() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("I just got loaded\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 = [19 x i8] c"I just got loaded\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"I just got loaded\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int BIT(int);
int wpa_key_mgmt_wpa_psk(int akm) {
  return !!(akm & (BIT(1) | BIT(6) | BIT(8)));
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_wpa_psk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <BIT@plt>
mov    %eax,-0x10(%rbp)
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x8,%edi
call   1030 <BIT@plt>
mov    -0xc(%rbp),%ecx
mov    %eax,%edx
mov    -0x8(%rbp),%eax
or     %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_wpa_psk>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    $0x1,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    $0x8,%edi
call   1030 <BIT@plt>
or     %ebx,%eax
xor    %ecx,%ecx
test   %r14d,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_wpa_psk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @BIT(i32 1)
%5 = call i32 @BIT(i32 6)
%6 = or i32 %4, %5
%7 = call i32 @BIT(i32 8)
%8 = or i32 %6, %7
%9 = and i32 %3, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_wpa_psk(i32 %0) {
%2 = tail call i32 @BIT(i32 1)
%3 = tail call i32 @BIT(i32 6)
%4 = or i32 %3, %2
%5 = tail call i32 @BIT(i32 8)
%6 = or i32 %4, %5
%7 = and i32 %6, %0
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
gen_div() {
  gen_pop();
  gen_call("ccdiv");
}


x86 assembly (clang, -O0):
<gen_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen_call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_div>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccdiv\00"
define i32 @gen_div() {
%1 = alloca i32
%2 = call i32 (...) @gen_pop()
%3 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccdiv\00"
define i32 @gen_div() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ errexit(char *);
void usage() { errexit("Usage: fsck_msdos [-fnpqy] filesystem ... \n"); }


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: fsck_msdos [-fnpqy] filesystem ... \0A\00"
define void @usage() {
%1 = call i32 @errexit(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Usage: fsck_msdos [-fnpqy] filesystem ... \0A\00"
define void @usage() {
%1 = tail call i32 @errexit(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int constantP(void *pval, int rn, void *rp, int rs) {

  int k;
  for (k = 0; k < rn; k++) {
    memcpy(rp + k * rs, pval, rs);
  }
  return 0;
}


x86 assembly (clang, -O0):
<constantP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1163 <constantP+0x53>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112d <constantP+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constantP>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <constantP+0x37>
mov    %rdx,%rbx
mov    %rdi,%r14
movslq %ecx,%r15
mov    %esi,%r12d
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <memcpy@plt>
add    %r15,%rbx
add    $0xffffffffffffffff,%r12
jne    1130 <constantP+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @constantP(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
store i32 0, i32* %9
br label %10
10: ; preds = %24, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i8*, i8** %7
%16 = load i32, i32* %9
%17 = load i32, i32* %8
%18 = mul nsw i32 %16, %17
%19 = sext i32 %18 to i64
%20 = getelementptr i8, i8* %15, i64 %19
%21 = load i8*, i8** %5
%22 = load i32, i32* %8
%23 = call i32 @memcpy(i8* %20, i8* %21, i32 %22)
br label %24
24: ; preds = %14
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
store i32 %26, i32* %9
br label %10
27: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @constantP(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %16
6: ; preds = %4
%7 = sext i32 %3 to i64
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %14, %9 ]
%11 = mul nsw i64 %10, %7
%12 = getelementptr i8, i8* %2, i64 %11
%13 = tail call i32 @memcpy(i8* %12, i8* %0, i32 %3)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %4
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ cap_user_header_t;
typedef int /*<<< orphan*/ cap_user_data_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_capset;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int capset(cap_user_header_t header, cap_user_data_t data) {
  return syscall(__NR_capset, header, data);
}


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

x86 assembly (clang, -O2):
<capset>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2edd(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_capset = global i32 0
define i32 @capset(i32 %0, i32 %1) {
%3 = load i32, i32* @__NR_capset
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
char getCarryflag(char flags[]) { return flags[8 - 1]; }


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

x86 assembly (clang, -O2):
<getCarryflag>:
mov    0x7(%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @getCarryflag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 7
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @getCarryflag(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
ret i8 %3
}
void *dlsym(void *ptr, const char *str) { return (void *)0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
int intcmp(const void *u, const void *v) {
  int a = *(int *)u;
  int b = *(int *)v;
  return u - v;
}


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

x86 assembly (clang, -O2):
<intcmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @intcmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
float cvSqrt(float arg) {
  float x, y;
  unsigned iarg = *((unsigned *)&arg);
  *((unsigned *)&x) = (0xbe6f0000 - iarg) >> 1;
  y = arg * 0.5f;
  x *= 1.5f - y * x * x;
  x *= 1.5f - y * x * x;
  return x * arg;
}


x86 assembly (clang, -O0):
<cvSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xbe6f0000,%eax
sub    -0x10(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
movss  0xedf(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xea9(%rip),%xmm1
addss  %xmm1,%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xe73(%rip),%xmm1
addss  %xmm1,%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvSqrt>:
movd   %xmm0,%eax
mov    $0xbe6f0000,%ecx
sub    %eax,%ecx
shr    %ecx
movd   %ecx,%xmm1
movss  0xee7(%rip),%xmm2
mulss  %xmm0,%xmm2
movaps %xmm2,%xmm3
mulss  %xmm1,%xmm3
mulss  %xmm1,%xmm3
movss  0xed4(%rip),%xmm4
addss  %xmm4,%xmm3
mulss  %xmm1,%xmm3
mulss  %xmm3,%xmm2
mulss  %xmm3,%xmm2
addss  %xmm4,%xmm2
mulss  %xmm3,%xmm2
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @cvSqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %2
%6 = bitcast float* %2 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = sub i32 -1100021760, %8
%10 = lshr i32 %9, 1
%11 = bitcast float* %3 to i32*
store i32 %10, i32* %11
%12 = load float, float* %2
%13 = fmul float %12, 5.000000e-01
store float %13, float* %4
%14 = load float, float* %4
%15 = load float, float* %3
%16 = fmul float %14, %15
%17 = load float, float* %3
%18 = fneg float %16
%19 = call float @llvm.fmuladd.f32(float %18, float %17, float 1.500000e+00)
%20 = load float, float* %3
%21 = fmul float %20, %19
store float %21, float* %3
%22 = load float, float* %4
%23 = load float, float* %3
%24 = fmul float %22, %23
%25 = load float, float* %3
%26 = fneg float %24
%27 = call float @llvm.fmuladd.f32(float %26, float %25, float 1.500000e+00)
%28 = load float, float* %3
%29 = fmul float %28, %27
store float %29, float* %3
%30 = load float, float* %3
%31 = load float, float* %2
%32 = fmul float %30, %31
ret float %32
}

LLVM IR (-O2):
define float @cvSqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = sub i32 -1100021760, %2
%4 = lshr i32 %3, 1
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
%10 = fmul float %6, %9
%11 = tail call float @llvm.fmuladd.f32(float %10, float %9, float 1.500000e+00)
%12 = fmul float %9, %11
%13 = fmul float %12, %0
ret float %13
}
int set_signal(int signo, void (*handler)(int), void (**oldhandler)(int)) {}


x86 assembly (clang, -O0):
<set_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @set_signal(i32 %0, void (i32)* %1, void (i32)** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca void (i32)*
%7 = alloca void (i32)**
store i32 %0, i32* %5
store void (i32)* %1, void (i32)** %6
store void (i32)** %2, void (i32)*** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @set_signal(i32 %0, void (i32)* nocapture readnone %1, void (i32)** nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ floorf(float);
float SCE_Math_Fractf(float x) { return x - ((float)floorf(x)); }


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

x86 assembly (clang, -O2):
<SCE_Math_Fractf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <floorf@plt>
cvtsi2ss %rax,%xmm1
movss  0x4(%rsp),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @SCE_Math_Fractf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call i64 @floorf(float %4)
%6 = sitofp i64 %5 to float
%7 = fsub float %3, %6
ret float %7
}

LLVM IR (-O2):
define float @SCE_Math_Fractf(float %0) {
%2 = tail call i64 @floorf(float %0)
%3 = sitofp i64 %2 to float
%4 = fsub float %0, %3
ret float %4
}