xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _setspeed(int, int, int, int, unsigned short);
void setspeed(int fd, int new, int needtowrite, unsigned short flags) {
  int i;
  for (i = 9600; i >= 1200; i >>= 1) {
    _setspeed(fd, i, new, needtowrite, flags);
  }
}


x86 assembly (clang, -O0):
<setspeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
movl   $0x2580,-0x14(%rbp)
cmpl   $0x4b0,-0x14(%rbp)
jl     1160 <setspeed+0x50>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
movzwl -0xe(%rbp),%r8d
call   1030 <_setspeed@plt>
mov    -0x14(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <setspeed+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setspeed>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2580,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <_setspeed@plt>
mov    %ebp,%edi
mov    $0x12c0,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <_setspeed@plt>
mov    %ebp,%edi
mov    $0x960,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <_setspeed@plt>
mov    %ebp,%edi
mov    $0x4b0,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_setspeed@plt>

LLVM IR (-O0):
define void @setspeed(i32 %0, i32 %1, i32 %2, i16 zeroext %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i16
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i16 %3, i16* %8
store i32 9600, i32* %9
br label %10
10: ; preds = %20, %4
%11 = load i32, i32* %9
%12 = icmp sge i32 %11, 1200
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %5
%15 = load i32, i32* %9
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i16, i16* %8
%19 = call i32 @_setspeed(i32 %14, i32 %15, i32 %16, i32 %17, i16 zeroext %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %9
%22 = ashr i32 %21, 1
store i32 %22, i32* %9
br label %10
23: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @setspeed(i32 %0, i32 %1, i32 %2, i16 zeroext %3) {
%5 = tail call i32 @_setspeed(i32 %0, i32 9600, i32 %1, i32 %2, i16 zeroext %3)
%6 = tail call i32 @_setspeed(i32 %0, i32 4800, i32 %1, i32 %2, i16 zeroext %3)
%7 = tail call i32 @_setspeed(i32 %0, i32 2400, i32 %1, i32 %2, i16 zeroext %3)
%8 = tail call i32 @_setspeed(i32 %0, i32 1200, i32 %1, i32 %2, i16 zeroext %3)
ret void
}
void XEHeadOfExtensionList() {}


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

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

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

LLVM IR (-O2):
define void @XEHeadOfExtensionList() {
ret void
}
int ZopfliGetDistSymbolExtraBits(int s) {
  static const int table[30] = {0, 0, 0,  0,  1,  1,  2,  2,  3,  3,
                                4, 4, 5,  5,  6,  6,  7,  7,  8,  8,
                                9, 9, 10, 10, 11, 11, 12, 12, 13, 13};
  return table[s];
}


x86 assembly (clang, -O0):
<ZopfliGetDistSymbolExtraBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xeee(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZopfliGetDistSymbolExtraBits>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@ZopfliGetDistSymbolExtraBits.table = internal constant [30 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3, i32 4, i32 4, i32 5, i32 5, i32 6, i32 6, i32 7, i32 7, i32 8, i32 8, i32 9, i32 9, i32 10, i32 10, i32 11, i32 11, i32 12, i32 12, i32 13, i32 13]
define i32 @ZopfliGetDistSymbolExtraBits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [30 x i32], [30 x i32]* @ZopfliGetDistSymbolExtraBits.table, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
@ZopfliGetDistSymbolExtraBits.table = internal unnamed_addr constant [30 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3, i32 4, i32 4, i32 5, i32 5, i32 6, i32 6, i32 7, i32 7, i32 8, i32 8, i32 9, i32 9, i32 10, i32 10, i32 11, i32 11, i32 12, i32 12, i32 13, i32 13]
define i32 @ZopfliGetDistSymbolExtraBits(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [30 x i32], [30 x i32]* @ZopfliGetDistSymbolExtraBits.table, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
void gtk_list_store_insert_with_valuesv() {}


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

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

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

LLVM IR (-O2):
define void @gtk_list_store_insert_with_valuesv() {
ret void
}
/* Variables and functions */
void **malloc(int);
void **createISIHolder(int sock, char *s, int len) {
  void **holder;
  holder = malloc(sizeof(void *) * 3);
  holder[0] = (int *)sock;
  holder[1] = (char *)s;
  holder[2] = (int *)len;
  return holder;
}


x86 assembly (clang, -O0):
<createISIHolder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x4(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x8(%rax)
movslq -0x14(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createISIHolder>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x18,%edi
call   1030 <malloc@plt>
movslq %ebp,%rcx
mov    %rcx,(%rax)
mov    %rbx,0x8(%rax)
movslq %r14d,%rcx
mov    %rcx,0x10(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8** @createISIHolder(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8** @malloc(i32 24)
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %4
%7 = getelementptr inbounds i8*, i8** %4, i64 1
store i8* %1, i8** %7
%8 = sext i32 %2 to i64
%9 = inttoptr i64 %8 to i8*
%10 = getelementptr inbounds i8*, i8** %4, i64 2
store i8* %9, i8** %10
ret i8** %4
}
int readint(void *value) {
  unsigned char *bytes = (unsigned char *)value;
  return bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24);
}


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

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

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

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

/* Variables and functions */
int setsid();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ warn(char *);
int /*<<< orphan*/ warnx(char *, ...);
int main(void) {
  pid_t sid;
  if ((sid = setsid()) == -1) {
    warn("setsid()");
  } else {
    warnx("Success sid = %d... sleeping for 3 seconds", sid);
    sleep(3);
  }
  warnx("Exiting");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <setsid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1173 <main+0x33>
lea    0xe97(%rip),%rdi
call   1030 <warn@plt>
jmp    118e <main+0x4e>
mov    -0x8(%rbp),%esi
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1040 <warnx@plt>
mov    $0x3,%edi
call   1060 <sleep@plt>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <warnx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <setsid@plt>
cmp    $0xffffffff,%eax
je     1169 <main+0x29>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <warnx@plt>
mov    $0x3,%edi
call   1060 <sleep@plt>
jmp    1175 <main+0x35>
lea    0xe90(%rip),%rdi
call   1030 <warn@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <warnx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"setsid()\00"
@.str.1 = [43 x i8] c"Success sid = %d... sleeping for 3 seconds\00"
@.str.2 = [8 x i8] c"Exiting\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @setsid()
store i32 %3, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @warn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @warnx(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @sleep(i32 3)
br label %11
11: ; preds = %7, %5
%12 = call i32 (i8*, ...) @warnx(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"setsid()\00"
@.str.1 = [43 x i8] c"Success sid = %d... sleeping for 3 seconds\00"
@.str.2 = [8 x i8] c"Exiting\00"
define i32 @main() {
%1 = tail call i32 (...) @setsid()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @warn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i32 (i8*, ...) @warnx(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = tail call i32 @sleep(i32 3)
br label %8
8: ; preds = %5, %3
%9 = tail call i32 (i8*, ...) @warnx(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int f(int a, int *b, int *d) {
  int c = ~(a);
  *b = c;
  if (c != 0)
    *d = c;
  return c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x1c(%rbp)
je     1134 <f+0x34>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
cmp    $0xffffffff,%edi
not    %eax
mov    %eax,(%rsi)
je     110d <f+0xd>
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = xor i32 %0, -1
store i32 %4, i32* %1
%5 = icmp eq i32 %0, -1
br i1 %5, label %7, label %6
6: ; preds = %3
store i32 %4, i32* %2
br label %7
7: ; preds = %6, %3
ret i32 %4
}
double norm_squared_d3(const double a[3]) {
  return a[0] * a[0] + a[1] * a[1] + a[2] * a[2];
}


x86 assembly (clang, -O0):
<norm_squared_d3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm_squared_d3>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @norm_squared_d3(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
ret double %23
}

LLVM IR (-O2):
define double @norm_squared_d3(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
ret double %9
}
/* Variables and functions */
int doit(int);
int /*<<< orphan*/ exit(int);
int main(void) {
  if (doit(0) != 0)
    exit(1);
  if (doit(1) != 1)
    exit(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <doit@plt>
cmp    $0x0,%eax
je     1149 <main+0x29>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    $0x1,%edi
call   1030 <doit@plt>
cmp    $0x1,%eax
je     1166 <main+0x46>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <doit@plt>
test   %eax,%eax
jne    1142 <main+0x22>
mov    $0x1,%edi
call   1030 <doit@plt>
cmp    $0x1,%eax
jne    1142 <main+0x22>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @doit(i32 0)
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = call i32 @doit(i32 1)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %6
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @doit(i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %0
%6 = tail call i32 @doit(i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %5
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void PrintWarning(char *message) {
  printf("Warning: %s\n", message);
  message[0] = '\0';
}


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

x86 assembly (clang, -O2):
<PrintWarning>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
movb   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Warning: %s\0A\00"
define void @PrintWarning(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
store i8 0, i8* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void *USBDMAChannelAddressGet(uint32_t ui32Base, uint32_t ui32Channel) {
  ASSERT(ui32Base == 0x40050000);
  ASSERT(ui32Channel < 8);
  return ((void *)(*(
      (volatile uint32_t *)(ui32Base + 0x00000208 + (0x10 * ui32Channel)))));
}


x86 assembly (clang, -O0):
<USBDMAChannelAddressGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x8,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x208,%eax
mov    -0x8(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDMAChannelAddressGet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x40050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x8,%ebx
setl   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
movslq %ebx,%rcx
shl    $0x4,%rcx
movslq 0x208(%rax,%rcx,1),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @USBDMAChannelAddressGet(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 = icmp eq i32 %5, 1074069504
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 8
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 520
%15 = load i32, i32* %4
%16 = mul nsw i32 16, %15
%17 = add nsw i32 %14, %16
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8*
ret i8* %22
}

LLVM IR (-O2):
define i8* @USBDMAChannelAddressGet(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074069504
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp slt i32 %1, 8
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = add nsw i32 %0, 520
%10 = shl nsw i32 %1, 4
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ doubles_angleaxis_to_quat(double const *, double *);
int /*<<< orphan*/ doubles_quat_to_mat44(double *, double *);
void doubles_angleaxis_to_mat44(const double aa[4], double r[4]) {
  double q[4];
  doubles_angleaxis_to_quat(aa, q);
  doubles_quat_to_mat44(q, r);
}


x86 assembly (clang, -O0):
<doubles_angleaxis_to_mat44>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <doubles_angleaxis_to_quat@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <doubles_quat_to_mat44@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_angleaxis_to_mat44>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
call   1040 <doubles_angleaxis_to_quat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <doubles_quat_to_mat44@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @doubles_angleaxis_to_mat44(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [4 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%8 = call i32 @doubles_angleaxis_to_quat(double* %6, double* %7)
%9 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @doubles_quat_to_mat44(double* %9, double* %10)
ret void
}

LLVM IR (-O2):
define void @doubles_angleaxis_to_mat44(double* %0, double* %1) {
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %3 to i8*
%5 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%6 = call i32 @doubles_angleaxis_to_quat(double* %0, double* %5)
%7 = call i32 @doubles_quat_to_mat44(double* %5, double* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myWrite(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ threadExit();
void *writer(void *param) {
  int i;
  printf("--> writer !\n");
  for (i = 0; i < 4; i++) {
    myWrite(0, 3 + i);
  }
  printf("end of write\n");
  threadExit();
  return NULL;
}


x86 assembly (clang, -O0):
<writer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1174 <writer+0x44>
mov    -0xc(%rbp),%esi
add    $0x3,%esi
xor    %edi,%edi
call   1050 <myWrite@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <writer+0x1f>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <threadExit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writer>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1050 <myWrite@plt>
xor    %edi,%edi
mov    $0x4,%esi
call   1050 <myWrite@plt>
xor    %edi,%edi
mov    $0x5,%esi
call   1050 <myWrite@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1050 <myWrite@plt>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <threadExit@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [13 x i8] c"--> writer !\00"
@str.2 = [13 x i8] c"end of write\00"
define noalias i8* @writer(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @myWrite(i32 0, i32 3)
%4 = tail call i32 @myWrite(i32 0, i32 4)
%5 = tail call i32 @myWrite(i32 0, i32 5)
%6 = tail call i32 @myWrite(i32 0, i32 6)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
%8 = tail call i32 (...) @threadExit()
ret i8* null
}
/* Variables and functions */
int sscanf(char *, char *, int *, float *);
double parse_lon(char *str) {
  int deg;
  float min;
  int ret;
  ret = sscanf(str, "%3i%f", &deg, &min);
  if (ret != 2)
    return 0;
  return deg + (min / 60.0);
}


x86 assembly (clang, -O0):
<parse_lon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xee1(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
je     114e <parse_lon+0x3e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1171 <parse_lon+0x61>
cvtsi2sdl -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe9c(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_lon>:
push   %rax
lea    0xef0(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
call   1030 <sscanf@plt>
xorpd  %xmm0,%xmm0
cmp    $0x2,%eax
jne    1149 <parse_lon+0x39>
cvtsi2sdl 0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xebb(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%3i%f\00"
define double @parse_lon(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %4, float* %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %1
store double 0.000000e+00, double* %2
br label %19
12: ; preds = %1
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to double
%15 = load float, float* %5
%16 = fpext float %15 to double
%17 = fdiv double %16, 6.000000e+01
%18 = fadd double %14, %17
store double %18, double* %2
br label %19
19: ; preds = %12, %11
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"%3i%f\00"
define double @parse_lon(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca float
%4 = bitcast i32* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = fdiv double %12, 6.000000e+01
%14 = fadd double %13, %10
br label %15
15: ; preds = %1, %8
%16 = phi double [ %14, %8 ], [ 0.000000e+00, %1 ]
ret double %16
}
/* Variables and functions */
scalar_t__ COND_GE();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sge_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_GE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sge_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_GE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sge_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_GE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sge_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_GE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sge_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_GE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int printf(char *, char const *);
int hello(const char *name) { return printf("Hello Mr.%s\n", name); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello Mr.%s\0A\00"
define i32 @hello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello Mr.%s\0A\00"
define i32 @hello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_ssl_server_credentials_create() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_ssl_server_credentials_create>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_ssl_server_credentials_create>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_ssl_server_credentials_create() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_ssl_server_credentials_create() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int const uint64_t;

/* Variables and functions */
int _wyhash(void const *, int const, int const, int const *);
int const _wymum(int const, int const);
uint64_t wyhash(const void *key, uint64_t len, uint64_t seed,
                const uint64_t secret[10]) {
  uint64_t h = _wyhash(key, len, seed, secret);
  return _wymum(h ^ len, h ^ secret[9]);
}


x86 assembly (clang, -O0):
<wyhash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <_wyhash@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
xor    -0xc(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rax
xor    0x24(%rax),%esi
call   1030 <_wymum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wyhash>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %esi,%ebp
call   1040 <_wyhash@plt>
xor    %eax,%ebp
xor    0x24(%rbx),%eax
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_wymum@plt>

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

LLVM IR (-O2):
define i32 @wyhash(i8* %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @_wyhash(i8* %0, i32 %1, i32 %2, i32* %3)
%6 = xor i32 %5, %1
%7 = getelementptr inbounds i32, i32* %3, i64 9
%8 = load i32, i32* %7
%9 = xor i32 %8, %5
%10 = tail call i32 @_wymum(i32 %6, i32 %9)
ret i32 %10
}
unsigned long elfinlsbu32(unsigned char *bp) {
  unsigned long v;
  (v = ((unsigned long)(bp)[3] << 24) | ((unsigned long)(bp)[2] << 16) |
       ((bp)[1] << 8) | (bp)[0]);
  return v;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void send_handler(const struct chmessage *message, const void *user_data) {
  const int *fd = (const int *)user_data;
  printf("send socket fd: %d\n", *fd);
}


x86 assembly (clang, -O0):
<send_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.chmessage = type { i32 }
@.str = [20 x i8] c"send socket fd: %d\0A\00"
define void @send_handler(%struct.chmessage* %0, i8* %1) {
%3 = alloca %struct.chmessage*
%4 = alloca i8*
%5 = alloca i32*
store %struct.chmessage* %0, %struct.chmessage** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
%struct.chmessage = type { i32 }
@.str = [20 x i8] c"send socket fd: %d\0A\00"
define void @send_handler(%struct.chmessage* nocapture readnone %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int print_help(int ret) {
  printf("Usage: sockprox [options] "
         "--server SERVER-SOCKET --listen PROXY-SOCKET\n");
  exit(ret);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [72 x i8] c"Usage: sockprox [options] --server SERVER-SOCKET --listen PROXY-SOCKET\0A\00"
define i32 @print_help(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [71 x i8] c"Usage: sockprox [options] --server SERVER-SOCKET --listen PROXY-SOCKET\00"
define i32 @print_help(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
int ascii_to_hex(char c) {
  c |= 0x20;
  if (c >= '0' && c <= '9') {
    return c - '0';
  } else if (c >= 'a' && c <= 'f') {
    return (c - 'a') + 10;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<ascii_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     113d <ascii_to_hex+0x3d>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     113d <ascii_to_hex+0x3d>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <ascii_to_hex+0x70>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1169 <ascii_to_hex+0x69>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1169 <ascii_to_hex+0x69>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <ascii_to_hex+0x70>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_to_hex>:
or     $0x20,%dil
movsbl %dil,%eax
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     1114 <ascii_to_hex+0x14>
add    $0xffffffd0,%eax
ret
lea    -0x61(%rax),%ecx
add    $0xffffffa9,%eax
cmp    $0x6,%cl
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ascii_to_hex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = or i32 %5, 32
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %11, label %19
11: ; preds = %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 57
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 48
store i32 %18, i32* %2
br label %33
19: ; preds = %11, %1
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %32
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 102
br i1 %26, label %27, label %32
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %23, %19
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %27, %15
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @ascii_to_hex(i8 signext %0) {
%2 = or i8 %0, 32
%3 = sext i8 %2 to i32
%4 = add i8 %2, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = add nsw i32 %3, -48
br label %13
8: ; preds = %1
%9 = add i8 %2, -97
%10 = icmp ult i8 %9, 6
%11 = add nsw i32 %3, -87
%12 = select i1 %10, i32 %11, i32 -1
br label %13
13: ; preds = %8, %6
%14 = phi i32 [ %7, %6 ], [ %12, %8 ]
ret i32 %14
}
RCU_DEF_DESTROY_FUNC(user_f2_destroy, param) {}


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

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

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

LLVM IR (-O2):
define i32 @RCU_DEF_DESTROY_FUNC(i32 %0, i32 %1) {
ret i32 undef
}
void use_fpu_value(double val) {}


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

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

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

LLVM IR (-O2):
define void @use_fpu_value(double %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blink4() {
  blinkdot();
  blinkdot();
  blinkdot();
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blink4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xeb8(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink4>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xebb(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blink4() {
%1 = call i32 (...) @blinkdot()
%2 = call i32 (...) @blinkdot()
%3 = call i32 (...) @blinkdot()
%4 = call i32 (...) @blinkdot()
%5 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blink4() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 (...) @blinkdot()
%4 = tail call i32 (...) @blinkdot()
%5 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
/* Variables and functions */
int open_mddev(char *, int /*<<< orphan*/);
int create_mddev(char *dev, char *name, int autof, int trustworthy,
                 char *chosen) {
  return open_mddev(dev, 0);
}


x86 assembly (clang, -O0):
<create_mddev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <open_mddev@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_mddev>:
xor    %esi,%esi
jmp    1030 <open_mddev@plt>

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

LLVM IR (-O2):
define i32 @create_mddev(i8* %0, i8* nocapture readnone %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @open_mddev(i8* %0, i32 0)
ret i32 %6
}
int gcd2(int x, int y) {
  if (y == 0)
    return x;
  else if (x >= y)
    return gcd2(x - y, y);
  else
    return gcd2(y, x);
}


x86 assembly (clang, -O0):
<gcd2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd2+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <gcd2+0x53>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1155 <gcd2+0x45>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcd2@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <gcd2+0x53>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd2>:
test   %esi,%esi
je     111f <gcd2+0x1f>
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
sub    %esi,%eax
cmovl  %esi,%eax
cmovl  %edi,%esi
mov    %eax,%edi
test   %esi,%esi
jne    1110 <gcd2+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd2(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i32 %6, %5
%8 = sub nsw i32 %6, %5
%9 = select i1 %7, i32 %5, i32 %8
%10 = select i1 %7, i32 %6, i32 %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_flush(int /*<<< orphan*/);
void g2_flush_(float *dev) { g2_flush(dtoi(*dev)); }


x86 assembly (clang, -O0):
<g2_flush_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <dtoi@plt>
mov    %eax,%edi
call   1030 <g2_flush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_flush_>:
push   %rax
movss  (%rdi),%xmm0
call   1040 <dtoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <g2_flush@plt>

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

LLVM IR (-O2):
define void @g2_flush_(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i32 @dtoi(float %2)
%4 = tail call i32 @g2_flush(i32 %3)
ret void
}