xunge/DecIR huggingface dataset:
push_min(int *min, int v, int *top2) { *(min++ + (*top2)) = v; }


x86 assembly (clang, -O0):
<push_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_min>:
movslq (%rdx),%rax
mov    %esi,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define i32 @push_min(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %5
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %9, i64 %13
store i32 %8, i32* %14
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
define i32 @push_min(i32* nocapture writeonly %0, i32 %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %1, i32* %6
ret i32 undef
}
unsigned int ldata_high(unsigned long long ldata) { return ldata >> 32; }


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

x86 assembly (clang, -O2):
<ldata_high>:
mov    %rdi,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i32 @ldata_high(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ldata_high(i64 %0) {
%2 = lshr i64 %0, 32
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Output_Init();
void Output_On(void) { Output_Init(); }


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

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

LLVM IR (-O0):
define void @Output_On() {
%1 = call i32 (...) @Output_Init()
ret void
}

LLVM IR (-O2):
define void @Output_On() {
%1 = tail call i32 (...) @Output_Init()
ret void
}
/* Variables and functions */
double abs(double x) {
  if (x < 0)
    return (x - x) - (x);
  else
    return x;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1130 <abs+0x30>
movsd  -0x10(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113a <abs+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
movapd %xmm0,%xmm2
subsd  %xmm0,%xmm2
subsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fsub double %0, %0
%4 = fsub double %3, %0
%5 = select i1 %2, double %4, double %0
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char const *, void *, size_t);
ssize_t lgetxattr(const char *path, const char *name, void *value,
                  size_t size) {
  return syscall(230, path, name, value, size);
}


x86 assembly (clang, -O0):
<lgetxattr>:
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),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0xe6,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgetxattr>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xe6,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @lgetxattr(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @syscall(i32 230, i8* %0, i8* %1, i8* %2, i64 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ X509V3_CTX;
typedef int /*<<< orphan*/ CONF;
typedef int /*<<< orphan*/ ASN1_TYPE;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_generate_v3(char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509V3_set_nconf(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf) {
  X509V3_CTX cnf;
  if (!nconf)
    return ASN1_generate_v3(str, NULL);
  X509V3_set_nconf(&cnf, nconf);
  return ASN1_generate_v3(str, &cnf);
}


x86 assembly (clang, -O0):
<ASN1_generate_nconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <ASN1_generate_nconf+0x31>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <ASN1_generate_v3@plt>
mov    %rax,-0x8(%rbp)
jmp    116f <ASN1_generate_nconf+0x4f>
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdi
call   1030 <X509V3_set_nconf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <ASN1_generate_v3@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_generate_nconf>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rsi,%rsi
je     114c <ASN1_generate_nconf+0x2c>
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <X509V3_set_nconf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ASN1_generate_v3@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
xor    %esi,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ASN1_generate_v3@plt>

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

LLVM IR (-O2):
define i32* @ASN1_generate_nconf(i8* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32* %1, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32* @ASN1_generate_v3(i8* %0, i32* null)
br label %11
8: ; preds = %2
%9 = call i32 @X509V3_set_nconf(i32* %3, i32* %1)
%10 = call i32* @ASN1_generate_v3(i8* %0, i32* %3)
br label %11
11: ; preds = %8, %6
%12 = phi i32* [ %10, %8 ], [ %7, %6 ]
ret i32* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int bar(char *a) {
  printf("%s", a);
  return 1;
}


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

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @bar(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_12619() {
  Assert_real((isqrt(12619) == 112),
              "/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/stdlib/isqrt.c",
              1545, ("Integer square root of 12619 should be 112"));
}


x86 assembly (clang, -O0):
<t_sqrt_12619>:
push   %rbp
mov    %rsp,%rbp
mov    $0x314b,%edi
call   1030 <isqrt@plt>
cmp    $0x70,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x609,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_12619>:
push   %rax
mov    $0x314b,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x70,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x609,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 12619 should be 112\00"
define void @t_sqrt_12619() {
%1 = call i32 @isqrt(i32 12619)
%2 = icmp eq i32 %1, 112
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1545, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 12619 should be 112\00"
define void @t_sqrt_12619() {
%1 = tail call i32 @isqrt(i32 12619)
%2 = icmp eq i32 %1, 112
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1545, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t getblock64(const uint64_t *p, int i) {
  return p[i];
}


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

x86 assembly (clang, -O2):
<getblock64>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @getblock64(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int dump_stack(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dump_stack() {
ret i32 0
}
int isspace(int c) {
  return c == '\n' || c == ' ' || c == '\t' || c == '\v' || c == '\f' ||
         c == '\r';
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x4,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 32
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 9
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 11
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 12
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 13
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 12, label %5
i32 11, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int fstat(int, struct stat *);
int _dl_fstat(int fd, struct stat *buf) { return fstat(fd, buf); }


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

x86 assembly (clang, -O2):
<_dl_fstat>:
jmp    1030 <fstat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_dl_fstat(i32 %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @fstat(i32 %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void smallAdjustmentGT(unsigned a) {
  char *b = ((void *)0);
  if (a + 2 > 1)
    b = malloc(1);
  if (a == (0x7fffffff * 2U + 1U) - 1 || a == (0x7fffffff * 2U + 1U))
    return;
  else if (a < (0x7fffffff * 2U + 1U) - 1)
    free(b);
  return;
}


x86 assembly (clang, -O0):
<smallAdjustmentGT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    $0x1,%eax
jbe    1150 <smallAdjustmentGT+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0xfffffffe,-0x4(%rbp)
je     1164 <smallAdjustmentGT+0x44>
cmpl   $0xffffffff,-0x4(%rbp)
jne    1169 <smallAdjustmentGT+0x49>
jmp    1186 <smallAdjustmentGT+0x66>
cmpl   $0xfffffffe,-0x4(%rbp)
jae    117c <smallAdjustmentGT+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1181 <smallAdjustmentGT+0x61>
jmp    1186 <smallAdjustmentGT+0x66>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallAdjustmentGT>:
cmp    $0xfffffffd,%edi
ja     1139 <smallAdjustmentGT+0x19>
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @smallAdjustmentGT(i32 %0) {
%2 = icmp ult i32 %0, -2
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_af(int);
int /*<<< orphan*/ set_cf(int);
void set_ca(void) {
  set_cf(1);
  set_af(1);
}


x86 assembly (clang, -O0):
<set_ca>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <set_cf@plt>
mov    $0x1,%edi
call   1040 <set_af@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ca>:
push   %rax
mov    $0x1,%edi
call   1030 <set_cf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <set_af@plt>

LLVM IR (-O0):
define void @set_ca() {
%1 = call i32 @set_cf(i32 1)
%2 = call i32 @set_af(i32 1)
ret void
}

LLVM IR (-O2):
define void @set_ca() {
%1 = tail call i32 @set_cf(i32 1)
%2 = tail call i32 @set_af(i32 1)
ret void
}
int g3(int a, int b) { return a != b; }


x86 assembly (clang, -O0):
<g3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g3>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @g3(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int f(int a, int b) { return ~a ^ ~b; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ isdigit(char const);
long atol(const char *str) {
  long n = 0;
  while (isdigit(*str)) {
    n = (n * 10) + *str - '0';
    str++;
  }
  return n;
}


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1163 <atol+0x53>
imul   $0xa,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <atol+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1154 <atol+0x44>
add    $0x1,%rbx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    (%r14,%r14,4),%rax
movsbq -0x1(%rbx),%rcx
lea    (%rcx,%rax,2),%r14
add    $0xffffffffffffffd0,%r14
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <atol+0x20>
jmp    1157 <atol+0x47>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isdigit(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %12, %5 ], [ 0, %1 ]
%7 = phi i8* [ %13, %5 ], [ %0, %1 ]
%8 = mul nsw i64 %6, 10
%9 = load i8, i8* %7
%10 = sext i8 %9 to i64
%11 = add i64 %8, -48
%12 = add i64 %11, %10
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = tail call i64 @isdigit(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i64 [ 0, %1 ], [ %12, %5 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ inicializar();
int menu();
int /*<<< orphan*/ resultado();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ votar();
void main() {
  int menuSelect;
  inicializar();
  do {
    system("cls");
    menuSelect = menu();
    switch (menuSelect) {
    case 1:
      votar();
      break;
    case 2:
      resultado();
      break;
    }
  } while (menuSelect != 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <inicializar@plt>
lea    0xe9a(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
call   1030 <menu@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     119a <main+0x4a>
jmp    1189 <main+0x39>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     11a6 <main+0x56>
jmp    11ad <main+0x5d>
mov    $0x0,%al
call   1070 <votar@plt>
jmp    11ad <main+0x5d>
mov    $0x0,%al
call   1040 <resultado@plt>
jmp    11b2 <main+0x62>
cmpl   $0x3,-0x4(%rbp)
jne    115f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <inicializar@plt>
lea    0xea1(%rip),%rbx
jmp    1177 <main+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <resultado@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
xor    %eax,%eax
call   1030 <menu@plt>
cmp    $0x1,%eax
je     11a0 <main+0x50>
cmp    $0x2,%eax
je     1170 <main+0x20>
cmp    $0x3,%eax
jne    1177 <main+0x27>
jmp    11a9 <main+0x59>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <votar@plt>
jmp    1177 <main+0x27>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @inicializar()
br label %3
3: ; preds = %12, %0
%4 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @menu()
store i32 %5, i32* %1
%6 = load i32, i32* %1
switch i32 %6, label %11 [
i32 1, label %7
i32 2, label %9
]
7: ; preds = %3
%8 = call i32 (...) @votar()
br label %11
9: ; preds = %3
%10 = call i32 (...) @resultado()
br label %11
11: ; preds = %3, %9, %7
br label %12
12: ; preds = %11
%13 = load i32, i32* %1
%14 = icmp ne i32 %13, 3
br i1 %14, label %3, label %15
15: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
define void @main() {
%1 = tail call i32 (...) @inicializar()
br label %2
2: ; preds = %9, %0
%3 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @menu()
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %7
i32 3, label %10
]
5: ; preds = %2
%6 = tail call i32 (...) @votar()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @resultado()
br label %9
9: ; preds = %7, %5, %2
br label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
scalar_t__ findLastSet(size_t);
scalar_t__ multipleBits(size_t);
unsigned int log2Envelope(size_t val) {
  if (!val)
    return 0;
  unsigned int lastSet = (unsigned int)findLastSet(val);
  return multipleBits(val) ? lastSet + 1 : lastSet;
}


x86 assembly (clang, -O0):
<log2Envelope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <log2Envelope+0x23>
movl   $0x0,-0x4(%rbp)
jmp    117c <log2Envelope+0x5c>
mov    -0x10(%rbp),%rdi
call   1040 <findLastSet@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <multipleBits@plt>
cmp    $0x0,%rax
je     1170 <log2Envelope+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1176 <log2Envelope+0x56>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2Envelope>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1146 <log2Envelope+0x26>
mov    %rdi,%rbx
call   1040 <findLastSet@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <multipleBits@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r14d
jmp    1149 <log2Envelope+0x29>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @log2Envelope(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %22
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i64 @findLastSet(i64 %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %4
%12 = load i64, i64* %3
%13 = call i64 @multipleBits(i64 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %8
%16 = load i32, i32* %4
%17 = add i32 %16, 1
br label %20
18: ; preds = %8
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %15
%21 = phi i32 [ %17, %15 ], [ %19, %18 ]
store i32 %21, i32* %2
br label %22
22: ; preds = %20, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @log2Envelope(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @findLastSet(i64 %0)
%5 = trunc i64 %4 to i32
%6 = tail call i64 @multipleBits(i64 %0)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
%9 = add i32 %8, %5
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %9, %3 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ e_sta();
int /*<<< orphan*/ e_writeback();
int /*<<< orphan*/ e_zp();
void e_sta_zp() {
  e_zp();
  e_sta();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_sta_zp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <e_zp@plt>
mov    $0x0,%al
call   1050 <e_sta@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_sta_zp>:
push   %rax
xor    %eax,%eax
call   1040 <e_zp@plt>
xor    %eax,%eax
call   1050 <e_sta@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_sta_zp() {
%1 = call i32 (...) @e_zp()
%2 = call i32 (...) @e_sta()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_sta_zp() {
%1 = tail call i32 (...) @e_zp()
%2 = tail call i32 (...) @e_sta()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memtr_init();
int /*<<< orphan*/ memtr_print(char *, size_t, void *);
void *orig_malloc(size_t);
void *malloc(size_t size) {
  void *p;
  memtr_init();
  memtr_print("m<", size, 0);
  p = orig_malloc(size);
  memtr_print("m>", size, p);
  return p;
}


x86 assembly (clang, -O0):
<malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <memtr_init@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <memtr_print@plt>
mov    -0x8(%rbp),%rdi
call   1050 <orig_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe90(%rip),%rdi
call   1030 <memtr_print@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <memtr_init@plt>
lea    0xebb(%rip),%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <memtr_print@plt>
mov    %r14,%rdi
call   1050 <orig_malloc@plt>
mov    %rax,%rbx
lea    0xea2(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <memtr_print@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"m<\00"
@.str.1 = [3 x i8] c"m>\00"
define i8* @malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = call i32 (...) @memtr_init()
%5 = load i64, i64* %2
%6 = call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %5, i8* null)
%7 = load i64, i64* %2
%8 = call i8* @orig_malloc(i64 %7)
store i8* %8, i8** %3
%9 = load i64, i64* %2
%10 = load i8*, i8** %3
%11 = call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"m<\00"
@.str.1 = [3 x i8] c"m>\00"
define i8* @malloc(i64 %0) {
%2 = tail call i32 (...) @memtr_init()
%3 = tail call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %0, i8* null)
%4 = tail call i8* @orig_malloc(i64 %0)
%5 = tail call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 %0, i8* %4)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void closeFile(FILE *fp1) { fclose(fp1); }


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

x86 assembly (clang, -O2):
<closeFile>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @closeFile(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
scalar_t__ islower(int);
scalar_t__ isupper(int);
int isalnum(int c) { return isdigit(c) || isupper(c) || islower(c); }


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1181 <isalnum+0x51>
mov    -0x4(%rbp),%edi
call   1050 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1181 <isalnum+0x51>
mov    -0x4(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <isdigit@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115f <isalnum+0x2f>
mov    %ebp,%edi
call   1050 <isupper@plt>
test   %rax,%rax
jne    115f <isalnum+0x2f>
mov    %ebp,%edi
call   1040 <islower@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isupper(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i64 @islower(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @isupper(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @islower(i32 %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double realtime() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec + 1e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<realtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @realtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %7, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @realtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void wi32(uint8_t a[4], uint32_t x) {
  a[0] = x >> 0;
  a[1] = x >> 8;
  a[2] = x >> 16;
  a[3] = x >> 24;
}


x86 assembly (clang, -O0):
<wi32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wi32>:
mov    %esi,(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x8(%rdi)
sar    $0x18,%esi
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @wi32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 0
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 16
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 24
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 3
store i32 %18, i32* %20
ret void
}

LLVM IR (-O2):
define void @wi32(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = ashr i32 %1, 16
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
%7 = ashr i32 %1, 24
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pulseMilli(int, int, int);
void pulseMilliRatio(int gpio, int width, float ratio) {
  int up = ratio * width;
  int down = width - up;
  pulseMilli(gpio, up, down);
}


x86 assembly (clang, -O0):
<pulseMilliRatio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <pulseMilli@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pulseMilliRatio>:
mov    %esi,%edx
cvtsi2ss %esi,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%esi
sub    %esi,%edx
jmp    1030 <pulseMilli@plt>

LLVM IR (-O0):
define void @pulseMilliRatio(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%9 = load float, float* %6
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to float
%12 = fmul float %9, %11
%13 = fptosi float %12 to i32
store i32 %13, i32* %7
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %8
%17 = load i32, i32* %4
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = call i32 @pulseMilli(i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @pulseMilliRatio(i32 %0, i32 %1, float %2) {
%4 = sitofp i32 %1 to float
%5 = fmul float %4, %2
%6 = fptosi float %5 to i32
%7 = sub nsw i32 %1, %6
%8 = tail call i32 @pulseMilli(i32 %0, i32 %6, i32 %7)
ret void
}
/* Type definitions */
struct dnaSeq {
  int dummy;
};

/* Variables and functions */
struct dnaSeq *faReadAllSeqMixable(char *, int, int /*<<< orphan*/);
struct dnaSeq *faReadAllSeq(char *fileName, int isDna) {
  return faReadAllSeqMixable(fileName, isDna, 0);
}


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

x86 assembly (clang, -O2):
<faReadAllSeq>:
xor    %edx,%edx
jmp    1030 <faReadAllSeqMixable@plt>

LLVM IR (-O0):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faReadAllSeq(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call %struct.dnaSeq* @faReadAllSeqMixable(i8* %5, i32 %6, i32 0)
ret %struct.dnaSeq* %7
}

LLVM IR (-O2):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faReadAllSeq(i8* %0, i32 %1) {
%3 = tail call %struct.dnaSeq* @faReadAllSeqMixable(i8* %0, i32 %1, i32 0)
ret %struct.dnaSeq* %3
}
/* Variables and functions */
char *delspc(char const *);
int has_argument(const char **p) {
  const char *q = delspc(*p);
  return (*q == ',');
}


x86 assembly (clang, -O0):
<has_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <delspc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_argument>:
push   %rax
mov    (%rdi),%rdi
call   1030 <delspc@plt>
xor    %ecx,%ecx
cmpb   $0x2c,(%rax)
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @has_argument(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call i8* @delspc(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 44
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @has_argument(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @delspc(i8* %2)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 44
%6 = zext i1 %5 to i32
ret i32 %6
}
int leapYear(int year) {
  int leapYear = 0;
  if ((year % 400 == 0) || (year % 4 == 0 && year % 100 > 0)) {
    leapYear = 1;
  } else {
    leapYear = 0;
  }
  return leapYear;
}


x86 assembly (clang, -O0):
<leapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114a <leapYear+0x4a>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1156 <leapYear+0x56>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jle    1156 <leapYear+0x56>
movl   $0x1,-0x8(%rbp)
jmp    115d <leapYear+0x5d>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapYear>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     1143 <leapYear+0x43>
test   $0x3,%dil
sete   %al
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%edi
test   %edi,%edi
setg   %cl
and    %al,%cl
movzbl %cl,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @leapYear(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 0
%7 = srem i32 %0, 100
%8 = icmp sgt i32 %7, 0
%9 = and i1 %6, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %10, %4 ]
ret i32 %12
}
int test_fun(int x, int y) {
  int c = 0;
  while ((x > 1) && (x < y)) {
    x = x * x;
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jle    112c <test_fun+0x2c>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113c <test_fun+0x3c>
jmp    1154 <test_fun+0x54>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_fun+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111f <test_fun+0x1f>
cmp    %esi,%edi
jge    111f <test_fun+0x1f>
xor    %eax,%eax
nopl   (%rax)
imul   %edi,%edi
add    $0x1,%eax
cmp    $0x2,%edi
jb     111f <test_fun+0x1f>
cmp    %esi,%edi
jl     1110 <test_fun+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 1
%4 = icmp slt i32 %0, %1
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ 0, %2 ]
%8 = phi i32 [ %9, %6 ], [ %0, %2 ]
%9 = mul nsw i32 %8, %8
%10 = add nuw nsw i32 %7, 1
%11 = icmp ugt i32 %9, 1
%12 = icmp slt i32 %9, %1
%13 = and i1 %11, %12
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int Loopr_print_wcs(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int Loopr_print_wcs_ln(FILE *fp, wchar_t *str) {
  int result;
  result = Loopr_print_wcs(fp, str);
  fprintf(fp, "\n");
  return result;
}


x86 assembly (clang, -O0):
<Loopr_print_wcs_ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Loopr_print_wcs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Loopr_print_wcs_ln>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <Loopr_print_wcs@plt>
mov    %eax,%ebp
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @Loopr_print_wcs_ln(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 = call i32 @Loopr_print_wcs(i32* %6, i32* %7)
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @Loopr_print_wcs_ln(i32* %0, i32* %1) {
%3 = tail call i32 @Loopr_print_wcs(i32* %0, i32* %1)
%4 = tail call i32 @fputc(i32 10, i32* %0)
ret i32 %3
}