xunge/DecIR huggingface dataset:
int main(int argc, char **argv) {
  switch (argc) {
  case 0:
    return 0;
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    112e <main+0x2e>
jmp    1122 <main+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1135 <main+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void indent(int indentlevel) {
  int i;
  for (i = 0; i < indentlevel; i++)
    printf("\t");
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbx
test   %edi,%edi
jle    112f <indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <indent+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 9)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vector_add(int, double *, double const *, double *);
int /*<<< orphan*/ wgsned2ecef(double const *, double const *, double *);
void wgsned2ecef_d(const double ned[3], const double ref_ecef[3],
                   double ecef[3]) {
  double tempv[3];
  wgsned2ecef(ned, ref_ecef, tempv);
  vector_add(3, tempv, ref_ecef, ecef);
}


x86 assembly (clang, -O0):
<wgsned2ecef_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <wgsned2ecef@plt>
lea    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x3,%edi
call   1040 <vector_add@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wgsned2ecef_d>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsp,%r15
mov    %r15,%rdx
call   1030 <wgsned2ecef@plt>
mov    $0x3,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <vector_add@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @wgsned2ecef_d(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %4
%9 = load double*, double** %5
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%11 = call i32 @wgsned2ecef(double* %8, double* %9, double* %10)
%12 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%13 = load double*, double** %5
%14 = load double*, double** %6
%15 = call i32 @vector_add(i32 3, double* %12, double* %13, double* %14)
ret void
}

LLVM IR (-O2):
define void @wgsned2ecef_d(double* %0, double* %1, double* %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = call i32 @wgsned2ecef(double* %0, double* %1, double* %6)
%8 = call i32 @vector_add(i32 3, double* %6, double* %1, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CRC_CalculateCRC16Table();
int /*<<< orphan*/ CRC_CalculateCRC32Table();
int /*<<< orphan*/ CRC_CalculateCRC8Table();
void CRC_Init(void) {
  CRC_CalculateCRC8Table();
  CRC_CalculateCRC16Table();
  CRC_CalculateCRC32Table();
}


x86 assembly (clang, -O0):
<CRC_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <CRC_CalculateCRC8Table@plt>
mov    $0x0,%al
call   1030 <CRC_CalculateCRC16Table@plt>
mov    $0x0,%al
call   1050 <CRC_CalculateCRC32Table@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRC_Init>:
push   %rax
xor    %eax,%eax
call   1040 <CRC_CalculateCRC8Table@plt>
xor    %eax,%eax
call   1030 <CRC_CalculateCRC16Table@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <CRC_CalculateCRC32Table@plt>

LLVM IR (-O0):
define void @CRC_Init() {
%1 = call i32 (...) @CRC_CalculateCRC8Table()
%2 = call i32 (...) @CRC_CalculateCRC16Table()
%3 = call i32 (...) @CRC_CalculateCRC32Table()
ret void
}

LLVM IR (-O2):
define void @CRC_Init() {
%1 = tail call i32 (...) @CRC_CalculateCRC8Table()
%2 = tail call i32 (...) @CRC_CalculateCRC16Table()
%3 = tail call i32 (...) @CRC_CalculateCRC32Table()
ret void
}
/* Variables and functions */
double ceil(double);
double floor(double);
double fmod(double, int);
double trunc(double x) {
  return fmod(x, 1) == 0.0 ? x : (x < 0.0 ? ceil(x) : floor(x));
}


x86 assembly (clang, -O0):
<trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1040 <fmod@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    116e <trunc+0x3e>
jp     116e <trunc+0x3e>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11a9 <trunc+0x79>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1190 <trunc+0x60>
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    119f <trunc+0x6f>
movsd  -0x8(%rbp),%xmm0
call   1050 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunc>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1040 <fmod@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1153 <trunc+0x23>
jp     1153 <trunc+0x23>
movsd  (%rsp),%xmm0
pop    %rax
ret
movsd  (%rsp),%xmm0
ucomisd %xmm0,%xmm1
jbe    1164 <trunc+0x34>
pop    %rax
jmp    1030 <ceil@plt>
pop    %rax
jmp    1050 <floor@plt>

LLVM IR (-O0):
define double @trunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @fmod(double %3, i32 1)
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %2
br label %19
8: ; preds = %1
%9 = load double, double* %2
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load double, double* %2
%13 = call double @llvm.ceil.f64(double %12)
br label %17
14: ; preds = %8
%15 = load double, double* %2
%16 = call double @llvm.floor.f64(double %15)
br label %17
17: ; preds = %14, %11
%18 = phi double [ %13, %11 ], [ %16, %14 ]
br label %19
19: ; preds = %17, %6
%20 = phi double [ %7, %6 ], [ %18, %17 ]
ret double %20
}

LLVM IR (-O2):
define double @trunc(double %0) {
%2 = tail call double @fmod(double %0, i32 1)
%3 = fcmp oeq double %2, 0.000000e+00
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = fcmp olt double %0, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call double @llvm.ceil.f64(double %0)
br label %10
8: ; preds = %4
%9 = tail call double @llvm.floor.f64(double %0)
br label %10
10: ; preds = %1, %6, %8
%11 = phi double [ %7, %6 ], [ %9, %8 ], [ %0, %1 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ SHA1(char *, int, char *);
scalar_t__ SHA_DIGEST_LENGTH;
char *malloc(scalar_t__);
int /*<<< orphan*/ memset(char *, int, scalar_t__);
char *util_sha1(char *data, int length) {
  char *outBuf = malloc(SHA_DIGEST_LENGTH + 2);
  memset(outBuf, 0x00, SHA_DIGEST_LENGTH + 2);
  SHA1(data, length, outBuf);
  return outBuf;
}


x86 assembly (clang, -O0):
<util_sha1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%rdi
add    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e87(%rip),%rax
mov    (%rax),%rdx
add    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1050 <SHA1@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_sha1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
mov    0x2ea4(%rip),%rax
mov    (%rax),%rbp
add    $0x2,%rbp
mov    %rbp,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1050 <SHA1@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@SHA_DIGEST_LENGTH = global i64 0
define i8* @util_sha1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i64, i64* @SHA_DIGEST_LENGTH
%7 = add nsw i64 %6, 2
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i64, i64* @SHA_DIGEST_LENGTH
%11 = add nsw i64 %10, 2
%12 = call i32 @memset(i8* %9, i32 0, i64 %11)
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = call i32 @SHA1(i8* %13, i32 %14, i8* %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@SHA_DIGEST_LENGTH = global i64 0
define i8* @util_sha1(i8* %0, i32 %1) {
%3 = load i64, i64* @SHA_DIGEST_LENGTH
%4 = add nsw i64 %3, 2
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @memset(i8* %5, i32 0, i64 %4)
%7 = tail call i32 @SHA1(i8* %0, i32 %1, i8* %5)
ret i8* %5
}
void RTAvlU32Get(void) {}


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

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

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

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

/* Variables and functions */
void write8(uint8_t val, void *addr) { *(volatile uint8_t *)addr = val; }


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

x86 assembly (clang, -O2):
<write8>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @write8(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @write8(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned long *);
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
void *childGreetings(void *args) {
  unsigned long *buf = (unsigned long *)args;
  unsigned long childID = buf[0];
  unsigned long numThreads = buf[1];
  printf("Greetings from child #%lu of %lu\n", childID, numThreads);
  free(buf);
  return NULL;
}


x86 assembly (clang, -O0):
<childGreetings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<childGreetings>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rsi
mov    0x8(%rdi),%rdx
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Greetings from child #%lu of %lu\0A\00"
define i8* @childGreetings(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %3
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
store i64 %10, i64* %4
%11 = load i64*, i64** %3
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
store i64 %13, i64* %5
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %14, i64 %15)
%17 = load i64*, i64** %3
%18 = call i32 @free(i64* %17)
ret i8* null
}

LLVM IR (-O2):
@.str = [34 x i8] c"Greetings from child #%lu of %lu\0A\00"
define noalias i8* @childGreetings(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = getelementptr inbounds i8, i8* %0, i64 8
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %6)
%8 = tail call i32 @free(i64* %2)
ret i8* null
}
__deregister_frame_info() {}


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

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

LLVM IR (-O0):
define i32 @__deregister_frame_info() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @__deregister_frame_info() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int SIGCHLD;
int /*<<< orphan*/ _SC_PAGESIZE;
void *alloca(long);
int /*<<< orphan*/ clone(int (*)(void *), void *, int, void *);
long sysconf(int /*<<< orphan*/);
pid_t clonens(int (*fn)(void *), void *arg, int flags) {
  long stack_size = sysconf(_SC_PAGESIZE);
  void *stack = alloca(stack_size) + stack_size;
  return clone(fn, stack, flags | SIGCHLD, arg);
}


x86 assembly (clang, -O0):
<clonens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <alloca@plt>
add    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2e70(%rip),%rax
or     (%rax),%edx
mov    -0x10(%rbp),%rcx
call   1030 <clone@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clonens>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <alloca@plt>
add    %rax,%rbx
mov    0x2e86(%rip),%rax
or     (%rax),%ebp
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <clone@plt>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
@SIGCHLD = global i32 0
define i32 @clonens(i32 (i8*)* %0, i8* %1, i32 %2) {
%4 = alloca i32 (i8*)*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i32 (i8*)* %0, i32 (i8*)** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i32, i32* @_SC_PAGESIZE
%10 = call i64 @sysconf(i32 %9)
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = call i8* @alloca(i64 %11)
%13 = load i64, i64* %7
%14 = getelementptr i8, i8* %12, i64 %13
store i8* %14, i8** %8
%15 = load i32 (i8*)*, i32 (i8*)** %4
%16 = load i8*, i8** %8
%17 = load i32, i32* %6
%18 = load i32, i32* @SIGCHLD
%19 = or i32 %17, %18
%20 = load i8*, i8** %5
%21 = call i32 @clone(i32 (i8*)* %15, i8* %16, i32 %19, i8* %20)
ret i32 %21
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
@SIGCHLD = global i32 0
define i32 @clonens(i32 (i8*)* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @_SC_PAGESIZE
%5 = tail call i64 @sysconf(i32 %4)
%6 = tail call i8* @alloca(i64 %5)
%7 = getelementptr i8, i8* %6, i64 %5
%8 = load i32, i32* @SIGCHLD
%9 = or i32 %8, %2
%10 = tail call i32 @clone(i32 (i8*)* %0, i8* %7, i32 %9, i8* %1)
ret i32 %10
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t ifrac(int a) { return a & 0xfff; }


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

x86 assembly (clang, -O2):
<ifrac>:
mov    %edi,%eax
and    $0xfff,%eax
ret

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

LLVM IR (-O2):
define i32 @ifrac(i32 %0) {
%2 = and i32 %0, 4095
ret i32 %2
}
void inplace_swap(int *x, int *y) {
  *x = *x ^ *y;
  *y = *x ^ *y;
  *x = *x ^ *y;
}


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

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

LLVM IR (-O0):
define void @inplace_swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = xor i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = xor i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @inplace_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
void NoSoundDrv_MIDI_HaltPlayback(void) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_MIDI_HaltPlayback() {
ret void
}
void XResetScreenSaver() {}


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

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

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

LLVM IR (-O2):
define void @XResetScreenSaver() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ keyboard_cooked();
void keyAtExit(void) { keyboard_cooked(); }


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

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

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

LLVM IR (-O2):
define void @keyAtExit() {
%1 = tail call i32 (...) @keyboard_cooked()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void XY_gotocenter() { printf("Go to center\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Go to center\00"
define void @XY_gotocenter() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void close_on_exec(int fd) { fcntl(fd, F_SETFD, FD_CLOEXEC); }


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

x86 assembly (clang, -O2):
<close_on_exec>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define void @close_on_exec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFD
%5 = load i32, i32* @FD_CLOEXEC
%6 = call i32 @fcntl(i32 %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define void @close_on_exec(i32 %0) {
%2 = load i32, i32* @F_SETFD
%3 = load i32, i32* @FD_CLOEXEC
%4 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i = 0;
  for (;;) {
    i++;
    if (i == 100)
      break;
  }
  assert(i == 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jne    113e <main+0x2e>
jmp    1143 <main+0x33>
jmp    1126 <main+0x16>
cmpl   $0x64,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 100
br i1 %7, label %8, label %9
8: ; preds = %3
br label %10
9: ; preds = %3
br label %3
10: ; preds = %8
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 100
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
int ossl_ascii_isdigit(const char inchar) {
  if (inchar > 0x2F && inchar < 0x3A)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ossl_ascii_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jle    1130 <ossl_ascii_isdigit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x3a,%eax
jge    1130 <ossl_ascii_isdigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <ossl_ascii_isdigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ossl_ascii_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @ossl_ascii_isdigit(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 = icmp sgt i32 %5, 47
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 58
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @ossl_ascii_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int chdir(char const *);
int change_directory(const char *path) { return chdir(path); }


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

x86 assembly (clang, -O2):
<change_directory>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @change_directory(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
int forStatementFunction() {
  auto int n = 3;
  auto int m = 4;
  for (n; n < m; n + (1)) {
    { return n; }
  }
  return 0;
}


x86 assembly (clang, -O0):
<forStatementFunction>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1129 <forStatementFunction+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <forStatementFunction+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @forStatementFunction() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct m68k_emulate_ctxt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _op_sub(struct m68k_emulate_ctxt *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void op_cmp(struct m68k_emulate_ctxt *c, uint32_t s, uint32_t d) {
  (void)_op_sub(c, s, d);
}


x86 assembly (clang, -O0):
<op_cmp>:
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 <_op_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_cmp>:
jmp    1030 <_op_sub@plt>

LLVM IR (-O0):
%struct.m68k_emulate_ctxt = type { i32 }
define void @op_cmp(%struct.m68k_emulate_ctxt* %0, i32 %1, i32 %2) {
%4 = alloca %struct.m68k_emulate_ctxt*
%5 = alloca i32
%6 = alloca i32
store %struct.m68k_emulate_ctxt* %0, %struct.m68k_emulate_ctxt** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.m68k_emulate_ctxt*, %struct.m68k_emulate_ctxt** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @_op_sub(%struct.m68k_emulate_ctxt* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.m68k_emulate_ctxt = type { i32 }
define void @op_cmp(%struct.m68k_emulate_ctxt* %0, i32 %1, i32 %2) {
%4 = tail call i32 @_op_sub(%struct.m68k_emulate_ctxt* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ printSpace(int);
int /*<<< orphan*/ printStar(int);
void lineOne() {
  printStar(9);
  printSpace(6);
  printStar(3);
  printSpace(8);
  printStar(1);
  printSpace(10);
  printStar(1);
  newline();
}


x86 assembly (clang, -O0):
<lineOne>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
call   1040 <printStar@plt>
mov    $0x6,%edi
call   1050 <printSpace@plt>
mov    $0x3,%edi
call   1040 <printStar@plt>
mov    $0x8,%edi
call   1050 <printSpace@plt>
mov    $0x1,%edi
call   1040 <printStar@plt>
mov    $0xa,%edi
call   1050 <printSpace@plt>
mov    $0x1,%edi
call   1040 <printStar@plt>
mov    $0x0,%al
call   1030 <newline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineOne>:
push   %rax
mov    $0x9,%edi
call   1040 <printStar@plt>
mov    $0x6,%edi
call   1050 <printSpace@plt>
mov    $0x3,%edi
call   1040 <printStar@plt>
mov    $0x8,%edi
call   1050 <printSpace@plt>
mov    $0x1,%edi
call   1040 <printStar@plt>
mov    $0xa,%edi
call   1050 <printSpace@plt>
mov    $0x1,%edi
call   1040 <printStar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

LLVM IR (-O0):
define void @lineOne() {
%1 = call i32 @printStar(i32 9)
%2 = call i32 @printSpace(i32 6)
%3 = call i32 @printStar(i32 3)
%4 = call i32 @printSpace(i32 8)
%5 = call i32 @printStar(i32 1)
%6 = call i32 @printSpace(i32 10)
%7 = call i32 @printStar(i32 1)
%8 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
define void @lineOne() {
%1 = tail call i32 @printStar(i32 9)
%2 = tail call i32 @printSpace(i32 6)
%3 = tail call i32 @printStar(i32 3)
%4 = tail call i32 @printSpace(i32 8)
%5 = tail call i32 @printStar(i32 1)
%6 = tail call i32 @printSpace(i32 10)
%7 = tail call i32 @printStar(i32 1)
%8 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void disable_interrupt(void) {
  (void)signal(SIGALRM, SIG_IGN);
  (void)signal(SIGINT, SIG_IGN);
}


x86 assembly (clang, -O0):
<disable_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_interrupt>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
@SIGINT = global i32 0
define void @disable_interrupt() {
%1 = load i32, i32* @SIGALRM
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_IGN
%6 = call i32 @signal(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
@SIGINT = global i32 0
define void @disable_interrupt() {
%1 = load i32, i32* @SIGALRM
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("Usage: udevadm control COMMAND\n"
         "  --exit                   instruct the daemon to cleanup and exit\n"
         "  --log-priority=<level>   set the udev log level for the daemon\n"
         "  --stop-exec-queue        keep udevd from executing events, queue "
         "only\n"
         "  --start-exec-queue       execute events, flush queue\n"
         "  --reload-rules           reloads the rules files\n"
         "  --property=<KEY>=<value> set a global property for all events\n"
         "  --children-max=<N>       maximum number of children\n"
         "  --timeout=<seconds>      maximum time to block for a reply\n"
         "  --help                   print this help text\n\n");
}


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

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

LLVM IR (-O0):
@.str = [570 x i8] c"Usage: udevadm control COMMAND\0A --exit instruct the daemon to cleanup and exit\0A --log-priority=<level> set the udev log level for the daemon\0A --stop-exec-queue keep udevd from executing events, queue only\0A --start-exec-queue execute events, flush queue\0A --reload-rules reloads the rules files\0A --property=<KEY>=<value> set a global property for all events\0A --children-max=<N> maximum number of children\0A --timeout=<seconds> maximum time to block for a reply\0A --help print this help text\0A\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([570 x i8], [570 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [569 x i8] c"Usage: udevadm control COMMAND\0A --exit instruct the daemon to cleanup and exit\0A --log-priority=<level> set the udev log level for the daemon\0A --stop-exec-queue keep udevd from executing events, queue only\0A --start-exec-queue execute events, flush queue\0A --reload-rules reloads the rules files\0A --property=<KEY>=<value> set a global property for all events\0A --children-max=<N> maximum number of children\0A --timeout=<seconds> maximum time to block for a reply\0A --help print this help text\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([569 x i8], [569 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_ints(void *data) { printf("%d ", ((int)((intptr_t)(data)))); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_ints(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ lstat(char const *, struct stat *);
int vohttpd_is_folder(const char *path) {
  struct stat s;
  if (lstat(path, &s) < 0)
    return 0;
  return S_ISDIR(s.st_mode);
}


x86 assembly (clang, -O0):
<vohttpd_is_folder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
jge    114f <vohttpd_is_folder+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <vohttpd_is_folder+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vohttpd_is_folder>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
test   %rax,%rax
js     1137 <vohttpd_is_folder+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @vohttpd_is_folder(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ send_keyboard_report();
int /*<<< orphan*/ send_media_report();
int /*<<< orphan*/ send_mouse_report();
int /*<<< orphan*/ send_vendor_report();
void send_hid_reports(void) {
  send_keyboard_report();
  send_mouse_report();
  send_media_report();
  send_vendor_report();
}


x86 assembly (clang, -O0):
<send_hid_reports>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <send_keyboard_report@plt>
mov    $0x0,%al
call   1040 <send_mouse_report@plt>
mov    $0x0,%al
call   1050 <send_media_report@plt>
mov    $0x0,%al
call   1060 <send_vendor_report@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_hid_reports>:
push   %rax
xor    %eax,%eax
call   1030 <send_keyboard_report@plt>
xor    %eax,%eax
call   1040 <send_mouse_report@plt>
xor    %eax,%eax
call   1050 <send_media_report@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <send_vendor_report@plt>

LLVM IR (-O0):
define void @send_hid_reports() {
%1 = call i32 (...) @send_keyboard_report()
%2 = call i32 (...) @send_mouse_report()
%3 = call i32 (...) @send_media_report()
%4 = call i32 (...) @send_vendor_report()
ret void
}

LLVM IR (-O2):
define void @send_hid_reports() {
%1 = tail call i32 (...) @send_keyboard_report()
%2 = tail call i32 (...) @send_mouse_report()
%3 = tail call i32 (...) @send_media_report()
%4 = tail call i32 (...) @send_vendor_report()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ executeApplescript(char *, char *);
void quitiTunes() { executeApplescript("iTunes", "quit"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [5 x i8] c"quit\00"
define void @quitiTunes() {
%1 = call i32 @executeApplescript(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [5 x i8] c"quit\00"
define void @quitiTunes() {
%1 = tail call i32 @executeApplescript(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int u_int;

/* Variables and functions */
u_int int_hash(void *i) {
  u_int val = (u_int)(long)i;
  return (val ^ (val >> 16));
}


x86 assembly (clang, -O0):
<int_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_hash>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @int_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = ashr i32 %8, 16
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @int_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = ashr i32 %3, 16
%5 = xor i32 %4, %3
ret i32 %5
}
int OpenDevice(int ComPort) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @OpenDevice(i32 %0) {
ret i32 1
}
/* Variables and functions */
double era_sinh(double);
int /*<<< orphan*/ printf(char *, double, double);
double readDoubleFromSTDIN(char *);
double sinh(double);
void testUserInputValue() {
  double read = readDoubleFromSTDIN("Pleas input a double to test: ");
  printf("era_sinh=%.17g, sinh=%.17g\n", era_sinh(read), sinh(read));
}


x86 assembly (clang, -O0):
<testUserInputValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <readDoubleFromSTDIN@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <era_sinh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testUserInputValue>:
sub    $0x18,%rsp
lea    0xeb5(%rip),%rdi
call   1050 <readDoubleFromSTDIN@plt>
movsd  %xmm0,0x8(%rsp)
call   1060 <era_sinh@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sinh@plt>
movaps %xmm0,%xmm1
lea    0xea9(%rip),%rdi
movsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Pleas input a double to test: \00"
@.str.1 = [28 x i8] c"era_sinh=%.17g, sinh=%.17g\0A\00"
define void @testUserInputValue() {
%1 = alloca double
%2 = call double @readDoubleFromSTDIN(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store double %2, double* %1
%3 = load double, double* %1
%4 = call double @era_sinh(double %3)
%5 = load double, double* %1
%6 = call double @sinh(double %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), double %4, double %6)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Pleas input a double to test: \00"
@.str.1 = [28 x i8] c"era_sinh=%.17g, sinh=%.17g\0A\00"
define void @testUserInputValue() {
%1 = tail call double @readDoubleFromSTDIN(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call double @era_sinh(double %1)
%3 = tail call double @sinh(double %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), double %2, double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DS_Check();
int /*<<< orphan*/ DS_Rst();
int /*<<< orphan*/ DS_Write_Byte(int);
void DS_Start(void) {
  DS_Rst();
  DS_Check();
  DS_Write_Byte(0xcc);
  DS_Write_Byte(0x44);
}


x86 assembly (clang, -O0):
<DS_Start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DS_Rst@plt>
mov    $0x0,%al
call   1040 <DS_Check@plt>
mov    $0xcc,%edi
call   1050 <DS_Write_Byte@plt>
mov    $0x44,%edi
call   1050 <DS_Write_Byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DS_Start>:
push   %rax
xor    %eax,%eax
call   1030 <DS_Rst@plt>
xor    %eax,%eax
call   1040 <DS_Check@plt>
mov    $0xcc,%edi
call   1050 <DS_Write_Byte@plt>
mov    $0x44,%edi
pop    %rax
jmp    1050 <DS_Write_Byte@plt>

LLVM IR (-O0):
define void @DS_Start() {
%1 = call i32 (...) @DS_Rst()
%2 = call i32 (...) @DS_Check()
%3 = call i32 @DS_Write_Byte(i32 204)
%4 = call i32 @DS_Write_Byte(i32 68)
ret void
}

LLVM IR (-O2):
define void @DS_Start() {
%1 = tail call i32 (...) @DS_Rst()
%2 = tail call i32 (...) @DS_Check()
%3 = tail call i32 @DS_Write_Byte(i32 204)
%4 = tail call i32 @DS_Write_Byte(i32 68)
ret void
}
void xfs_buf_dquot_io_fail(struct xfs_buf *bp) {}


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

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

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

LLVM IR (-O2):
%struct.xfs_buf = type opaque
define void @xfs_buf_dquot_io_fail(%struct.xfs_buf* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Print(int argc, char **argv) {
  printf("Calling from Print\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Calling from Print\0A\00"
define i32 @Print(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [19 x i8] c"Calling from Print\00"
define i32 @Print(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int test_imm_A6uint16_reg(unsigned short val) {
  return ((val) & (-0xA6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A6uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff5a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A6uint16_reg>:
test   $0xff5a,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A6uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -166
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int gpio_dir(int, int);
int gpio_setscl_dir(int dir) { return gpio_dir(27, dir); }


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

x86 assembly (clang, -O2):
<gpio_setscl_dir>:
mov    %edi,%esi
mov    $0x1b,%edi
jmp    1030 <gpio_dir@plt>

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

LLVM IR (-O2):
define i32 @gpio_setscl_dir(i32 %0) {
%2 = tail call i32 @gpio_dir(i32 27, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_cellids_fromfile(int /*<<< orphan*/);
void fgmvwrite_cellids_fromfile_(char filnam[]) {
  gmvwrite_cellids_fromfile(fortchartoc(filnam));
}


x86 assembly (clang, -O0):
<fgmvwrite_cellids_fromfile_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fortchartoc@plt>
mov    %eax,%edi
call   1040 <gmvwrite_cellids_fromfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_cellids_fromfile_>:
push   %rax
call   1030 <fortchartoc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <gmvwrite_cellids_fromfile@plt>

LLVM IR (-O0):
define void @fgmvwrite_cellids_fromfile_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fortchartoc(i8* %3)
%5 = call i32 @gmvwrite_cellids_fromfile(i32 %4)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_cellids_fromfile_(i8* %0) {
%2 = tail call i32 @fortchartoc(i8* %0)
%3 = tail call i32 @gmvwrite_cellids_fromfile(i32 %2)
ret void
}