xunge/DecIR huggingface dataset:
int suma(int x, int y) {
  int res;
  res = x + y;
  return res;
}


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

x86 assembly (clang, -O2):
<suma>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @suma(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 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
char *savestring(str, length)
char *str;
unsigned int length;
{
  register char *out = (char *)xmalloc(length + 1);
  if (length > 0)
    bcopy(str, out, length);
  out[length] = '\0';
  return out;
}


x86 assembly (clang, -O0):
<savestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1030 <xmalloc@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    115e <savestring+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1040 <bcopy@plt>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestring>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x1(%rbx),%edi
xor    %eax,%eax
call   1030 <xmalloc@plt>
movslq %eax,%r15
test   %ebx,%ebx
je     114a <savestring+0x2a>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <bcopy@plt>
mov    %ebx,%eax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @savestring(i8* %0, i32 %1) {
%3 = add i32 %1, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %6, i32 %1)
br label %10
10: ; preds = %8, %2
%11 = zext i32 %1 to i64
%12 = getelementptr inbounds i8, i8* %6, i64 %11
store i8 0, i8* %12
ret i8* %6
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
int /*<<< orphan*/ printf(char *, double);
void fprintf_time(int silent, clock_t begin, clock_t end) {
  if (!silent)
    printf("Total time to build rules %f\n",
           (double)(end - begin) / CLOCKS_PER_SEC);
  return;
}


x86 assembly (clang, -O0):
<fprintf_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1151 <fprintf_time+0x41>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2ea7(%rip),%rax
divsd  (%rax),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintf_time>:
test   %edi,%edi
je     1115 <fprintf_time+0x5>
ret
sub    %rsi,%rdx
cvtsi2sd %rdx,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
lea    0xed1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Total time to build rules %f\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @fprintf_time(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %3
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = sub nsw i64 %10, %11
%13 = sitofp i64 %12 to double
%14 = load double, double* @CLOCKS_PER_SEC
%15 = fdiv double %13, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %15)
br label %17
17: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Total time to build rules %f\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @fprintf_time(i32 %0, i64 %1, i64 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = sub nsw i64 %2, %1
%7 = sitofp i64 %6 to double
%8 = load double, double* @CLOCKS_PER_SEC
%9 = fdiv double %7, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %9)
br label %11
11: ; preds = %5, %3
ret void
}
int test_imm_E3int32_mem(int *val) {
  return ((*val) & (0xE3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E3int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 227
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void avcodec_decode_audio4() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_decode_audio4() {
ret void
}
double scale_factor(double z) { return (1.0 / (1.0 + z)); }


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

x86 assembly (clang, -O2):
<scale_factor>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @scale_factor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = fdiv double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @scale_factor(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
int test_imm_79uint8_mem(unsigned char *val) {
  return ((*val) & (-0x79 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_79uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -121
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isdigit(int);
void t_isdigit_0x30() {
  Assert_real((isdigit(48)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              245, ("isdigit should be 1 for 0"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x30>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
call   1030 <isdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xf5,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x30>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xf5,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 0\00"
define void @t_isdigit_0x30() {
%1 = call i32 @isdigit(i32 48)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 0\00"
define void @t_isdigit_0x30() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void phi_initialize() {
  long i, j, z;
  double r;
}


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

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

LLVM IR (-O0):
define void @phi_initialize() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
ret void
}

LLVM IR (-O2):
define void @phi_initialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stopCDDA();
long CDR_stop(void) {
  stopCDDA();
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @CDR_stop() {
%1 = call i32 (...) @stopCDDA()
ret i64 0
}

LLVM IR (-O2):
define i64 @CDR_stop() {
%1 = tail call i32 (...) @stopCDDA()
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ws_free(void *buf) { free(buf); }


x86 assembly (clang, -O0):
<ws_free>:
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):
<ws_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ws_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DisconnectKeyCodes(int);
int /*<<< orphan*/ Keyboard_UpdateControlKey(int /*<<< orphan*/);
void DisconnectKeyCodes2(void) {
  DisconnectKeyCodes((1 << 0) | (1 << 1));
  Keyboard_UpdateControlKey(0);
}


x86 assembly (clang, -O0):
<DisconnectKeyCodes2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <DisconnectKeyCodes@plt>
xor    %edi,%edi
call   1040 <Keyboard_UpdateControlKey@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisconnectKeyCodes2>:
push   %rax
mov    $0x3,%edi
call   1030 <DisconnectKeyCodes@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <Keyboard_UpdateControlKey@plt>

LLVM IR (-O0):
define void @DisconnectKeyCodes2() {
%1 = call i32 @DisconnectKeyCodes(i32 3)
%2 = call i32 @Keyboard_UpdateControlKey(i32 0)
ret void
}

LLVM IR (-O2):
define void @DisconnectKeyCodes2() {
%1 = tail call i32 @DisconnectKeyCodes(i32 3)
%2 = tail call i32 @Keyboard_UpdateControlKey(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ skelframe(int);
int /*<<< orphan*/ usleep(int);
int main(int argc, char const *argv[]) {
  int frame = 0;
  while (true) {
    skelframe(frame);
    printf("%d\n", frame);
    usleep(100000);
    frame++;
    if (frame > 23) {
      frame = 0;
    }
    clear();
  }
  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)
mov    -0x14(%rbp),%edi
call   1030 <skelframe@plt>
mov    -0x14(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    $0x186a0,%edi
call   1060 <usleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x17,-0x14(%rbp)
jle    1198 <main+0x58>
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1050 <clear@plt>
jmp    115d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r15d,%r15d
lea    0xeaf(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <skelframe@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    $0x186a0,%edi
call   1060 <usleep@plt>
lea    0x1(%rbx),%ebp
cmp    $0x17,%ebx
cmovge %r15d,%ebp
xor    %eax,%eax
call   1050 <clear@plt>
mov    %ebp,%ebx
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [4 x i8] c"%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
br label %7
7: ; preds = %2, %18
%8 = load i32, i32* %6
%9 = call i32 @skelframe(i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @usleep(i32 100000)
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp sgt i32 %15, 23
br i1 %16, label %17, label %18
17: ; preds = %7
store i32 0, i32* %6
br label %18
18: ; preds = %17, %7
%19 = call i32 (...) @clear()
br label %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %10, %3 ]
%5 = tail call i32 @skelframe(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%7 = tail call i32 @usleep(i32 100000)
%8 = add nsw i32 %4, 1
%9 = icmp sgt i32 %4, 22
%10 = select i1 %9, i32 0, i32 %8
%11 = tail call i32 (...) @clear()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ __free(void *);
void free(void *ptr) { __free(ptr); }


x86 assembly (clang, -O0):
<free>:
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):
<free>:
jmp    1030 <__free@plt>

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @__free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
int main() { g(3); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @g(i32 3)
ret i32 0
}
/* Variables and functions */
scalar_t__ islower(char);
scalar_t__ isupper(char);
char a_encipher(char text) {
  if (isupper(text)) {
    text = 'A' + 'Z' - text;
  } else if (islower(text)) {
    text = 'a' + 'z' - text;
  }
  return text;
}


x86 assembly (clang, -O0):
<a_encipher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1154 <a_encipher+0x34>
movsbl -0x1(%rbp),%ecx
mov    $0x9b,%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    117a <a_encipher+0x5a>
movsbl -0x1(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1175 <a_encipher+0x55>
movsbl -0x1(%rbp),%ecx
mov    $0xdb,%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    117a <a_encipher+0x5a>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_encipher>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
test   %rax,%rax
je     1133 <a_encipher+0x13>
mov    $0x9b,%al
sub    %bl,%al
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <islower@plt>
mov    $0xdb,%cl
sub    %bl,%cl
test   %rax,%rax
movzbl %cl,%ecx
movzbl %bl,%eax
cmovne %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @a_encipher(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isupper(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 155, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %21
11: ; preds = %1
%12 = load i8, i8* %2
%13 = call i64 @islower(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = sub nsw i32 219, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
br label %20
20: ; preds = %15, %11
br label %21
21: ; preds = %20, %6
%22 = load i8, i8* %2
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @a_encipher(i8 signext %0) {
%2 = tail call i64 @isupper(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = sub i8 -101, %0
br label %11
6: ; preds = %1
%7 = tail call i64 @islower(i8 signext %0)
%8 = icmp eq i64 %7, 0
%9 = sub i8 -37, %0
%10 = select i1 %8, i8 %0, i8 %9
br label %11
11: ; preds = %6, %4
%12 = phi i8 [ %5, %4 ], [ %10, %6 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
void RenderScene(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glFlush();
}


x86 assembly (clang, -O0):
<RenderScene>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RenderScene>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @RenderScene() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @RenderScene() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 (...) @glFlush()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XGraphicsExposeEvent;

/* Variables and functions */
int get_XGraphicsExposeEvent_y(void *_p) {
  return (int)((XGraphicsExposeEvent *)_p)->y;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XGraphicsExposeEvent_y(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_XGraphicsExposeEvent_y(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*/ cblas_dcopy(unsigned int, double *, int, double *,
                               unsigned int);
void NMD_copycol_rmajor(unsigned nrows, double *col, double *restrict mat,
                        unsigned ncols, unsigned cindx) {
  cblas_dcopy(nrows, col, 1, &mat[cindx], ncols);
}


x86 assembly (clang, -O0):
<NMD_copycol_rmajor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%eax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%edx
call   1030 <cblas_dcopy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NMD_copycol_rmajor>:
mov    %ecx,%eax
mov    %r8d,%ecx
lea    (%rdx,%rcx,8),%rcx
mov    $0x1,%edx
mov    %eax,%r8d
jmp    1030 <cblas_dcopy@plt>

LLVM IR (-O0):
define void @NMD_copycol_rmajor(i32 %0, double* %1, double* noalias %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = load i32, i32* %10
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds double, double* %13, i64 %15
%17 = load i32, i32* %9
%18 = call i32 @cblas_dcopy(i32 %11, double* %12, i32 1, double* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @NMD_copycol_rmajor(i32 %0, double* %1, double* noalias %2, i32 %3, i32 %4) {
%6 = zext i32 %4 to i64
%7 = getelementptr inbounds double, double* %2, i64 %6
%8 = tail call i32 @cblas_dcopy(i32 %0, double* %1, i32 1, double* %7, i32 %3)
ret void
}
void clrscr() {
  printf("\33[2J");
  printf("\33[%d;%dH", 0, 0);
}


x86 assembly (clang, -O0):
<clrscr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrscr>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [9 x i8] c"\1B[%d;%dH\00"
define void @clrscr() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [9 x i8] c"\1B[%d;%dH\00"
define void @clrscr() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ output_w32(int);
void emit_fsqrts(int s, int d) {
  assert(s == 31);
  assert(d == 31);
  assem_debug("fsqrts s%d,s%d", d, s);
  output_w32(0x1e21c000 | s << 5 | d);
}


x86 assembly (clang, -O0):
<emit_fsqrts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1f,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x1f,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xe93(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x4(%rbp),%edi
shl    $0x5,%edi
or     $0x1e21c000,%edi
or     -0x8(%rbp),%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fsqrts>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x1f,%ebx
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x1f,%ebp
sete   %dil
call   1050 <assert@plt>
lea    0xea6(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <assem_debug@plt>
shl    $0x5,%ebx
or     %ebp,%ebx
or     $0x1e21c000,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fsqrts s%d,s%d\00"
define void @emit_fsqrts(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 = icmp eq i32 %5, 31
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 31
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* %3
%17 = shl i32 %16, 5
%18 = or i32 505528320, %17
%19 = load i32, i32* %4
%20 = or i32 %18, %19
%21 = call i32 @output_w32(i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fsqrts s%d,s%d\00"
define void @emit_fsqrts(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 31
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %1, 31
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%10 = shl i32 %0, 5
%11 = or i32 %10, %1
%12 = or i32 %11, 505528320
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
unsigned long EPIIntErrorStatus(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x0000021C))));
}


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

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

LLVM IR (-O0):
define i64 @EPIIntErrorStatus(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 540
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @EPIIntErrorStatus(i64 %0) {
%2 = add i64 %0, 540
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
float multiple(float x, float y) { return y * x; }


x86 assembly (clang, -O0):
<multiple>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiple>:
mulss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @multiple(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
void copy_timesig(c1, c2, c3, c4) {
  char data[4];
  data[0] = c1;
  data[1] = c2;
  data[2] = c3;
  data[3] = c4;
  mf_write_meta_event(0x58, data, 4);
}


x86 assembly (clang, -O0):
<copy_timesig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x13(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,-0x11(%rbp)
lea    -0x14(%rbp),%rsi
mov    $0x58,%edi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <mf_write_meta_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_timesig>:
push   %rax
mov    %dil,0x4(%rsp)
mov    %sil,0x5(%rsp)
mov    %dl,0x6(%rsp)
mov    %cl,0x7(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x58,%edi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <mf_write_meta_event@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @copy_timesig(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
store i8 %11, i8* %12
%13 = load i32, i32* %6
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 1
store i8 %14, i8* %15
%16 = load i32, i32* %7
%17 = trunc i32 %16 to i8
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 2
store i8 %17, i8* %18
%19 = load i32, i32* %8
%20 = trunc i32 %19 to i8
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 3
store i8 %20, i8* %21
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%23 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @mf_write_meta_event to i32 (i32, i8*, i32, ...)*)(i32 88, i8* %22, i32 4)
ret void
}

LLVM IR (-O2):
define void @copy_timesig(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [4 x i8]
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%7 = trunc i32 %0 to i8
store i8 %7, i8* %6
%8 = trunc i32 %1 to i8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %8, i8* %9
%10 = trunc i32 %2 to i8
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %3 to i8
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
store i8 %12, i8* %13
%14 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @mf_write_meta_event to i32 (i32, i8*, i32, ...)*)(i32 88, i8* %6, i32 4)
ret void
}
int checkname(char *name) {
  int result = 1;
  if ((name[0] != 'l') || (name[1] != 'o') || (name[2] != 's') ||
      (name[3] != 't') || (name[4] != '+'))
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<checkname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6c,%eax
jne    1163 <checkname+0x63>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6f,%eax
jne    1163 <checkname+0x63>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x73,%eax
jne    1163 <checkname+0x63>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x74,%eax
jne    1163 <checkname+0x63>
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x2b,%eax
je     116a <checkname+0x6a>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkname>:
cmpb   $0x6c,(%rdi)
jne    1122 <checkname+0x22>
cmpb   $0x6f,0x1(%rdi)
jne    1122 <checkname+0x22>
cmpb   $0x73,0x2(%rdi)
jne    1122 <checkname+0x22>
cmpb   $0x74,0x3(%rdi)
jne    1122 <checkname+0x22>
mov    $0x1,%eax
cmpb   $0x2b,0x4(%rdi)
je     1124 <checkname+0x24>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @checkname(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 108
br i1 %8, label %33, label %9
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 111
br i1 %14, label %33, label %15
15: ; preds = %9
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 115
br i1 %20, label %33, label %21
21: ; preds = %15
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 116
br i1 %26, label %33, label %27
27: ; preds = %21
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i64 4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 43
br i1 %32, label %33, label %34
33: ; preds = %27, %21, %15, %9, %1
store i32 0, i32* %3
br label %34
34: ; preds = %33, %27
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @checkname(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 108
br i1 %3, label %4, label %20
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 111
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 115
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 116
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %0, i64 4
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 43
br i1 %19, label %21, label %20
20: ; preds = %16, %12, %8, %4, %1
br label %21
21: ; preds = %20, %16
%22 = phi i32 [ 0, %20 ], [ 1, %16 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Que a forca esteja conosco!!!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Que a forca esteja conosco!!!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"Que a forca esteja conosco!!!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ remove_entry(void *, char *, int);
void safe_free_internal(void *ptr, char *file, int line) {
  remove_entry(ptr, file, line);
  free(ptr);
}


x86 assembly (clang, -O0):
<safe_free_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <remove_entry@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_free_internal>:
push   %rbx
mov    %rdi,%rbx
call   1040 <remove_entry@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @safe_free_internal(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @remove_entry(i8* %0, i8* %1, i32 %2)
%5 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          void *(*)(void *), void *);
pthread_t create_thread(void *(*func)(void *), void *arg) {
  pthread_t id;
  if (pthread_create(&id, NULL, func, arg) != 0) {
    perror("pthread_create");
    exit(-1);
  }
  return id;
}


x86 assembly (clang, -O0):
<create_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_create@plt>
cmp    $0x0,%rax
je     1175 <create_thread+0x45>
lea    0xe9a(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_thread>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <pthread_create@plt>
test   %rax,%rax
jne    114e <create_thread+0x1e>
mov    0x4(%rsp),%eax
pop    %rcx
ret
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"pthread_create\00"
define i32 @create_thread(i8* (i8*)* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @pthread_create(i32* %3, i32* null, i8* (i8*)* %0, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
%11 = load i32, i32* %3
ret i32 %11
}
/* Variables and functions */
test_nodecl() { return sizeof(long[h()]); }


x86 assembly (clang, -O0):
<test_nodecl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <h@plt>
mov    %eax,%eax
shl    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nodecl>:
push   %rax
xor    %eax,%eax
call   1030 <h@plt>
shl    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_nodecl() {
%1 = call i32 (...) @h()
%2 = zext i32 %1 to i64
%3 = mul nuw i64 8, %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_nodecl() {
%1 = tail call i32 (...) @h()
%2 = shl i32 %1, 3
ret i32 %2
}
/* Variables and functions */
char *mp_store_u8(char *, int);
char *mp_encode_nil(char *data) { return mp_store_u8(data, 0xc0); }


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

x86 assembly (clang, -O2):
<mp_encode_nil>:
mov    $0xc0,%esi
jmp    1030 <mp_store_u8@plt>

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

LLVM IR (-O2):
define i8* @mp_encode_nil(i8* %0) {
%2 = tail call i8* @mp_store_u8(i8* %0, i32 192)
ret i8* %2
}
long func2(int *ptr, int *is_zero) {
  int reg = *ptr;
  long value = ((long)reg) << 4;
  if (!value)
    *is_zero = 1;
  return value;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1136 <func2+0x36>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
movslq (%rdi),%rax
test   %rax,%rax
je     110d <func2+0xd>
shl    $0x4,%rax
ret
movl   $0x1,(%rsi)
shl    $0x4,%rax
ret

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

LLVM IR (-O2):
define i64 @func2(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 1, i32* %1
br label %6
6: ; preds = %5, %2
%7 = sext i32 %3 to i64
%8 = shl nsw i64 %7, 4
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ getnums();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("\n\n[+] Parsing 1000-digit number..\n");
  printf("\n[*] Largest product found: %ld\n", getnums());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getnums@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0A\0A[+] Parsing 1000-digit number..\0A\00"
@.str.1 = [33 x i8] c"\0A[*] Largest product found: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getnums()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"\0A[*] Largest product found: %ld\0A\00"
@str = [34 x i8] c"\0A\0A[+] Parsing 1000-digit number..\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getnums()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
double iterate(double x_n) {
  if (x_n < 0.7)
    return (x_n / 0.7);
  else
    return ((10.0 / 3.0) * (1.0 - x_n));
}


x86 assembly (clang, -O0):
<iterate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1137 <iterate+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <iterate+0x55>
movsd  0xed1(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xebc(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<iterate>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1117 <iterate+0x17>
divsd  0xeea(%rip),%xmm0
ret
movsd  0xee9(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xee5(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @iterate(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0x3FE6666666666666
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fdiv double %7, 0x3FE6666666666666
store double %8, double* %2
br label %13
9: ; preds = %1
%10 = load double, double* %3
%11 = fsub double 1.000000e+00, %10
%12 = fmul double 0x400AAAAAAAAAAAAB, %11
store double %12, double* %2
br label %13
13: ; preds = %9, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @iterate(double %0) {
%2 = fcmp olt double %0, 0x3FE6666666666666
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fdiv double %0, 0x3FE6666666666666
br label %8
5: ; preds = %1
%6 = fsub double 1.000000e+00, %0
%7 = fmul double %6, 0x400AAAAAAAAAAAAB
br label %8
8: ; preds = %5, %3
%9 = phi double [ %4, %3 ], [ %7, %5 ]
ret double %9
}
int associatedConnectivity(int connectivity) {
  switch (connectivity) {
  case 1:
    return 2;
    break;
  case 2:
    return 1;
    break;
  case 3:
    return 4;
    break;
  case 4:
    return 3;
    break;
  default:
    return 2;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<associatedConnectivity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1160 <associatedConnectivity+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x4(%rbp)
jmp    1167 <associatedConnectivity+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1167 <associatedConnectivity+0x67>
movl   $0x4,-0x4(%rbp)
jmp    1167 <associatedConnectivity+0x67>
movl   $0x3,-0x4(%rbp)
jmp    1167 <associatedConnectivity+0x67>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<associatedConnectivity>:
add    $0xfffffffe,%edi
mov    $0x2,%eax
cmp    $0x2,%edi
ja     111a <associatedConnectivity+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.associatedConnectivity = [3 x i32] [i32 1, i32 4, i32 3]
define i32 @associatedConnectivity(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.associatedConnectivity, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 2, %1 ], [ %7, %4 ]
ret i32 %9
}
OP(ed, dd) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myFunc1(void) {
  printf("entering myFunc1\n");
  printf("exiting myFunc1\n");
}


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

x86 assembly (clang, -O2):
<myFunc1>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"entering myFunc1\0A\00"
@.str.1 = [17 x i8] c"exiting myFunc1\0A\00"
define void @myFunc1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"entering myFunc1\00"
@str.2 = [16 x i8] c"exiting myFunc1\00"
define void @myFunc1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret void
}