xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int pidlist_find(int /*<<< orphan*/);
int bb_is_running(pid_t proc) { return pidlist_find(proc); }


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

x86 assembly (clang, -O2):
<bb_is_running>:
jmp    1030 <pidlist_find@plt>

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

LLVM IR (-O2):
define i32 @bb_is_running(i32 %0) {
%2 = tail call i32 @pidlist_find(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t null_size(uint8_t id) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @null_size(i32 %0) {
ret i32 0
}
int cmp_short(void *a, void *b) { return *(short *)a > *(short *)b; }


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

x86 assembly (clang, -O2):
<cmp_short>:
movzwl (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%cx
setg   %al
ret

LLVM IR (-O0):
define i32 @cmp_short(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i16*
%7 = load i16, i16* %6
%8 = sext i16 %7 to i32
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i16*
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = icmp sgt i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @cmp_short(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp sgt i16 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int zero(double a) { return a < (0 + 1e-10) && a > (0 - 1e-10); }


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xor    %eax,%eax
movsd  0xeed(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x9(%rbp)
jbe    1138 <zero+0x38>
movsd  -0x8(%rbp),%xmm0
movsd  0xeda(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
ucomisd 0xef1(%rip),%xmm0
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @zero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 1.000000e-10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp ogt double %6, -1.000000e-10
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @zero(double %0) {
%2 = fcmp olt double %0, 1.000000e-10
%3 = fcmp ogt double %0, -1.000000e-10
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int subtotal(void) {
  double i = 7.0;
  return i + i;
}


x86 assembly (clang, -O0):
<subtotal>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @subtotal() {
%1 = alloca double
store double 7.000000e+00, double* %1
%2 = load double, double* %1
%3 = load double, double* %1
%4 = fadd double %2, %3
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @subtotal() {
ret i32 14
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int tcgetattr(int /*<<< orphan*/, struct termios *);
int main(void) {
  struct termios t;
  return tcgetattr(0, &t);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <tcgetattr@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.termios
store i32 0, i32* %1
%3 = call i32 @tcgetattr(i32 0, %struct.termios* %2)
ret i32 %3
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @main() {
%1 = alloca %struct.termios
%2 = bitcast %struct.termios* %1 to i8*
%3 = call i32 @tcgetattr(i32 0, %struct.termios* %1)
ret i32 %3
}
/* Variables and functions */
double polygon_area(int **, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int a[5][2] = {{-5, 1}, {-1, 5}, {1, 1}, {-2, -3}, {-1, 1}};
  printf("polygon area a is %f\n", polygon_area(a, 5));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <polygon_area@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x [2 x i32]] [[2 x i32] [i32 -5, i32 1], [2 x i32] [i32 -1, i32 5], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 -2, i32 -3], [2 x i32] [i32 -1, i32 1]]
@.str = [22 x i8] c"polygon area a is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [2 x i32]]
store i32 0, i32* %1
%3 = bitcast [5 x [2 x i32]]* %2 to i8*
%4 = getelementptr inbounds [5 x [2 x i32]], [5 x [2 x i32]]* %2, i64 0, i64 0
%5 = bitcast [2 x i32]* %4 to i32**
%6 = call double @polygon_area(i32** %5, i32 5)
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x [2 x i32]] [[2 x i32] [i32 -5, i32 1], [2 x i32] [i32 -1, i32 5], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 -2, i32 -3], [2 x i32] [i32 -1, i32 1]]
@.str = [22 x i8] c"polygon area a is %f\0A\00"
define i32 @main() {
%1 = alloca [5 x [2 x i32]]
%2 = bitcast [5 x [2 x i32]]* %1 to i8*
%3 = bitcast [5 x [2 x i32]]* %1 to i32**
%4 = call double @polygon_area(i32** %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void slaves_print_stats(void) {}


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

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

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

LLVM IR (-O2):
define void @slaves_print_stats() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void oom(void) {
  fprintf(stderr, "out of memory\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<oom>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define void @oom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define void @oom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t read_ploidy(uint8_t ploidy_miss) { return ploidy_miss & 127; }


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

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

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

LLVM IR (-O2):
define i32 @read_ploidy(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printc(char c) { printf("%c", c); }


x86 assembly (clang, -O0):
<printc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printc(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
long double atanl(long double);
long double arctanl(long double x) { return atanl(x); }


x86 assembly (clang, -O0):
<arctanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <atanl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arctanl>:
jmp    1030 <atanl@plt>

LLVM IR (-O0):
define x86_fp80 @arctanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @atanl(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @arctanl(x86_fp80 %0) {
%2 = tail call x86_fp80 @atanl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int pkey_custom_pub_check(EVP_PKEY *pkey) { return 0xbeef; }


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

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

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

LLVM IR (-O2):
define i32 @pkey_custom_pub_check(i32* nocapture readnone %0) {
ret i32 48879
}
void writeInt(char **pptr, int anInt) {
  **pptr = (char)(anInt / 256);
  (*pptr)++;
  **pptr = (char)(anInt % 256);
  (*pptr)++;
}


x86 assembly (clang, -O0):
<writeInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeInt>:
lea    0xff(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    (%rdi),%rcx
mov    %ah,(%rcx)
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %sil,0x1(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @writeInt(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 256
%7 = trunc i32 %6 to i8
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
store i8 %7, i8* %9
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
%13 = load i32, i32* %4
%14 = srem i32 %13, 256
%15 = trunc i32 %14 to i8
%16 = load i8**, i8*** %3
%17 = load i8*, i8** %16
store i8 %15, i8* %17
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
ret void
}

LLVM IR (-O2):
define void @writeInt(i8** nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 256
%4 = trunc i32 %3 to i8
%5 = load i8*, i8** %0
store i8 %4, i8* %5
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
%8 = trunc i32 %1 to i8
store i8 %8, i8* %7
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
ret void
}
void func6(int *a) {
  if (!a) {
    int k = 10;
    return;
  }
  *a = 700;
}


x86 assembly (clang, -O0):
<func6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111f <func6+0x1f>
movl   $0xa,-0xc(%rbp)
jmp    1129 <func6+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2bc,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func6>:
test   %rdi,%rdi
je     110b <func6+0xb>
movl   $0x2bc,(%rdi)
ret

LLVM IR (-O0):
define void @func6(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 10, i32* %3
br label %9
7: ; preds = %1
%8 = load i32*, i32** %2
store i32 700, i32* %8
br label %9
9: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @func6(i32* writeonly %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i32 700, i32* %0
br label %4
4: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, int, int, int /*<<< orphan*/ *);
size_t read_data(FILE *in, void *buffer) {
  return fread(buffer, 1, 10000000, in);
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x989680,%edx
call   1030 <fread@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
mov    $0x989680,%edx
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i64 @read_data(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32*, i32** %3
%7 = call i64 @fread(i8* %5, i32 1, i32 10000000, i32* %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @read_data(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @fread(i8* %1, i32 1, i32 10000000, i32* %0)
ret i64 %3
}
int test_imm_EDint8_reg(signed char val) {
  return ((val) & (-0xED << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EDint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff13,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_EDint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -237
%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_EDint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -237
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
void *thread_function(void *data) {
  int number = (int *)data;
  printf("hello from thread%-d  meu id é pthread_self() =  %lu  :: gettid() =  "
         "%u\n",
         number, pthread_self(), syscall(SYS_gettid));
  sleep(2);
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_function>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
lea    0xe9c(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    $0x2,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"hello from thread%-d meu id \C3\A9 pthread_self() = %lu :: gettid() = %u\0A\00"
@SYS_gettid = global i32 0
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = ptrtoint i32* %6 to i32
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (...) @pthread_self()
%10 = load i32, i32* @SYS_gettid
%11 = call i32 @syscall(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %11)
%13 = call i32 @sleep(i32 2)
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [74 x i8] c"hello from thread%-d meu id \C3\A9 pthread_self() = %lu :: gettid() = %u\0A\00"
@SYS_gettid = global i32 0
define noalias i8* @thread_function(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 (...) @pthread_self()
%5 = load i32, i32* @SYS_gettid
%6 = tail call i32 @syscall(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %6)
%8 = tail call i32 @sleep(i32 2)
ret i8* undef
}
int _capture_size(int w, int h) {
  int size = 0;
  size = h * (w + 1);
  return size;
}


x86 assembly (clang, -O0):
<_capture_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_capture_size>:
lea    0x1(%rdi),%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @_capture_size(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = mul nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cli_puts(char *str) { printf(str); }


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

x86 assembly (clang, -O2):
<cli_puts>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @cli_puts(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
void g_node_insert_after() {}


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

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

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

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

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ AUTHORITY_INFO_ACCESS_it;
AUTHORITY_INFO_ACCESS *d2i_AUTHORITY_INFO_ACCESS(AUTHORITY_INFO_ACCESS **a,
                                                 const unsigned char **in,
                                                 long len) {
  return (AUTHORITY_INFO_ACCESS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                                &AUTHORITY_INFO_ACCESS_it);
}


x86 assembly (clang, -O0):
<d2i_AUTHORITY_INFO_ACCESS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_AUTHORITY_INFO_ACCESS>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@AUTHORITY_INFO_ACCESS_it = global i32 0
define i32* @d2i_AUTHORITY_INFO_ACCESS(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @AUTHORITY_INFO_ACCESS_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@AUTHORITY_INFO_ACCESS_it = global i32 0
define i32* @d2i_AUTHORITY_INFO_ACCESS(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @AUTHORITY_INFO_ACCESS_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void af(void *a) {}


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

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

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

LLVM IR (-O2):
define void @af(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *);
void Jump_If_Greater(char *label) {
  Inst_Printf("bgt",
              "cr"
              "1"
              ","
              "_"
              "%s",
              label);
}


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

x86 assembly (clang, -O2):
<Jump_If_Greater>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee3(%rip),%rsi
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"bgt\00"
@.str.1 = [8 x i8] c"cr1,_%s\00"
define void @Jump_If_Greater(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"bgt\00"
@.str.1 = [8 x i8] c"cr1,_%s\00"
define void @Jump_If_Greater(i8* %0) {
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned char *cbor_write_type_size_bytes(unsigned char *, unsigned int, int,
                                          int /*<<< orphan*/, unsigned char *);
int /*<<< orphan*/ strlen(char const *);
unsigned char *cbor_write_string(unsigned char *data, unsigned int size,
                                 const char *str) {
  return cbor_write_type_size_bytes(data, size, 3, strlen(str),
                                    (unsigned char *)str);
}


x86 assembly (clang, -O0):
<cbor_write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %eax,%ecx
mov    -0x18(%rbp),%r8
mov    $0x3,%edx
call   1040 <cbor_write_type_size_bytes@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbor_write_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    $0x3,%edx
mov    %eax,%ecx
mov    %rbx,%r8
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cbor_write_type_size_bytes@plt>

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

LLVM IR (-O2):
define i8* @cbor_write_string(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i8* @cbor_write_type_size_bytes(i8* %0, i32 %1, i32 3, i32 %4, i8* %2)
ret i8* %5
}
void free_lvector(v, nl, nh) long nh, nl;
unsigned long *v;
{ free((char *)(v + nl - 1)); }


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

x86 assembly (clang, -O2):
<free_lvector>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_lvector(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i64, i64* %7, i64 %8
%10 = getelementptr inbounds i64, i64* %9, i64 -1
%11 = bitcast i64* %10 to i8*
ret void
}

LLVM IR (-O2):
define void @free_lvector(i64* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i64, i64* %0, i64 %1
%5 = getelementptr inbounds i64, i64* %4, i64 -1
%6 = bitcast i64* %5 to i8*
tail call void @free(i8* %6)
ret void
}
int ilog2(int n) {
  int r = -1;
  if (n <= 0)
    return (0);
  while (n) {
    r++;
    n >>= 1;
  }
  return (r);
}


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1124 <ilog2+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1150 <ilog2+0x50>
jmp    1129 <ilog2+0x29>
cmpl   $0x0,-0x8(%rbp)
je     114a <ilog2+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <ilog2+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
test   %edi,%edi
jle    111d <ilog2+0x1d>
mov    $0xffffffff,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ilog2+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ -1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, 1
%7 = ashr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
void glutReshapeWindow(int width, int height) {}


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

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

LLVM IR (-O0):
define void @glutReshapeWindow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @glutReshapeWindow(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int Pop();
int /*<<< orphan*/ Push(int);
int CmdLShift(void) {
  int operand2;
  operand2 = Pop();
  Push(Pop() << operand2);
  return 0;
}


x86 assembly (clang, -O0):
<CmdLShift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Pop@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Pop@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%ecx
shl    %cl,%edi
call   1040 <Push@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdLShift>:
push   %rbx
xor    %eax,%eax
call   1030 <Pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <Pop@plt>
mov    %ebx,%ecx
shl    %cl,%eax
mov    %eax,%edi
call   1040 <Push@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CmdLShift() {
%1 = alloca i32
%2 = call i32 (...) @Pop()
store i32 %2, i32* %1
%3 = call i32 (...) @Pop()
%4 = load i32, i32* %1
%5 = shl i32 %3, %4
%6 = call i32 @Push(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @CmdLShift() {
%1 = tail call i32 (...) @Pop()
%2 = tail call i32 (...) @Pop()
%3 = shl i32 %2, %1
%4 = tail call i32 @Push(i32 %3)
ret i32 0
}
__attribute__((no, noclone)) int f1(int x, int (*p1)(void), int (*p2)(void)) {
  if (x)
    return p1();
  else
    return p2();
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <f1+0x28>
call   *-0x10(%rbp)
mov    %eax,-0x4(%rbp)
jmp    112e <f1+0x2e>
call   *-0x18(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
test   %edi,%edi
cmove  %rdx,%rsi
jmp    *%rsi

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

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 ()* nocapture %1, i32 ()* nocapture %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 ()* %2, i32 ()* %1
%6 = tail call i32 %5()
ret i32 %6
}
/* Type definitions */
struct passwd {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EINTR;
struct passwd *__getpwent(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
struct passwd *fgetpwent(FILE *file) {
  if (file == NULL) {
    errno = EINTR;
    return NULL;
  }
  return __getpwent(fileno(file));
}


x86 assembly (clang, -O0):
<fgetpwent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <fgetpwent+0x36>
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    0x2e99(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    116a <fgetpwent+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
call   1030 <__getpwent@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetpwent>:
push   %rax
test   %rdi,%rdi
je     1133 <fgetpwent+0x13>
call   1040 <fileno@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <__getpwent@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    0x2e9d(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
@EINTR = global i32 0
@errno = global i32 0
define %struct.passwd* @fgetpwent(i32* %0) {
%2 = alloca %struct.passwd*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @EINTR
store i32 %7, i32* @errno
store %struct.passwd* null, %struct.passwd** %2
br label %12
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @fileno(i32* %9)
%11 = call %struct.passwd* @__getpwent(i32 %10)
store %struct.passwd* %11, %struct.passwd** %2
br label %12
12: ; preds = %8, %6
%13 = load %struct.passwd*, %struct.passwd** %2
ret %struct.passwd* %13
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@EINTR = global i32 0
@errno = global i32 0
define %struct.passwd* @fgetpwent(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @EINTR
store i32 %4, i32* @errno
br label %8
5: ; preds = %1
%6 = tail call i32 @fileno(i32* %0)
%7 = tail call %struct.passwd* @__getpwent(i32 %6)
br label %8
8: ; preds = %5, %3
%9 = phi %struct.passwd* [ null, %3 ], [ %7, %5 ]
ret %struct.passwd* %9
}
f2(a) long a;
{
  int i;
  for (i = 0; i < 10; i++) {
    if (--a != -1)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    114d <f2+0x4d>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
cmp    $0xffffffffffffffff,%rax
je     113a <f2+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <f2+0x54>
jmp    113f <f2+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <f2+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @f2(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void string_printArray(char **s) {
  while (*s != 0) {
    printf("%s\n", *s);
    s++;
  }
}


x86 assembly (clang, -O0):
<string_printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114e <string_printArray+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <string_printArray+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_printArray>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1144 <string_printArray+0x34>
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <string_printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @string_printArray(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i8** [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a, b, q, olda;
  q = __VERIFIER_nondet_int();
  a = __VERIFIER_nondet_int();
  b = __VERIFIER_nondet_int();
  while (q > 0) {
    q = q + a - 1;
    olda = a;
    a = 3 * olda - 4 * b;
    b = 4 * olda + 3 * b;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    117c <main+0x6c>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x3,-0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
imul   $0x3,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int byteorder();
int edf_byteorder(void) { return (byteorder()); }


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

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

LLVM IR (-O0):
define i32 @edf_byteorder() {
%1 = call i32 (...) @byteorder()
ret i32 %1
}

LLVM IR (-O2):
define i32 @edf_byteorder() {
%1 = tail call i32 (...) @byteorder()
ret i32 %1
}
void clear_buff(int data[], int items) {
  int i;
  for (i = 0; i < items; i++)
    data[i] = 0;
}


x86 assembly (clang, -O0):
<clear_buff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <clear_buff+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clear_buff+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buff>:
test   %esi,%esi
jle    1126 <clear_buff+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_buff(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_ptr(void *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fatal_error_msg(char *);
void *malloc(long);
void *c_malloc(long size) {
  void *ptr = malloc(size);
  if (!ptr) {
    fatal_error_msg("malloc() has failed");
    exit(1);
  }
  add_ptr(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<c_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117a <c_malloc+0x3a>
lea    0xe95(%rip),%rdi
call   1040 <fatal_error_msg@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1050 <add_ptr@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_malloc>:
push   %rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     115b <c_malloc+0x1b>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <add_ptr@plt>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xe9e(%rip),%rdi
call   1040 <fatal_error_msg@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"malloc() has failed\00"
define i8* @c_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @fatal_error_msg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i32 @add_ptr(i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [20 x i8] c"malloc() has failed\00"
define i8* @c_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @fatal_error_msg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @add_ptr(i8* %2)
ret i8* %2
}
const char *AArrayStrMap_GetKey(void *valuePtr, int valueTypeSize) {
  return (const char *)valuePtr + valueTypeSize;
}


x86 assembly (clang, -O0):
<AArrayStrMap_GetKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AArrayStrMap_GetKey>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @AArrayStrMap_GetKey(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @AArrayStrMap_GetKey(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ Cvar_Set(int /*<<< orphan*/, int /*<<< orphan*/);
void Cvar_Set_f(void) {
  if (Cmd_Argc() != 3) {
    Com_Printf("usage: set <variable> <value>\n");
    return;
  }
  Cvar_Set(Cmd_Argv(1), Cmd_Argv(2));
}


x86 assembly (clang, -O0):
<Cvar_Set_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x3,%eax
je     1169 <Cvar_Set_f+0x29>
lea    0xea1(%rip),%rdi
call   1050 <Com_Printf@plt>
jmp    118a <Cvar_Set_f+0x4a>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1060 <Cmd_Argv@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1040 <Cvar_Set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cvar_Set_f>:
push   %rbx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x3,%eax
jne    116d <Cvar_Set_f+0x2d>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1060 <Cmd_Argv@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <Cvar_Set@plt>
lea    0xe8c(%rip),%rdi
pop    %rbx
jmp    1050 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"usage: set <variable> <value>\0A\00"
define void @Cvar_Set_f() {
%1 = call i32 (...) @Cmd_Argc()
%2 = icmp ne i32 %1, 3
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @Com_Printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = call i32 @Cmd_Argv(i32 1)
%7 = call i32 @Cmd_Argv(i32 2)
%8 = call i32 @Cvar_Set(i32 %6, i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"usage: set <variable> <value>\0A\00"
define void @Cvar_Set_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp eq i32 %1, 3
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = tail call i32 @Cmd_Argv(i32 1)
%7 = tail call i32 @Cmd_Argv(i32 2)
%8 = tail call i32 @Cvar_Set(i32 %6, i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}