xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int i;
  printf("abc%n", &i);
  printf("%d\n", i);
  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)
lea    0xed3(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"abc%n\00"
@.str.1 = [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
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"abc%n\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void print_uint16(uint16_t n) { printf("%hu", n); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%hu\00"
define void @print_uint16(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int edsf_canonify(int *, int, int /*<<< orphan*/ *);
int dsf_canonify(int *dsf, int index) {
  return edsf_canonify(dsf, index, NULL);
}


x86 assembly (clang, -O0):
<dsf_canonify>:
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    %eax,%eax
mov    %eax,%edx
call   1030 <edsf_canonify@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dsf_canonify(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 = call i32 @edsf_canonify(i32* %5, i32 %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @dsf_canonify(i32* %0, i32 %1) {
%3 = tail call i32 @edsf_canonify(i32* %0, i32 %1, i32* null)
ret i32 %3
}
/* Type definitions */
struct ip {
  int ip_p;
};

/* Variables and functions */
int get_ip_proto(struct ip *self) { return self->ip_p; }


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

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

LLVM IR (-O0):
%struct.ip = type { i32 }
define i32 @get_ip_proto(%struct.ip* %0) {
%2 = alloca %struct.ip*
store %struct.ip* %0, %struct.ip** %2
%3 = load %struct.ip*, %struct.ip** %2
%4 = getelementptr inbounds %struct.ip, %struct.ip* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.ip = type { i32 }
define i32 @get_ip_proto(%struct.ip* nocapture %0) {
%2 = getelementptr inbounds %struct.ip, %struct.ip* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ cl_int;

/* Variables and functions */
scalar_t__ CL_SUCCESS;
char *clErrorStr(scalar_t__);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void clError(char *s, cl_int err) {
  if (err != CL_SUCCESS) {
    fprintf(stderr, "%s: %s\n", s, clErrorStr(err));
    exit(1);
  }
}


x86 assembly (clang, -O0):
<clError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
je     1191 <clError+0x61>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <clErrorStr@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clError>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
cmp    %rsi,(%rax)
jne    1146 <clError+0x16>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rdi,%rbx
mov    0x2e90(%rip),%rax
mov    (%rax),%ebp
mov    %rsi,%rdi
call   1030 <clErrorStr@plt>
lea    0xe9f(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@CL_SUCCESS = global i64 0
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @clError(i8* %0, i64 %1) {
%3 = load i64, i64* @CL_SUCCESS
%4 = icmp eq i64 %3, %1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i8* @clErrorStr(i64 %1)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret void
}
int signFunction(double input) {
  if (input > 0.0) {
    return 1;
  } else if (input < 0.0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<signFunction>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1127 <signFunction+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1148 <signFunction+0x48>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1141 <signFunction+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <signFunction+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signFunction>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @signFunction(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
int test_imm_12int64_midword_reg(long long val) {
  return ((val >> 16) & (0x12 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_12int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x12,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_12int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 18
%6 = icmp ne i64 %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_12int64_midword_reg(i64 %0) {
%2 = and i64 %0, 1179648
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *tableToStr(void *value) {
  (void)(value);
  return (char *)"DOIT";
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"DOIT\00"
define i8* @tableToStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"DOIT\00"
define i8* @tableToStr(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fib(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Digite um numero qualquer : ");
  scanf("%d", &n);
  fib(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <fib@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Digite um numero qualquer : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fib(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Digite um numero qualquer : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fib(i32 %5)
ret i32 0
}
int char_to_int(char c1, char c2) {
  int x = c1 - '0';
  x = x * 10;
  x = x + c2 - '0';
  return x;
}


x86 assembly (clang, -O0):
<char_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_int>:
lea    (%rdi,%rdi,4),%eax
lea    (%rsi,%rax,2),%eax
add    $0xfffffdf0,%eax
ret

LLVM IR (-O0):
define i32 @char_to_int(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 48
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 10
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = add nsw i32 %11, %13
%15 = sub nsw i32 %14, 48
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @char_to_int(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = mul nsw i32 %3, 10
%5 = sext i8 %1 to i32
%6 = add nsw i32 %4, -528
%7 = add nsw i32 %6, %5
ret i32 %7
}
/* Variables and functions */
double fabs(double);
double amsp_integrate_simpsonRule(double x0, double y0, double x1, double y1,
                                  double x2, double y2) {
  double dx = fabs(x1 - x0);
  return ((1 / 3.) * (y0 + 4 * y1 + y2) * dx);
  x2 = x2;
}


x86 assembly (clang, -O0):
<amsp_integrate_simpsonRule>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movaps 0xedd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xeba(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  0xe9d(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x38(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<amsp_integrate_simpsonRule>:
subsd  %xmm0,%xmm2
andpd  0xef4(%rip),%xmm2
movapd %xmm3,%xmm0
mulsd  0xef8(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm5,%xmm0
mulsd  0xef0(%rip),%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @amsp_integrate_simpsonRule(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%14 = load double, double* %9
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = call double @llvm.fabs.f64(double %16)
store double %17, double* %13
%18 = load double, double* %8
%19 = load double, double* %10
%20 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %19, double %18)
%21 = load double, double* %12
%22 = fadd double %20, %21
%23 = fmul double 0x3FD5555555555555, %22
%24 = load double, double* %13
%25 = fmul double %23, %24
ret double %25
}

LLVM IR (-O2):
define double @amsp_integrate_simpsonRule(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %2, %0
%8 = tail call double @llvm.fabs.f64(double %7)
%9 = tail call double @llvm.fmuladd.f64(double %3, double 4.000000e+00, double %1)
%10 = fadd double %9, %5
%11 = fmul double %10, 0x3FD5555555555555
%12 = fmul double %8, %11
ret double %12
}
void fake_free(void *b) {}


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

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

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

LLVM IR (-O2):
define void @fake_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int exact_square(int number) {
  int counter, checker = 1;
  for (counter = 2; counter < number; counter++) {
    if (number % counter == 0) {
      checker = 0;
      break;
    }
  }
  printf("%d", checker);
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1164 <exact_square+0x54>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1151 <exact_square+0x41>
movl   $0x0,-0xc(%rbp)
jmp    1164 <exact_square+0x54>
jmp    1156 <exact_square+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <exact_square+0x19>
mov    -0xc(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
mov    $0x1,%esi
cmp    $0x3,%edi
jl     1134 <exact_square+0x24>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1132 <exact_square+0x22>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1120 <exact_square+0x10>
jmp    1134 <exact_square+0x24>
xor    %esi,%esi
push   %rax
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @exact_square(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %3, %5, %1
%11 = phi i32 [ 1, %1 ], [ 0, %5 ], [ 1, %3 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CTI0_ERROR_DriverIRQHandler();
__attribute__((weak)) void CTI0_ERROR_IRQHandler(void) {
  CTI0_ERROR_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @CTI0_ERROR_IRQHandler() {
%1 = call i32 (...) @CTI0_ERROR_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @CTI0_ERROR_IRQHandler() {
%1 = tail call i32 (...) @CTI0_ERROR_DriverIRQHandler()
ret void
}
/* Variables and functions */
int mkdir(char *);
int makeDir(char *path) { return mkdir(path); }


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

x86 assembly (clang, -O2):
<makeDir>:
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @makeDir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ myMapLines();
int main(int argc, const char *argv[]) {
  char line[200];
  myMapLines();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <myMapLines@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <myMapLines@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [200 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @myMapLines()
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @myMapLines()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void ASN1_UTCTIME_cmp_time_t(void) {}


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

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

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

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

/* Variables and functions */
int open(char *, int, int /*<<< orphan*/);
int __open(char *name, int flags, mode_t mode) {
  return open(name, flags, mode);
}


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

x86 assembly (clang, -O2):
<__open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @__open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
int _log2(unsigned int n) {
  unsigned int toRet = 0;
  int m = n - 1;
  while (m > 0) {
    m >>= 1;
    toRet++;
  }
  return toRet;
}


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

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

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

LLVM IR (-O2):
define i32 @_log2(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = lshr i32 %5, 1
%8 = add nuw nsw i32 %6, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *xfopen(char *filename, char *mode) {
  FILE *f;
  f = fopen(filename, mode);
  if (!f)
    fatal_error("Can not open a file");
  return f;
}


x86 assembly (clang, -O0):
<xfopen>:
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   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xfopen+0x38>
lea    0xead(%rip),%rdi
call   1030 <fatal_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfopen>:
push   %rbx
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xfopen+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <fatal_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Can not open a file\00"
define i32* @xfopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @fatal_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
@.str = [20 x i8] c"Can not open a file\00"
define noalias i32* @xfopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32* %3
}
void RTPipeWriteBlocking(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ die(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ *fdopen(int, char const *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
FILE *xfdopen(int fd, const char *mode) {
  FILE *stream = fdopen(fd, mode);
  if (stream == NULL)
    die("Out of memory? fdopen failed: %s", strerror(errno));
  return stream;
}


x86 assembly (clang, -O0):
<xfdopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fdopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <xfdopen+0x46>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfdopen>:
push   %rbx
call   1030 <fdopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <xfdopen+0x2a>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Out of memory? fdopen failed: %s\00"
@errno = global i32 0
define i32* @xfdopen(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32* @fdopen(i32 %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = call i32 @strerror(i32 %12)
%14 = call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [33 x i8] c"Out of memory? fdopen failed: %s\00"
@errno = global i32 0
define noalias i32* @xfdopen(i32 %0, i8* nocapture %1) {
%3 = tail call i32* @fdopen(i32 %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ paint_it(char const *, char *);
void yellow(const char *string) { paint_it(string, "\x1b[0;33m"); }


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

x86 assembly (clang, -O2):
<yellow>:
lea    0xee9(%rip),%rsi
jmp    1030 <paint_it@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;33m\00"
define void @yellow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @paint_it(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;33m\00"
define void @yellow(i8* %0) {
%2 = tail call i32 @paint_it(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ gfx_gxm_config_read(int);
unsigned long gu1_get_vid_register_base(void) {
  unsigned long base;
  base = (unsigned long)gfx_gxm_config_read(0xB8);
  base = (base & 0x03) << 30;
  if (base)
    base |= 0x00010000;
  return (base);
}


x86 assembly (clang, -O0):
<gu1_get_vid_register_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb8,%edi
call   1030 <gfx_gxm_config_read@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3,%rax
shl    $0x1e,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <gu1_get_vid_register_base+0x3f>
mov    -0x8(%rbp),%rax
or     $0x10000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu1_get_vid_register_base>:
push   %rax
mov    $0xb8,%edi
call   1030 <gfx_gxm_config_read@plt>
shl    $0x1e,%eax
lea    0x10000(%rax),%rdx
xor    %ecx,%ecx
test   %eax,%eax
cmovne %rdx,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @gu1_get_vid_register_base() {
%1 = alloca i64
%2 = call i64 @gfx_gxm_config_read(i32 184)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = and i64 %3, 3
%5 = shl i64 %4, 30
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i64, i64* %1
%10 = or i64 %9, 65536
store i64 %10, i64* %1
br label %11
11: ; preds = %8, %0
%12 = load i64, i64* %1
ret i64 %12
}

LLVM IR (-O2):
define i64 @gu1_get_vid_register_base() {
%1 = tail call i64 @gfx_gxm_config_read(i32 184)
%2 = shl i64 %1, 30
%3 = and i64 %2, 3221225472
%4 = icmp eq i64 %3, 0
%5 = or i64 %3, 65536
%6 = select i1 %4, i64 0, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ vfunc(char *);
void main(int argc, char **argv) {
  if (argc == 2) {
    vfunc(argv[1]);
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1136 <main+0x26>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <vfunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    111e <main+0xe>
mov    0x8(%rsi),%rdi
jmp    1030 <vfunc@plt>
ret

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

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @vfunc(i8* %6)
br label %8
8: ; preds = %4, %2
ret void
}
char cipher(char c) {
  if (c >= 65 && c <= 90) {
    c = c - 65;
    c = 90 - c;
  } else if (c >= 97 && c <= 122) {
    c = c - 97;
    c = 122 - c;
  }
  return c;
}


x86 assembly (clang, -O0):
<cipher>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1141 <cipher+0x41>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1141 <cipher+0x41>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x5a,%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    1178 <cipher+0x78>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1173 <cipher+0x73>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1173 <cipher+0x73>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    1178 <cipher+0x78>
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cipher>:
lea    -0x41(%rdi),%eax
cmp    $0x19,%al
ja     110d <cipher+0xd>
mov    $0x9b,%al
sub    %dil,%al
ret
lea    -0x61(%rdi),%eax
mov    $0xdb,%cl
sub    %dil,%cl
cmp    $0x1a,%al
movzbl %cl,%ecx
movzbl %dil,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @cipher(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %19
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 65
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = sub nsw i32 90, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %2
br label %37
19: ; preds = %6, %1
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %36
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 122
br i1 %26, label %27, label %36
27: ; preds = %23
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = sub nsw i32 %29, 97
%31 = trunc i32 %30 to i8
store i8 %31, i8* %2
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = sub nsw i32 122, %33
%35 = trunc i32 %34 to i8
store i8 %35, i8* %2
br label %36
36: ; preds = %27, %23, %19
br label %37
37: ; preds = %36, %10
%38 = load i8, i8* %2
ret i8 %38
}

LLVM IR (-O2):
define signext i8 @cipher(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = sub nuw i8 -101, %0
br label %11
6: ; preds = %1
%7 = add i8 %0, -97
%8 = icmp ult i8 %7, 26
%9 = sub i8 -37, %0
%10 = select i1 %8, i8 %9, i8 %0
br label %11
11: ; preds = %6, %4
%12 = phi i8 [ %5, %4 ], [ %10, %6 ]
ret i8 %12
}
/* Variables and functions */
int INT_MAX;
int sub() {
  int dummy = 0, a = 16;
  if (a / INT_MAX / 16 == 0)
    return 0;
  else
    return a / INT_MAX / 16;
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ecc(%rip),%rcx
cltd
idivl  (%rcx)
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    113c <sub+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1154 <sub+0x54>
mov    -0xc(%rbp),%eax
mov    0x2ea2(%rip),%rcx
cltd
idivl  (%rcx)
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
mov    0x2ee1(%rip),%rcx
xor    %esi,%esi
mov    $0x10,%eax
xor    %edx,%edx
idivl  (%rcx)
lea    0xf(%rax),%ecx
mov    %eax,%edx
sar    $0x7,%dl
shr    $0x4,%dl
add    %al,%dl
sar    $0x4,%dl
cmp    $0x1f,%ecx
movsbl %dl,%eax
cmovb  %esi,%eax
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @sub() {
%1 = load i32, i32* @INT_MAX
%2 = sdiv i32 16, %1
%3 = add nsw i32 %2, 15
%4 = icmp ult i32 %3, 31
%5 = trunc i32 %2 to i8
%6 = sdiv i8 %5, 16
%7 = sext i8 %6 to i32
%8 = select i1 %4, i32 0, i32 %7
ret i32 %8
}
/* Type definitions */
struct group {
  int dummy;
};

/* Variables and functions */
struct group *getgrnam(const char *grp) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.group = type { i32 }
define %struct.group* @getgrnam(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.group* null
}

LLVM IR (-O2):
%struct.group = type { i32 }
define noalias %struct.group* @getgrnam(i8* nocapture readnone %0) {
ret %struct.group* null
}
/* Variables and functions */
int /*<<< orphan*/ mergesort(int *, int /*<<< orphan*/, size_t);
void mergesort_wrapper(int a[], size_t n) { mergesort(a, 0, n - 1); }


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

x86 assembly (clang, -O2):
<mergesort_wrapper>:
lea    -0x1(%rsi),%rdx
xor    %esi,%esi
jmp    1030 <mergesort@plt>

LLVM IR (-O0):
define void @mergesort_wrapper(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
%8 = call i32 @mergesort(i32* %5, i32 0, i64 %7)
ret void
}

LLVM IR (-O2):
define void @mergesort_wrapper(i32* %0, i64 %1) {
%3 = add i64 %1, -1
%4 = tail call i32 @mergesort(i32* %0, i32 0, i64 %3)
ret void
}
void XtPending() {}


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

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

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

LLVM IR (-O2):
define void @XtPending() {
ret void
}
/* Variables and functions */
scalar_t__ in_lbx_value_charset(char);
int count_lbx_value_chars(char *s) {
  int i;
  i = 0;
  while (in_lbx_value_charset(s[i])) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<count_lbx_value_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <in_lbx_value_charset@plt>
cmp    $0x0,%rax
je     114c <count_lbx_value_chars+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <count_lbx_value_chars+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_lbx_value_chars>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <in_lbx_value_charset@plt>
add    $0x1,%ebp
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <count_lbx_value_chars+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @count_lbx_value_chars(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i64 @in_lbx_value_charset(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = add nuw i64 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = trunc i64 %3 to i32
ret i32 %10
}
/* Variables and functions */
int nr_iowait_cpu(int /*<<< orphan*/);
int /*<<< orphan*/ smp_processor_id();
int performance_multiplier(void) {
  int mult = 1;
  mult += 10 * nr_iowait_cpu(smp_processor_id());
  return mult;
}


x86 assembly (clang, -O0):
<performance_multiplier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <smp_processor_id@plt>
mov    %eax,%edi
call   1040 <nr_iowait_cpu@plt>
imul   $0xa,%eax,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<performance_multiplier>:
push   %rax
xor    %eax,%eax
call   1030 <smp_processor_id@plt>
mov    %eax,%edi
call   1040 <nr_iowait_cpu@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
or     $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @performance_multiplier() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 (...) @smp_processor_id()
%3 = call i32 @nr_iowait_cpu(i32 %2)
%4 = mul nsw i32 10, %3
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @performance_multiplier() {
%1 = tail call i32 (...) @smp_processor_id()
%2 = tail call i32 @nr_iowait_cpu(i32 %1)
%3 = mul nsw i32 %2, 10
%4 = or i32 %3, 1
ret i32 %4
}
regx0reg1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[x0]) = r1; }


x86 assembly (clang, -O0):
<regx0reg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0reg1_set>:
movslq %edx,%rax
mov    %esi,(%r8,%rax,4)
ret

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

LLVM IR (-O2):
define i32 @regx0reg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
store i32 %1, i32* %8
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ pthread_attr_getdetachstate(int /*<<< orphan*/ const *, int *);
int /*<<< orphan*/ stderr;
void sirius_pthread_attr_getdetachstate(const pthread_attr_t *attr,
                                        int *detachstate) {
  if (pthread_attr_getdetachstate(attr, detachstate)) {
    fprintf(stderr, "pthread_getdetachstate() failed.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<sirius_pthread_attr_getdetachstate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_attr_getdetachstate@plt>
cmp    $0x0,%rax
je     1176 <sirius_pthread_attr_getdetachstate+0x46>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sirius_pthread_attr_getdetachstate>:
push   %rax
call   1050 <pthread_attr_getdetachstate@plt>
test   %rax,%rax
jne    113d <sirius_pthread_attr_getdetachstate+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"pthread_getdetachstate() failed.\0A\00"
define void @sirius_pthread_attr_getdetachstate(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 = call i64 @pthread_attr_getdetachstate(i32* %5, i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"pthread_getdetachstate() failed.\0A\00"
define void @sirius_pthread_attr_getdetachstate(i32* %0, i32* %1) {
%3 = tail call i64 @pthread_attr_getdetachstate(i32* %0, i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  printf("Hello, world");
  system(
      "gphoto2 --capture-image-and-download --filename=testpics/mytestpic.arw");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, world\00"
@.str.1 = [71 x i8] c"gphoto2 --capture-image-and-download --filename=testpics/mytestpic.arw\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, world\00"
@.str.1 = [71 x i8] c"gphoto2 --capture-image-and-download --filename=testpics/mytestpic.arw\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
char getTrit(int x) { return x > 0 ? 1 : (x < 0 ? -1 : 0); }


x86 assembly (clang, -O0):
<getTrit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111e <getTrit+0x1e>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <getTrit+0x31>
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTrit>:
test   %edi,%edi
setne  %al
neg    %al
test   %edi,%edi
movzbl %al,%ecx
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @getTrit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 1, %5 ], [ %10, %6 ]
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @getTrit(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = icmp ne i32 %0, 0
%4 = sext i1 %3 to i8
%5 = select i1 %2, i8 1, i8 %4
ret i8 %5
}