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

/* Variables and functions */
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int main() {
  FILE *fp = fdopen(1, "W+");
  fprintf(fp, "%s\n", "hell0");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xecc(%rip),%rsi
call   1040 <fdopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
lea    0xeb8(%rip),%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1040 <fdopen@plt>
lea    0xeca(%rip),%rsi
lea    0xec7(%rip),%rdx
mov    %rax,%rdi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"W+\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"hell0\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fdopen(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"W+\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"hell0\00"
define i32 @main() {
%1 = tail call i32* @fdopen(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ isinf(double);
double log10(double);
double __attribute__((always_)) _clamped_neglog(double prob) {
  prob = -log10(prob);
  return isinf(prob) || (prob > 300) ? 300.0 : prob;
}


x86 assembly (clang, -O0):
<_clamped_neglog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%rax
jne    117e <_clamped_neglog+0x5e>
movsd  -0x8(%rbp),%xmm0
movsd  0xe8c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1190 <_clamped_neglog+0x70>
movsd  0xe7a(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    119a <_clamped_neglog+0x7a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clamped_neglog>:
sub    $0x28,%rsp
call   1030 <log10@plt>
movapd 0xecf(%rip),%xmm1
movapd %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
movapd %xmm1,%xmm0
call   1040 <isinf@plt>
movsd  0xebf(%rip),%xmm0
test   %rax,%rax
jne    1172 <_clamped_neglog+0x52>
movapd 0x10(%rsp),%xmm1
cmpltsd 0xeb3(%rip),%xmm1
andpd  %xmm1,%xmm0
andnpd (%rsp),%xmm1
orpd   %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @_clamped_neglog(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10(double %3)
%5 = fneg double %4
store double %5, double* %2
%6 = load double, double* %2
%7 = call i64 @isinf(double %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load double, double* %2
%11 = fcmp ogt double %10, 3.000000e+02
br i1 %11, label %12, label %13
12: ; preds = %9, %1
br label %15
13: ; preds = %9
%14 = load double, double* %2
br label %15
15: ; preds = %13, %12
%16 = phi double [ 3.000000e+02, %12 ], [ %14, %13 ]
ret double %16
}

LLVM IR (-O2):
define double @_clamped_neglog(double %0) {
%2 = tail call double @log10(double %0)
%3 = fneg double %2
%4 = tail call i64 @isinf(double %3)
%5 = icmp ne i64 %4, 0
%6 = fcmp olt double %2, -3.000000e+02
%7 = select i1 %5, i1 true, i1 %6
%8 = select i1 %7, double 3.000000e+02, double %3
ret double %8
}
int int_log2(int arg) {
  int l = 0;
  arg >>= 1;
  while (arg) {
    l++;
    arg >>= 1;
  }
  return l;
}


x86 assembly (clang, -O0):
<int_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <int_log2+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1117 <int_log2+0x17>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <int_log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <int_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ getallenv();
int main() { getallenv(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @getallenv()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getallenv()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
int main() {
  execlp("ps", "ps", "-ef", NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rsi
lea    0xed6(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1030 <execlp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"ps\00"
@.str.1 = [4 x i8] c"-ef\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ps\00"
@.str.1 = [4 x i8] c"-ef\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 0
}
void foo(unsigned char *x, int y, unsigned char *z) {}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(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
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
int HelpItem128(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem128() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem128() {
ret i32 0
}
int fromNativeFD(int x) { return x + 6; }


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

x86 assembly (clang, -O2):
<fromNativeFD>:
lea    0x6(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @fromNativeFD(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 6
ret i32 %4
}

LLVM IR (-O2):
define i32 @fromNativeFD(i32 %0) {
%2 = add nsw i32 %0, 6
ret i32 %2
}
void del_newline(char *line) {
  while (*line != '\0') {
    if (*line == '\n') {
      *line = '\0';
      return;
    }
    line++;
  }
  return;
}


x86 assembly (clang, -O0):
<del_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <del_newline+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1134 <del_newline+0x34>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    114a <del_newline+0x4a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <del_newline+0x8>
jmp    114a <del_newline+0x4a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_newline>:
movzbl (%rdi),%eax
test   %al,%al
je     1114 <del_newline+0x14>
cmp    $0xa,%al
je     1111 <del_newline+0x11>
add    $0x1,%rdi
jmp    1100 <del_newline>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @del_newline(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 %18
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %2
store i8 0, i8* %14
br label %19
15: ; preds = %8
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %3
br label %19
19: ; preds = %18, %13
ret void
}

LLVM IR (-O2):
define void @del_newline(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap64(int /*<<< orphan*/);
void cpu_to_be64s(uint64_t *p) { *p = bswap64(*p); }


x86 assembly (clang, -O0):
<cpu_to_be64s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <bswap64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_be64s>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <bswap64@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cpu_to_be64s(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @bswap64(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: create_short_dirs nr_dirs parent_dir\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: create_short_dirs nr_dirs parent_dir\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: create_short_dirs nr_dirs parent_dir\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dh_init();
int /*<<< orphan*/ hmac_init();
int /*<<< orphan*/ rand_init();
int crypto_init() {
  rand_init();
  dh_init();
  hmac_init();
  return 0;
}


x86 assembly (clang, -O0):
<crypto_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand_init@plt>
mov    $0x0,%al
call   1040 <dh_init@plt>
mov    $0x0,%al
call   1050 <hmac_init@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_init>:
push   %rax
xor    %eax,%eax
call   1030 <rand_init@plt>
xor    %eax,%eax
call   1040 <dh_init@plt>
xor    %eax,%eax
call   1050 <hmac_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @crypto_init() {
%1 = call i32 (...) @rand_init()
%2 = call i32 (...) @dh_init()
%3 = call i32 (...) @hmac_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @crypto_init() {
%1 = tail call i32 (...) @rand_init()
%2 = tail call i32 (...) @dh_init()
%3 = tail call i32 (...) @hmac_init()
ret i32 0
}
unsigned int bytesToData(unsigned char b1, unsigned char b2, unsigned char b3) {
  return (unsigned int)b3 | (((unsigned int)b2) << 8) |
         (((unsigned int)b1) << 16);
}


x86 assembly (clang, -O0):
<bytesToData>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytesToData>:
shl    $0x8,%esi
lea    (%rsi,%rdx,1),%eax
shl    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bytesToData(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 16
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @bytesToData(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %4
%8 = zext i8 %0 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %7, %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int __rsyscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
  return __rsyscall(210, rgid, egid, sgid, 0, 0, 0);
}


x86 assembly (clang, -O0):
<setresgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xd2,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__rsyscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setresgid>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0xd2,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__rsyscall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @setresgid(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__rsyscall(i32 210, i32 %0, i32 %1, i32 %2, i32 0, i32 0, i32 0)
ret i32 %4
}
void f1(unsigned x) {
  switch (x) {
  case -1:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xffffffff,%eax
jne    111d <f1+0x1d>
jmp    1118 <f1+0x18>
jmp    1122 <f1+0x22>
jmp    1122 <f1+0x22>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f1(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
__attribute__((always_)) void permutation_first(int r, int n, int *c) {
  int i;
  (void)n;
  assert(0 < r && r <= n);
  for (i = 0; i < r; ++i)
    c[i] = 0;
}


x86 assembly (clang, -O0):
<permutation_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x15(%rbp)
jge    113e <permutation_first+0x2e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117b <permutation_first+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <permutation_first+0x42>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permutation_first>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
test   %edi,%edi
setg   %al
cmp    %esi,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
test   %ebp,%ebp
jle    1150 <permutation_first+0x30>
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @permutation_first(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 0, %9
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp sle i32 %12, %13
br label %15
15: ; preds = %11, %3
%16 = phi i1 [ false, %3 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
store i32 0, i32* %7
br label %19
19: ; preds = %28, %15
%20 = load i32, i32* %7
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %31
23: ; preds = %19
%24 = load i32*, i32** %6
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
store i32 0, i32* %27
br label %28
28: ; preds = %23
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %19
31: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @permutation_first(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, 0
%5 = icmp sle i32 %0, %1
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
br i1 %4, label %9, label %13
9: ; preds = %3
%10 = bitcast i32* %2 to i8*
%11 = zext i32 %0 to i64
%12 = shl nuw nsw i64 %11, 2
br label %13
13: ; preds = %9, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char *const *);
int /*<<< orphan*/ func1();
int /*<<< orphan*/ func2();
int main(void) {
  char *const args[] = {"-l", "-h", (char *)0};
  func1();
  execvp("ls", args);
  func2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <func1@plt>
lea    -0x20(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1050 <execvp@plt>
mov    $0x0,%al
call   1040 <func2@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2cd5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cb9(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <func1@plt>
lea    0xead(%rip),%rdi
mov    %rsp,%rsi
call   1050 <execvp@plt>
xor    %eax,%eax
call   1040 <func2@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-l\00"
@.str.1 = [3 x i8] c"-h\00"
@__const.main.args = [3 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str.2 = [3 x i8] c"ls\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8*]
store i32 0, i32* %1
%3 = bitcast [3 x i8*]* %2 to i8*
%4 = call i32 (...) @func1()
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%6 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %5)
%7 = call i32 (...) @func2()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-l\00"
@.str.1 = [3 x i8] c"-h\00"
@__const.main.args = [3 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str.2 = [3 x i8] c"ls\00"
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = tail call i32 (...) @func1()
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%5 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %4)
%6 = call i32 (...) @func2()
ret i32 0
}
void ff_hevc_put_hevc_bi_w_qpel_h8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_h8_8_sse4() {
ret void
}
/* Variables and functions */
int vlist_inq_att(int, int, int, char const *, size_t, char *);
int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen,
                   char *tp) {
  return vlist_inq_att(253, vlistID, varID, name, (size_t)mlen * sizeof(char),
                       tp);
}


x86 assembly (clang, -O0):
<vlistInqAttTxt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%r8
shl    $0x0,%r8
mov    -0x20(%rbp),%r9
mov    $0xfd,%edi
call   1030 <vlist_inq_att@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlistInqAttTxt>:
mov    %r8,%r9
mov    %rdx,%rax
mov    %esi,%edx
mov    %edi,%esi
movslq %ecx,%r8
mov    $0xfd,%edi
mov    %rax,%rcx
jmp    1030 <vlist_inq_att@plt>

LLVM IR (-O0):
define i32 @vlistInqAttTxt(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 1
%17 = load i8*, i8** %10
%18 = call i32 @vlist_inq_att(i32 253, i32 %11, i32 %12, i8* %13, i64 %16, i8* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @vlistInqAttTxt(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = sext i32 %3 to i64
%7 = tail call i32 @vlist_inq_att(i32 253, i32 %0, i32 %1, i8* %2, i64 %6, i8* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  int i, n = __VERIFIER_nondet_int(), sn = 0;
  for (i = 1; i <= n; i++) {
    sn = sn + (2);
  }
  __VERIFIER_assert(sn == n * (2) || sn == 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,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116a <main+0x4a>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     118a <main+0x6a>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
lea    (%rax,%rax,1),%ecx
test   %eax,%eax
cmovg  %ecx,%ebx
cmp    %ecx,%ebx
sete   %al
test   %ebx,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = shl i32 %1, 1
%3 = icmp sgt i32 %1, 0
%4 = select i1 %3, i32 %2, i32 0
%5 = icmp eq i32 %4, %2
%6 = icmp eq i32 %4, 0
%7 = or i1 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @__VERIFIER_assert(i32 %8)
ret i32 0
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <gcd+0x37>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %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
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
br label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = call i32 @gcd(i32 %10, i32 %13)
br label %15
15: ; preds = %9, %7
%16 = phi i32 [ %8, %7 ], [ %14, %9 ]
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 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
char *strcpy(char *dst, const char *src) {
  while (*src)
    *dst++ = *src++;
  *dst = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strcpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
double _gb(double n) { return (n / (1024. * 1024. * 1024.)); }


x86 assembly (clang, -O0):
<_gb>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gb>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_gb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x41D0000000000000
ret double %4
}

LLVM IR (-O2):
define double @_gb(double %0) {
%2 = fmul double %0, 0x3E10000000000000
ret double %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ count;
};
typedef TYPE_1__ XExposeEvent;

/* Variables and functions */
int get_XExposeEvent_count(void *_p) {
  return (int)((XExposeEvent *)_p)->count;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XExposeEvent_count(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XExposeEvent_count(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ funCalculateArea();
int main() {
  funCalculateArea();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @funCalculateArea()
ret i32 0
}
void sec_getlog_supply_loggerinfo(void *p_main, void *p_radio, void *p_events,
                                  void *p_system) {}


x86 assembly (clang, -O0):
<sec_getlog_supply_loggerinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sec_getlog_supply_loggerinfo(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @sec_getlog_supply_loggerinfo(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putstr(char *str) {
  char *ptr;
  ptr = str;
  while (*ptr)
    ptr++;
  write(1, str, ptr - str);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <ft_putstr+0x32>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <ft_putstr+0x14>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putstr+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @ft_putstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
%20 = call i32 @write(i32 1, i8* %13, i32 %19)
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = tail call i32 @write(i32 1, i8* %0, i32 %11)
ret void
}
int sll(int register2, int number) { return register2 << number; }


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

x86 assembly (clang, -O2):
<sll>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @sll(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void freeall(int **m, int size) {
  int i;
  for (i = 0; i < size; i++) {
    if (m[i] != NULL) {
      free(m[i]);
    }
  }
}


x86 assembly (clang, -O0):
<freeall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <freeall+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <freeall+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    115b <freeall+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeall+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeall>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <freeall+0x39>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
jmp    1139 <freeall+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     1149 <freeall+0x39>
mov    (%r14,%rbx,8),%rdi
test   %rdi,%rdi
je     1130 <freeall+0x20>
call   1030 <free@plt>
jmp    1130 <freeall+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @freeall(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 = %25, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %28
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
%15 = load i32*, i32** %14
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %24
17: ; preds = %10
%18 = load i32**, i32*** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32*, i32** %18, i64 %20
%22 = load i32*, i32** %21
%23 = call i32 @free(i32* %22)
br label %24
24: ; preds = %17, %10
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @freeall(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ 0, %4 ], [ %14, %13 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = load i32*, i32** %8
%10 = icmp eq i32* %9, null
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call i32 @free(i32* %9)
br label %13
13: ; preds = %6, %11
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %13, %2
ret void
}
void vnet_library_plugin_reference(void) {}


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

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

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

LLVM IR (-O2):
define void @vnet_library_plugin_reference() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wait(int *);
int main() {
  int status;
  int pid = fork();
  if (pid != 0) {
    wait(&status);
  } else {
    while (1) {
      printf("A");
      fflush(NULL);
      sleep(1);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117a <main+0x2a>
lea    -0x4(%rbp),%rdi
call   1060 <wait@plt>
jmp    11a3 <main+0x53>
jmp    117f <main+0x2f>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    117f <main+0x2f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
test   %eax,%eax
je     1170 <main+0x20>
lea    0x4(%rsp),%rdi
call   1060 <wait@plt>
xor    %eax,%eax
pop    %rcx
ret
nopw   0x0(%rax,%rax,1)
mov    $0x41,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1170 <main+0x20>

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @wait(i32* %1)
ret i32 0
7: ; preds = %0, %7
%8 = tail call i32 @putchar(i32 65)
%9 = tail call i32 @fflush(i32* null)
%10 = tail call i32 @sleep(i32 1)
br label %7
}
void gtk_drawing_area_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drawing_area_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void checkPalindrome(char palindromeCandidate[]) {
  printf("%s\n", palindromeCandidate);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @checkPalindrome(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ PASS(char *);
int main(int argc, const char *argv[]) {
  PASS("text-reloc-alt-segment");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <PASS@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"text-reloc-alt-segment\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @PASS(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [23 x i8] c"text-reloc-alt-segment\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @PASS(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
__attribute__((no, noclone)) void compare(const double *p, const double *q) {
  for (int i = 0; i < 3; ++i)
    if (p[i] != q[i])
      __builtin_abort();
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1174 <compare+0x64>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jne    115c <compare+0x4c>
jp     115c <compare+0x4c>
jmp    1161 <compare+0x51>
call   1030 <abort@plt>
jmp    1166 <compare+0x56>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <compare+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
push   %rax
movsd  (%rdi),%xmm0
ucomisd (%rsi),%xmm0
jne    113b <compare+0x2b>
jp     113b <compare+0x2b>
movsd  0x8(%rdi),%xmm0
ucomisd 0x8(%rsi),%xmm0
jne    113b <compare+0x2b>
jp     113b <compare+0x2b>
movsd  0x10(%rdi),%xmm0
ucomisd 0x10(%rsi),%xmm0
jne    113b <compare+0x2b>
jp     113b <compare+0x2b>
pop    %rax
ret
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @compare(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp une double %3, %4
br i1 %5, label %19, label %6
6: ; preds = %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fcmp une double %8, %10
br i1 %11, label %19, label %12
12: ; preds = %6
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fcmp une double %14, %16
br i1 %17, label %19, label %18
18: ; preds = %12
ret void
19: ; preds = %12, %6, %2
tail call void @abort()
unreachable
}
__attribute__((always_)) void kmemcheck_mark_unallocated_pages(struct page *p,
                                                               unsigned int n) {
}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @kmemcheck_mark_unallocated_pages(%struct.page* nocapture %0, i32 %1) {
ret void
}