xunge/DecIR huggingface dataset:
void stringCopy(char *strSrc, char *strDest) {
  int i = 0;
  char c;
  do {
    c = strSrc[i];
    strDest[i] = c;
    i++;
  } while (c);
}


x86 assembly (clang, -O0):
<stringCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpb   $0x0,-0x15(%rbp)
jne    1113 <stringCopy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringCopy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <stringCopy+0x10>
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int pthread_sigmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ *);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int blocksig(int signo) {
  sigset_t set;
  sigemptyset(&set);
  sigaddset(&set, signo);
  return pthread_sigmask(SIG_BLOCK, &set, NULL);
}


x86 assembly (clang, -O0):
<blocksig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blocksig>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <pthread_sigmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @blocksig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @sigaddset(i32* %3, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @pthread_sigmask(i32 %7, i32* %3, i32* null)
ret i32 %8
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @blocksig(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = call i32 @sigaddset(i32* %2, i32 %0)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @pthread_sigmask(i32 %6, i32* %2, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_put_sample_spec() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_put_sample_spec"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_tagstruct_put_sample_spec\0A\00"
define i32 @pa_tagstruct_put_sample_spec() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_tagstruct_put_sample_spec\00"
define i32 @pa_tagstruct_put_sample_spec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
char *chrtostr(char ch) {
  static char str[2] = {'\0', '\0'};
  str[0] = ch;
  return str;
}


x86 assembly (clang, -O0):
<chrtostr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,0x2f0e(%rip)
lea    0x2f07(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrtostr>:
mov    %dil,0x2f1a(%rip)
lea    0x2f13(%rip),%rax
ret

LLVM IR (-O0):
@chrtostr.str = internal global [2 x i8] zeroinitializer
define i8* @chrtostr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store i8 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @chrtostr.str, i64 0, i64 0)
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @chrtostr.str, i64 0, i64 0)
}

LLVM IR (-O2):
@chrtostr.str = internal global [2 x i8] zeroinitializer
define i8* @chrtostr(i8 signext %0) {
store i8 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @chrtostr.str, i64 0, i64 0)
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @chrtostr.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint32_t;
struct pcg_state_32 {
  int dummy;
};

/* Variables and functions */
int pcg_oneseq_32_rxs_m_xs_32_random_r(struct pcg_state_32 *);
uint32_t pcg_oneseq_32_rxs_m_xs_32_boundedrand_r(struct pcg_state_32 *rng,
                                                 uint32_t bound) {
  uint32_t threshold = -bound % bound;
  for (;;) {
    uint32_t r = pcg_oneseq_32_rxs_m_xs_32_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_oneseq_32_rxs_m_xs_32_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_oneseq_32_rxs_m_xs_32_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_oneseq_32_rxs_m_xs_32_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_oneseq_32_rxs_m_xs_32_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_oneseq_32_rxs_m_xs_32_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_oneseq_32_rxs_m_xs_32_random_r@plt>
test   %eax,%eax
js     1120 <pcg_oneseq_32_rxs_m_xs_32_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.pcg_state_32 = type { i32 }
define i32 @pcg_oneseq_32_rxs_m_xs_32_boundedrand_r(%struct.pcg_state_32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_oneseq_32_rxs_m_xs_32_random_r(%struct.pcg_state_32* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
long labs(long x) { return __builtin_labs(x); }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    %rax,%rcx
cmp    $0x0,%rax
cmovl  %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 0, %3
%5 = icmp slt i64 %3, 0
%6 = select i1 %5, i64 %4, i64 %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ xs2mp(int, float, float, float, float);
void xs2mp_(int *panelid, float *x1, float *y1, float *x2, float *y2) {
  xs2mp(*panelid, *x1, *y1, *x2, *y2);
}


x86 assembly (clang, -O0):
<xs2mp_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm3
call   1030 <xs2mp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xs2mp_>:
mov    (%rdi),%edi
movss  (%rsi),%xmm0
movss  (%rdx),%xmm1
movss  (%rcx),%xmm2
movss  (%r8),%xmm3
jmp    1030 <xs2mp@plt>

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

LLVM IR (-O2):
define void @xs2mp_(i32* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture %4) {
%6 = load i32, i32* %0
%7 = load float, float* %1
%8 = load float, float* %2
%9 = load float, float* %3
%10 = load float, float* %4
%11 = tail call i32 @xs2mp(i32 %6, float %7, float %8, float %9, float %10)
ret void
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test10(void) { return test_sat_parser_should_fail("(a or b*c)"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"(a or b*c)\00"
define i32 @test10() {
%1 = call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"(a or b*c)\00"
define i32 @test10() {
%1 = tail call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void release_vector(double *x) { free(x); }


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

x86 assembly (clang, -O2):
<release_vector>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @release_vector(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void strcpy_no_overflow(char *y) {
  char x[4];
  if (strlen(y) == 3)
    strcpy(x, y);
}


x86 assembly (clang, -O0):
<strcpy_no_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x3,%eax
jne    114b <strcpy_no_overflow+0x2b>
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_no_overflow>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x3,%eax
jne    113f <strcpy_no_overflow+0x1f>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @strcpy_no_overflow(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = icmp eq i32 %5, 3
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @strcpy_no_overflow(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @strcpy(i8* %3, i8* %0)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compress();
int main() { compress(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @compress()
ret i32 0
}
int x_gcd(int a, int b) {
  int c;
  if (a < b) {
    c = a;
    a = b;
    b = c;
  }
  while (1) {
    c = a % b;
    if (c == 0)
      return b;
    a = b;
    b = c;
  }
}


x86 assembly (clang, -O0):
<x_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <x_gcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <x_gcd+0x2d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1146 <x_gcd+0x46>
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <x_gcd+0x2d>

x86 assembly (clang, -O2):
<x_gcd>:
mov    %esi,%edx
cmp    %esi,%edi
mov    %edi,%eax
cmovl  %esi,%eax
cmovl  %edi,%edx
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <x_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @x_gcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %8, %6 ]
%8 = phi i32 [ %5, %2 ], [ %9, %6 ]
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
void join_sealing_thread(pid_t pid) { waitpid(pid, NULL, 0); }


x86 assembly (clang, -O0):
<join_sealing_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_sealing_thread>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <waitpid@plt>

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

LLVM IR (-O2):
define void @join_sealing_thread(i32 %0) {
%2 = tail call i32 @waitpid(i32 %0, i32* null, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, b, c;
  a = 5;
  b = 5;
  (a < b) ? printf("%d", a) : printf("%d", b + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
jmp    115f <main+0x4f>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
scalar_t__ kiss();
double dkiss(void) { return ((double)kiss() + 0.5) / 4294967296.0; }


x86 assembly (clang, -O0):
<dkiss>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <kiss@plt>
cvtsi2sd %rax,%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dkiss>:
push   %rax
xor    %eax,%eax
call   1030 <kiss@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dkiss() {
%1 = call i64 (...) @kiss()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fdiv double %3, 0x41F0000000000000
ret double %4
}

LLVM IR (-O2):
define double @dkiss() {
%1 = tail call i64 (...) @kiss()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}
int max3(int x1, int x2, int x3) {
  int m;
  m = x1;
  if (x2 > m)
    m = x2;
  if (x3 > m) {
    return x3;
  } else {
    return m;
  }
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1125 <max3+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    113c <max3+0x3c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <max3+0x42>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
mov    %edi,%eax
cmp    %edi,%esi
cmovg  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
int do_041() { return 41; }


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

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

LLVM IR (-O0):
define i32 @do_041() {
ret i32 41
}

LLVM IR (-O2):
define i32 @do_041() {
ret i32 41
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int16_t a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  printf("PROD = %d\n", a * b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
imul   0xc(%rsp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"PROD = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
void XtCvtIntToFont() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtIntToFont() {
ret void
}
char *langRomTypeZenima80() { return "Zenima 80 in 1"; }


x86 assembly (clang, -O0):
<langRomTypeZenima80>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Zenima 80 in 1\00"
define i8* @langRomTypeZenima80() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"Zenima 80 in 1\00"
define i8* @langRomTypeZenima80() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ glColor4usv(unsigned short *);
void Color4usv(unsigned short v[4]) { glColor4usv(v); }


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

x86 assembly (clang, -O2):
<Color4usv>:
jmp    1030 <glColor4usv@plt>

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

LLVM IR (-O2):
define void @Color4usv(i16* %0) {
%2 = tail call i32 @glColor4usv(i16* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 100;
  printf("I am %d years old.\n", age);
  printf("I am %d centimeters tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [27 x i8] c"I am %d centimeters tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 100, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [27 x i8] c"I am %d centimeters tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  char buk = 'a' + (('z' - 'a') / 2);
  scanf("%c", &c);
  printf("%c\n", buk - c + buk + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x6d,-0x6(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x6(%rbp),%eax
movsbl -0x5(%rbp),%ecx
sub    %ecx,%eax
movsbl -0x6(%rbp),%ecx
add    %ecx,%eax
add    $0x1,%eax
lea    0xea6(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 109, i8* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = add nsw i32 %9, %11
%13 = add nsw i32 %12, 1
%14 = trunc i32 %13 to i8
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
void CreateVertexList(Schema, A) struct frvStruct *Schema;
struct Mark *A;
{
  AssignMarkVertexListFirst(A, 0);
}


x86 assembly (clang, -O0):
<CreateVertexList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <AssignMarkVertexListFirst@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateVertexList>:
mov    %rsi,%rdi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <AssignMarkVertexListFirst@plt>

LLVM IR (-O0):
%struct.frvStruct = type opaque
%struct.Mark = type opaque
define void @CreateVertexList(%struct.frvStruct* %0, %struct.Mark* %1) {
%3 = alloca %struct.frvStruct*
%4 = alloca %struct.Mark*
store %struct.frvStruct* %0, %struct.frvStruct** %3
store %struct.Mark* %1, %struct.Mark** %4
%5 = load %struct.Mark*, %struct.Mark** %4
%6 = call i32 (%struct.Mark*, i32, ...) bitcast (i32 (...)* @AssignMarkVertexListFirst to i32 (%struct.Mark*, i32, ...)*)(%struct.Mark* %5, i32 0)
ret void
}

LLVM IR (-O2):
%struct.frvStruct = type opaque
%struct.Mark = type opaque
define void @CreateVertexList(%struct.frvStruct* nocapture readnone %0, %struct.Mark* %1) {
%3 = tail call i32 (%struct.Mark*, i32, ...) bitcast (i32 (...)* @AssignMarkVertexListFirst to i32 (%struct.Mark*, i32, ...)*)(%struct.Mark* %1, i32 0)
ret void
}
void XFreeModifiermap() {}


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

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

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

LLVM IR (-O2):
define void @XFreeModifiermap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void aes_encrypt_deinit(void *ctx) { memset(ctx, 0, (4 * 4 * 15 + 4)); }


x86 assembly (clang, -O0):
<aes_encrypt_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xf4,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_encrypt_deinit>:
xor    %esi,%esi
mov    $0xf4,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @aes_encrypt_deinit(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 244)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int tmp = 0;
  printf("return value of (tmp = 10) is %d\n", (tmp = 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0xa,-0x14(%rbp)
lea    0xec5(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"return value of (tmp = 10) is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 10, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"return value of (tmp = 10) is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
int setregid(unsigned rgid, unsigned gid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setregid(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_circle(void) { printf("I'm a Circle\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"I'm a Circle\0A\00"
define void @print_circle() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"I'm a Circle\00"
define void @print_circle() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
float Function1Float(float x) { return x + 42.0f; }


x86 assembly (clang, -O0):
<Function1Float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @Function1Float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 4.200000e+01
ret float %4
}

LLVM IR (-O2):
define float @Function1Float(float %0) {
%2 = fadd float %0, 4.200000e+01
ret float %2
}
/* Variables and functions */
int first_bit(unsigned long long);
int next_bit(unsigned long long *b) {
  *b &= *b - 1;
  return first_bit(*b);
}


x86 assembly (clang, -O0):
<next_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
sub    $0x1,%rcx
mov    -0x8(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <first_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_bit>:
mov    (%rdi),%rcx
lea    -0x1(%rcx),%rax
and    %rcx,%rax
mov    %rax,(%rdi)
mov    %rax,%rdi
jmp    1030 <first_bit@plt>

LLVM IR (-O0):
define i32 @next_bit(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = sub i64 %4, 1
%6 = load i64*, i64** %2
%7 = load i64, i64* %6
%8 = and i64 %7, %5
store i64 %8, i64* %6
%9 = load i64*, i64** %2
%10 = load i64, i64* %9
%11 = call i32 @first_bit(i64 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @next_bit(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = add i64 %2, -1
%4 = and i64 %3, %2
store i64 %4, i64* %0
%5 = tail call i32 @first_bit(i64 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ get_start_pos(int *, int *);
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ zombie_racer(int, int);
int main() {
  srand(time(NULL));
  setup_screen();
  int start_x;
  int start_y;
  get_start_pos(&start_x, &start_y);
  zombie_racer(start_x, start_y);
  cleanup_screen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1050 <setup_screen@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1070 <get_start_pos@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1080 <zombie_racer@plt>
mov    $0x0,%al
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1050 <setup_screen@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1070 <get_start_pos@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1080 <zombie_racer@plt>
xor    %eax,%eax
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @setup_screen()
%7 = call i32 @get_start_pos(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @zombie_racer(i32 %8, i32 %9)
%11 = call i32 (...) @cleanup_screen()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @setup_screen()
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = call i32 @get_start_pos(i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @zombie_racer(i32 %9, i32 %10)
%12 = call i32 (...) @cleanup_screen()
ret i32 0
}
/* Type definitions */
struct rlite {
  int dummy;
};

/* Variables and functions */
int rl_multi_string_getrange(struct rlite *, long, unsigned char **, long *,
                             int /*<<< orphan*/, int);
int rl_multi_string_get(struct rlite *db, long number, unsigned char **_data,
                        long *size) {
  return rl_multi_string_getrange(db, number, _data, size, 0, -1);
}


x86 assembly (clang, -O0):
<rl_multi_string_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
mov    $0xffffffff,%r9d
call   1030 <rl_multi_string_getrange@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_multi_string_get>:
xor    %r8d,%r8d
mov    $0xffffffff,%r9d
jmp    1030 <rl_multi_string_getrange@plt>

LLVM IR (-O0):
%struct.rlite = type { i32 }
define i32 @rl_multi_string_get(%struct.rlite* %0, i64 %1, i8** %2, i64* %3) {
%5 = alloca %struct.rlite*
%6 = alloca i64
%7 = alloca i8**
%8 = alloca i64*
store %struct.rlite* %0, %struct.rlite** %5
store i64 %1, i64* %6
store i8** %2, i8*** %7
store i64* %3, i64** %8
%9 = load %struct.rlite*, %struct.rlite** %5
%10 = load i64, i64* %6
%11 = load i8**, i8*** %7
%12 = load i64*, i64** %8
%13 = call i32 @rl_multi_string_getrange(%struct.rlite* %9, i64 %10, i8** %11, i64* %12, i32 0, i32 -1)
ret i32 %13
}

LLVM IR (-O2):
%struct.rlite = type { i32 }
define i32 @rl_multi_string_get(%struct.rlite* %0, i64 %1, i8** %2, i64* %3) {
%5 = tail call i32 @rl_multi_string_getrange(%struct.rlite* %0, i64 %1, i8** %2, i64* %3, i32 0, i32 -1)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void coreio_rewind(FILE *stream) {
  rewind(stream);
  return;
}


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

x86 assembly (clang, -O2):
<coreio_rewind>:
jmp    1030 <rewind@plt>

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

LLVM IR (-O2):
define void @coreio_rewind(i32* nocapture %0) {
%2 = tail call i32 @rewind(i32* %0)
ret void
}
int int_length(int a) {
  int i = 1;
  while ((a /= 10)) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<int_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1133 <int_length+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <int_length+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_length>:
lea    0x9(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x13,%ecx
jb     1145 <int_length+0x45>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <int_length+0x20>
ret

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

LLVM IR (-O2):
define i32 @int_length(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = sdiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i32 %7, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
void foo020(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo020(i32 %0) {
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
void stripReturnChar(char *string) {
  while (string && (string = strstr(string, "\n"))) {
    *string = ' ';
  }
}


x86 assembly (clang, -O0):
<stripReturnChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     114a <stripReturnChar+0x3a>
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115a <stripReturnChar+0x4a>
jmp    1166 <stripReturnChar+0x56>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
jmp    111c <stripReturnChar+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripReturnChar>:
push   %rax
test   %rdi,%rdi
je     1137 <stripReturnChar+0x27>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1137 <stripReturnChar+0x27>
movb   $0x20,(%rax)
mov    %rax,%rdi
jmp    1120 <stripReturnChar+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @stripReturnChar(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @strchr(i8* %0, i32 10)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %4, %3 ]
store i8 32, i8* %7
%8 = tail call i8* @strchr(i8* %7, i32 10)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %6
10: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gui_clear_status_text(int);
void gui_clear_menu(void) {
  gui_clear_status_text(0);
  gui_clear_status_text(1);
  gui_clear_status_text(2);
  gui_clear_status_text(3);
}


x86 assembly (clang, -O0):
<gui_clear_menu>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x1,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x2,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x3,%edi
call   1030 <gui_clear_status_text@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_clear_menu>:
push   %rax
xor    %edi,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x1,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x2,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <gui_clear_status_text@plt>

LLVM IR (-O0):
define void @gui_clear_menu() {
%1 = call i32 @gui_clear_status_text(i32 0)
%2 = call i32 @gui_clear_status_text(i32 1)
%3 = call i32 @gui_clear_status_text(i32 2)
%4 = call i32 @gui_clear_status_text(i32 3)
ret void
}

LLVM IR (-O2):
define void @gui_clear_menu() {
%1 = tail call i32 @gui_clear_status_text(i32 0)
%2 = tail call i32 @gui_clear_status_text(i32 1)
%3 = tail call i32 @gui_clear_status_text(i32 2)
%4 = tail call i32 @gui_clear_status_text(i32 3)
ret void
}
void clear(unsigned char *o, unsigned int n) {
  unsigned int i = 0;
  for (; i < n; i++)
    o[i] = 0;
}


x86 assembly (clang, -O0):
<clear>:
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
jae    1137 <clear+0x37>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clear+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
test   %esi,%esi
je     1122 <clear+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @clear(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %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 ult i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @clear(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}