xunge/DecIR huggingface dataset:
/* Type definitions */
struct db_query {
  int dummy;
};
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
int sqlite3_finalize(int /*<<< orphan*/ *);
int db_finalize(struct db_query *query) {
  if (query == NULL)
    return -1;
  return sqlite3_finalize((sqlite3_stmt *)query);
}


x86 assembly (clang, -O0):
<db_finalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <db_finalize+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <db_finalize+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <sqlite3_finalize@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_finalize>:
test   %rdi,%rdi
je     111a <db_finalize+0xa>
jmp    1030 <sqlite3_finalize@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.db_query = type { i32 }
define i32 @db_finalize(%struct.db_query* %0) {
%2 = alloca i32
%3 = alloca %struct.db_query*
store %struct.db_query* %0, %struct.db_query** %3
%4 = load %struct.db_query*, %struct.db_query** %3
%5 = icmp eq %struct.db_query* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %11
7: ; preds = %1
%8 = load %struct.db_query*, %struct.db_query** %3
%9 = bitcast %struct.db_query* %8 to i32*
%10 = call i32 @sqlite3_finalize(i32* %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.db_query = type { i32 }
define i32 @db_finalize(%struct.db_query* %0) {
%2 = icmp eq %struct.db_query* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = getelementptr %struct.db_query, %struct.db_query* %0, i64 0, i32 0
%5 = tail call i32 @sqlite3_finalize(i32* %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int set_value_of_continuation_parameter(int k, double *val) {
  int *b, fail;
  fail = _ada_use_c2phc(190, &k, b, val);
  return fail;
}


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

x86 assembly (clang, -O2):
<set_value_of_continuation_parameter>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xbe,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @set_value_of_continuation_parameter(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%7 = load i32*, i32** %5
%8 = load double*, double** %4
%9 = call i32 @_ada_use_c2phc(i32 190, i32* %3, i32* %7, double* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_value_of_continuation_parameter(i32 %0, double* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 190, i32* %3, i32* undef, double* %1)
ret i32 %4
}
void on_error(void *context, const char *error, int line_num, int char_pos) {
  printf("error %s at %s %d:%d\n", error, context, line_num, char_pos);
  exit(-1);
}


x86 assembly (clang, -O0):
<on_error>:
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    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<on_error>:
push   %rax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rdi,%rdx
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"error %s at %s %d:%d\0A\00"
define void @on_error(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11, i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"error %s at %s %d:%d\0A\00"
define void @on_error(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i32 %2, i32 %3)
tail call void @exit(i32 -1)
unreachable
}
void modif_rear_unit2MODIF_R() {}


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

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

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

LLVM IR (-O2):
define void @modif_rear_unit2MODIF_R() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char buff[1];
  int res = read(stdin, buff, 1);
  printf("%d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @read(i32 %5, i8* %4, i32 1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
char *mcparminfo_string(char *parmname) { return "string"; }


x86 assembly (clang, -O0):
<mcparminfo_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"string\00"
define i8* @mcparminfo_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"string\00"
define i8* @mcparminfo_string(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
char *StrUpr(char *string) {
  char *p;
  const int det = 'a' - 'A';
  p = string;
  while (*p) {
    if (*p >= 'a' && *p <= 'z') {
      *p -= det;
    }
    p++;
  }
  return string;
}


x86 assembly (clang, -O0):
<StrUpr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x20,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <StrUpr+0x61>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1150 <StrUpr+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1150 <StrUpr+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <StrUpr+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrUpr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <StrUpr+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <StrUpr+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <StrUpr+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <StrUpr+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <StrUpr+0x10>
ret

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

LLVM IR (-O2):
define i8* @StrUpr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/"
             "LibFontConfig/src/fc-pattern/.libs/lt-fc-pattern.c",
             311, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x137,%esi
lea    0xf55(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf70(%rip),%rdx
mov    $0x137,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [172 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibFontConfig/src/fc-pattern/.libs/lt-fc-pattern.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [172 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibFontConfig/src/fc-pattern/.libs/lt-fc-pattern.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Type definitions */
typedef scalar_t__ uint_fast64_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_uint_fast64_t(uint_fast64_t const k1,
                                            uint_fast64_t const k2) {
  return k1 == k2;
}


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

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_uint_fast64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_uint_fast64_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_uint_fast64_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int busyhandler(void *pArg, int n) {
  usleep(10 * 1000);
  return 1;
}


x86 assembly (clang, -O0):
<busyhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x2710,%edi
call   1030 <usleep@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @busyhandler(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @usleep(i32 10000)
ret i32 1
}

LLVM IR (-O2):
define i32 @busyhandler(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @usleep(i32 10000)
ret i32 1
}
/* Variables and functions */
double log(double);
double logb2(double x) { return log(x) / log(2.0); }


x86 assembly (clang, -O0):
<logb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logb2>:
push   %rax
call   1030 <log@plt>
divsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logb2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = call double @log(double 2.000000e+00)
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @logb2(double %0) {
%2 = tail call double @log(double %0)
%3 = fdiv double %2, 0x3FE62E42FEFA39EF
ret double %3
}
/* Type definitions */
struct linux_dirent64 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_getdents64;
scalar_t__ syscall(int /*<<< orphan*/, int, struct linux_dirent64 *, int);
int getdents64(int fd, struct linux_dirent64 *dirp, int count) {
  return (int)syscall(SYS_getdents64, fd, dirp, count);
}


x86 assembly (clang, -O0):
<getdents64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdents64>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.linux_dirent64 = type { i32 }
@SYS_getdents64 = global i32 0
define i32 @getdents64(i32 %0, %struct.linux_dirent64* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.linux_dirent64*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.linux_dirent64* %1, %struct.linux_dirent64** %5
store i32 %2, i32* %6
%7 = load i32, i32* @SYS_getdents64
%8 = load i32, i32* %4
%9 = load %struct.linux_dirent64*, %struct.linux_dirent64** %5
%10 = load i32, i32* %6
%11 = call i64 @syscall(i32 %7, i32 %8, %struct.linux_dirent64* %9, i32 %10)
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.linux_dirent64 = type { i32 }
@SYS_getdents64 = global i32 0
define i32 @getdents64(i32 %0, %struct.linux_dirent64* %1, i32 %2) {
%4 = load i32, i32* @SYS_getdents64
%5 = tail call i64 @syscall(i32 %4, i32 %0, %struct.linux_dirent64* %1, i32 %2)
%6 = trunc i64 %5 to i32
ret i32 %6
}
struct pep_sock *pep_sk(struct sock *sk) {
  return (struct pep_sock *)sk;
}


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

x86 assembly (clang, -O2):
<pep_sk>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.pep_sock = type opaque
%struct.sock = type opaque
define %struct.pep_sock* @pep_sk(%struct.sock* %0) {
%2 = alloca %struct.sock*
store %struct.sock* %0, %struct.sock** %2
%3 = load %struct.sock*, %struct.sock** %2
%4 = bitcast %struct.sock* %3 to %struct.pep_sock*
ret %struct.pep_sock* %4
}

LLVM IR (-O2):
%struct.pep_sock = type opaque
%struct.sock = type opaque
define %struct.pep_sock* @pep_sk(%struct.sock* readnone %0) {
%2 = bitcast %struct.sock* %0 to %struct.pep_sock*
ret %struct.pep_sock* %2
}
void report_times(int itime, char *ident, int all_processors, void *comm) {
  double max, *sum;
  int i;
  int numprocs, myid;
  numprocs = 1;
  myid = 0;
}


x86 assembly (clang, -O0):
<report_times>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x1,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @report_times(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca double
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
store i32 1, i32* %12
store i32 0, i32* %13
ret void
}

LLVM IR (-O2):
define void @report_times(i32 %0, i8* nocapture %1, i32 %2, i8* nocapture %3) {
ret void
}
int vol126to255(int vol, int amplify) {
  int finalVol = (((vol <= 126 ? (vol * 133300) >> 16 : 255)) * amplify) / 100;
  return finalVol <= 255 ? finalVol : 255;
}


x86 assembly (clang, -O0):
<vol126to255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x7e,-0x4(%rbp)
jg     1126 <vol126to255+0x26>
imul   $0x208b4,-0x4(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <vol126to255+0x33>
mov    $0xff,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <vol126to255+0x33>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jg     115d <vol126to255+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    116a <vol126to255+0x6a>
mov    $0xff,%eax
mov    %eax,-0x14(%rbp)
jmp    116a <vol126to255+0x6a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vol126to255>:
imul   $0x208b4,%edi,%ecx
sar    $0x10,%ecx
cmp    $0x7f,%edi
mov    $0xff,%eax
cmovge %eax,%ecx
imul   %esi,%ecx
cmp    $0x63ff,%ecx
jg     1136 <vol126to255+0x36>
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @vol126to255(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 126
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 133300
%11 = ashr i32 %10, 16
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %8
%14 = phi i32 [ %11, %8 ], [ 255, %12 ]
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = sdiv i32 %16, 100
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = icmp sle i32 %18, 255
br i1 %19, label %20, label %22
20: ; preds = %13
%21 = load i32, i32* %5
br label %23
22: ; preds = %13
br label %23
23: ; preds = %22, %20
%24 = phi i32 [ %21, %20 ], [ 255, %22 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @vol126to255(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 127
%4 = mul nsw i32 %0, 133300
%5 = ashr i32 %4, 16
%6 = select i1 %3, i32 %5, i32 255
%7 = mul nsw i32 %6, %1
%8 = sdiv i32 %7, 100
%9 = icmp slt i32 %7, 25600
%10 = select i1 %9, i32 %8, i32 255
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sink(char *);
int vla_limit();
void test_vla(void) {
  char vla1[vla_limit()];
  sink(vla1);
  char vla2[vla_limit() + 1];
  sink(vla2);
}


x86 assembly (clang, -O0):
<test_vla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %al,-0x19(%rbp)
call   1040 <vla_limit@plt>
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x10(%rbp)
call   1030 <sink@plt>
mov    -0x19(%rbp),%al
call   1040 <vla_limit@plt>
add    $0x1,%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <sink@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vla>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
call   1040 <vla_limit@plt>
mov    %eax,%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
call   1030 <sink@plt>
xor    %eax,%eax
call   1040 <vla_limit@plt>
add    $0x1,%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
call   1030 <sink@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @test_vla() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i64
%4 = call i32 (...) @vla_limit()
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %1
%7 = alloca i8, i64 %5
store i64 %5, i64* %2
%8 = call i32 @sink(i8* %7)
%9 = call i32 (...) @vla_limit()
%10 = add nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = alloca i8, i64 %11
store i64 %11, i64* %3
%13 = call i32 @sink(i8* %12)
%14 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
define void @test_vla() {
%1 = tail call i32 (...) @vla_limit()
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @sink(i8* %3)
%5 = call i32 (...) @vla_limit()
%6 = add nsw i32 %5, 1
%7 = zext i32 %6 to i64
%8 = alloca i8, i64 %7
%9 = call i32 @sink(i8* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PSRLQ(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xd3);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


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

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

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

LLVM IR (-O2):
define void @MMX_PSRLQ(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 211)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int read(int /*<<< orphan*/, char *, int);
int main() {
  char buf[1000];
  int len = read(0, buf, 1000);
  buf[len] = '\0';
  printf("read len=%d\ndata=%s", len, buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
xor    %edi,%edi
mov    $0x3e8,%edx
call   1040 <read@plt>
mov    %eax,-0x3f4(%rbp)
movslq -0x3f4(%rbp),%rax
movb   $0x0,-0x3f0(%rbp,%rax,1)
mov    -0x3f4(%rbp),%esi
lea    -0x3f0(%rbp),%rdx
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x3e8,%edx
call   1040 <read@plt>
movslq %eax,%rsi
movb   $0x0,(%rsp,%rsi,1)
lea    0xeb8(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"read len=%d\0Adata=%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 1000)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %7
store i8 0, i8* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"read len=%d\0Adata=%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 1000)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %4
store i8 0, i8* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %2)
ret i32 0
}
int cli_has_space(char *p) {
  while (*p && *p != ' ')
    p++;
  return ((*p) ? (1) : (0));
}


x86 assembly (clang, -O0):
<cli_has_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <cli_has_space+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <cli_has_space+0x3d>
jmp    114e <cli_has_space+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <cli_has_space+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_has_space>:
movzbl (%rdi),%ecx
test   $0xdf,%cl
je     110e <cli_has_space+0xe>
add    $0x1,%rdi
jmp    1100 <cli_has_space>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @cli_has_space(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = icmp ne i8 %4, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
void unit2capturing() {}


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

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

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

LLVM IR (-O2):
define void @unit2capturing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getegid();
int geteuid();
int getgid();
int getuid();
int /*<<< orphan*/ stderr;
void show_priv(const char *x) {
  if (0) {
    fprintf(stderr, "%s:\n", x);
    fprintf(stderr, "  U: e:%5d  <r:%5d>\n", geteuid(), getuid());
    fprintf(stderr, "  G: e:%5d  <r:%5d>\n", getegid(), getgid());
  }
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
define void @show_priv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @show_priv(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int strlen(char *);
char *ngets(char *str, int max_chars) {
  char *fret = fgets(str, max_chars, stdin);
  int i = strlen(str) - 1;
  if (str[i] == '\n')
    str[i] = '\0';
  return fret;
}


x86 assembly (clang, -O0):
<ngets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1178 <ngets+0x58>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ngets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    114e <ngets+0x2e>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define i8* @ngets(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i8* @fgets(i8* %0, i32 %1, i32 %3)
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %12
11: ; preds = %2
store i8 0, i8* %8
br label %12
12: ; preds = %11, %2
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double longBitsToDouble(int64_t i) {
  union {
    double f;
    int64_t i;
  } tmp;
  tmp.i = i;
  return tmp.f;
}


x86 assembly (clang, -O0):
<longBitsToDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<longBitsToDouble>:
mov    %edi,%eax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @longBitsToDouble(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to double*
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @longBitsToDouble(i32 %0) {
%2 = zext i32 %0 to i64
%3 = bitcast i64 %2 to double
ret double %3
}
/* Variables and functions */
int fib(int);
int fib_wrapper(int n) {
  int x = 0;
#pragma omp target if (n > THRESHOLD)
  x = fib(n);
  return x;
}


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

x86 assembly (clang, -O2):
<fib_wrapper>:
jmp    1030 <fib@plt>

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

LLVM IR (-O2):
define i32 @fib_wrapper(i32 %0) {
%2 = tail call i32 @fib(i32 %0)
ret i32 %2
}
long int __isfinitef(float x) {
  union {
    unsigned long int lval;
    float fval;
  } z;
  z.fval = x;
  return ((z.lval & 0x7f800000) != 0x7f800000);
}


x86 assembly (clang, -O0):
<__isfinitef>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7f800000,%rax
cmp    $0x7f800000,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isfinitef>:
movd   %xmm0,%ecx
not    %ecx
xor    %eax,%eax
test   $0x7f800000,%ecx
setne  %al
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define i64 @__isfinitef(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i64*
%7 = load i64, i64* %6
%8 = and i64 %7, 2139095040
%9 = icmp ne i64 %8, 2139095040
%10 = zext i1 %9 to i32
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @__isfinitef(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2139095040
%4 = icmp ne i32 %3, 2139095040
%5 = zext i1 %4 to i64
ret i64 %5
}
int test_imm_07int8_mem(signed char *val) {
  return ((*val) & (0x07 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_07int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 7
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void *times2(void *n) { return (void *)(2 * (int)n); }


x86 assembly (clang, -O0):
<times2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<times2>:
add    %edi,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i8* @times2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = mul nsw i32 2, %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @times2(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = shl nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
int tegra_dvfs_init_rails(struct dvfs_rail *dvfs_rails[], int n) { return 0; }


x86 assembly (clang, -O0):
<tegra_dvfs_init_rails>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.dvfs_rail = type opaque
define i32 @tegra_dvfs_init_rails(%struct.dvfs_rail** nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\x1b[0;31m"
         "hello"
         "\x1b[0m"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"\1B[0;31mhello\1B[0m\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"\1B[0;31mhello\1B[0m\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DecodesAA_xxxxdddxssxxxrrr();
int /*<<< orphan*/ DoCompare(int /*<<< orphan*/);
void DoCodeCmpM(void) { DoCompare(DecodesAA_xxxxdddxssxxxrrr()); }


x86 assembly (clang, -O0):
<DoCodeCmpM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DecodesAA_xxxxdddxssxxxrrr@plt>
mov    %eax,%edi
call   1040 <DoCompare@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeCmpM>:
push   %rax
xor    %eax,%eax
call   1030 <DecodesAA_xxxxdddxssxxxrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <DoCompare@plt>

LLVM IR (-O0):
define void @DoCodeCmpM() {
%1 = call i32 (...) @DecodesAA_xxxxdddxssxxxrrr()
%2 = call i32 @DoCompare(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeCmpM() {
%1 = tail call i32 (...) @DecodesAA_xxxxdddxssxxxrrr()
%2 = tail call i32 @DoCompare(i32 %1)
ret void
}
void cafebabe_constant_info_long_deinit(struct cafebabe_constant_info_long *l) {
}


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

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

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

LLVM IR (-O2):
%struct.cafebabe_constant_info_long = type opaque
define void @cafebabe_constant_info_long_deinit(%struct.cafebabe_constant_info_long* nocapture %0) {
ret void
}
float max3way(float a, float b, float c) {
  if ((a >= b) && (a >= c)) {
    return a;
  }
  if ((b >= a) && (b >= c)) {
    return b;
  }
  if ((c >= b) && (c >= a)) {
    return c;
  }
}


x86 assembly (clang, -O0):
<max3way>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1140 <max3way+0x40>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     1140 <max3way+0x40>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1195 <max3way+0x95>
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     116d <max3way+0x6d>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     116d <max3way+0x6d>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1195 <max3way+0x95>
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1195 <max3way+0x95>
movss  -0x10(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1195 <max3way+0x95>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3way>:
movaps %xmm2,%xmm3
cmpnless %xmm1,%xmm3
movaps %xmm3,%xmm4
andps  %xmm2,%xmm4
andnps %xmm1,%xmm3
orps   %xmm4,%xmm3
movaps %xmm0,%xmm4
cmpnless %xmm1,%xmm4
movaps %xmm4,%xmm5
andnps %xmm3,%xmm5
andps  %xmm2,%xmm4
orps   %xmm5,%xmm4
cmpnless %xmm0,%xmm1
movaps %xmm1,%xmm3
andps  %xmm4,%xmm3
cmpnless %xmm0,%xmm2
andps  %xmm2,%xmm4
andnps %xmm0,%xmm2
orps   %xmm4,%xmm2
andnps %xmm2,%xmm1
orps   %xmm1,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @max3way(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp oge float %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load float, float* %5
%13 = load float, float* %7
%14 = fcmp oge float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load float, float* %5
store float %16, float* %4
br label %37
17: ; preds = %11, %3
%18 = load float, float* %6
%19 = load float, float* %5
%20 = fcmp oge float %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load float, float* %6
%23 = load float, float* %7
%24 = fcmp oge float %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load float, float* %6
store float %26, float* %4
br label %37
27: ; preds = %21, %17
%28 = load float, float* %7
%29 = load float, float* %6
%30 = fcmp oge float %28, %29
br i1 %30, label %31, label %37
31: ; preds = %27
%32 = load float, float* %7
%33 = load float, float* %5
%34 = fcmp oge float %32, %33
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = load float, float* %7
store float %36, float* %4
br label %37
37: ; preds = %15, %25, %35, %31, %27
%38 = load float, float* %4
ret float %38
}

LLVM IR (-O2):
define float @max3way(float %0, float %1, float %2) {
%4 = fcmp ult float %0, %1
%5 = fcmp ult float %0, %2
%6 = or i1 %4, %5
%7 = fcmp ult float %1, %0
%8 = fcmp ult float %1, %2
%9 = or i1 %7, %8
%10 = select i1 %9, float %2, float %1
%11 = select i1 %6, float %10, float %0
ret float %11
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISCHR(int /*<<< orphan*/);
scalar_t__ fstat(int, struct stat *);
int isatty(int fd) {
  struct stat buf;
  if (fstat(fd, &buf) < 0)
    return 0;
  if (S_ISCHR(buf.st_mode))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
jge    114d <isatty+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1172 <isatty+0x52>
mov    -0x10(%rbp),%edi
call   1030 <S_ISCHR@plt>
cmp    $0x0,%rax
je     116b <isatty+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <isatty+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISCHR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
int gcd(unsigned int u, unsigned int v) {
  while (v != 0) {
    unsigned int t = v;
    v = u % v;
    u = t;
  }
  return u;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <gcd+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111e <gcd+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = urem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ efree(void *);
void phql_wrapper_free(void *pointer) { efree(pointer); }


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

x86 assembly (clang, -O2):
<phql_wrapper_free>:
jmp    1030 <efree@plt>

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

LLVM IR (-O2):
define void @phql_wrapper_free(i8* %0) {
%2 = tail call i32 @efree(i8* %0)
ret void
}