xunge/DecIR huggingface dataset:
/* Variables and functions */
char *categoria(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int idd;
  printf("Informe a idade do nadador: ");
  scanf("%d", &idd);
  printf("%s\n", categoria(idd));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <categoria@plt>
mov    %rax,%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"Informe a idade do nadador: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* 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* %2)
%5 = load i32, i32* %2
%6 = call i8* @categoria(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Informe a idade do nadador: \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 (i8*, ...) @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 i8* @categoria(i32 %5)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UART9BitEnable(unsigned long ulBase) {
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x000000A4))) |= 0x00008000;
}


x86 assembly (clang, -O0):
<UART9BitEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xa4(%rax),%rcx
or     $0x8000,%rcx
mov    %rcx,0xa4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitEnable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
orq    $0x8000,0xa4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @UART9BitEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 164
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, 32768
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @UART9BitEnable(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 164
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 32768
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isodigit(int c) { return (c != '8') && (c != '9') && (isdigit(c)); }


x86 assembly (clang, -O0):
<isodigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x38,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114b <isodigit+0x3b>
xor    %eax,%eax
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114b <isodigit+0x3b>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@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):
<isodigit>:
mov    %edi,%ecx
and    $0xfffffffe,%ecx
xor    %eax,%eax
cmp    $0x38,%ecx
je     1131 <isodigit+0x21>
push   %rax
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @isodigit(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 56
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int av_deactivate(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @av_deactivate() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AssertFailure(char *, int);
unsigned long SysCtlADCSpeedGet(void) {
  {
    if (!((*((volatile unsigned long *)(0x400FE010))) & 0x00010000)) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c",
          1953);
    }
  };
  return ((*((volatile unsigned long *)(0x400FE100))) & 0x00000F00);
}


x86 assembly (clang, -O0):
<SysCtlADCSpeedGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe010,%eax
mov    (%rax),%rax
and    $0x10000,%rax
cmp    $0x0,%rax
jne    113d <SysCtlADCSpeedGet+0x2d>
lea    0xecd(%rip),%rdi
mov    $0x7a1,%esi
call   1030 <AssertFailure@plt>
mov    $0x400fe100,%eax
mov    (%rax),%rax
and    $0xf00,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlADCSpeedGet>:
push   %rax
testq  $0x10000,0x400fe010
jne    1130 <SysCtlADCSpeedGet+0x20>
lea    0xeda(%rip),%rdi
mov    $0x7a1,%esi
call   1030 <AssertFailure@plt>
mov    0x400fe100,%rax
40
and    $0xf00,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c\00"
define i64 @SysCtlADCSpeedGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782224 to i64*)
%2 = and i64 %1, 65536
%3 = icmp ne i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1953)
br label %6
6: ; preds = %4, %0
%7 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%8 = and i64 %7, 3840
ret i64 %8
}

LLVM IR (-O2):
@.str = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c\00"
define i64 @SysCtlADCSpeedGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782224 to i64*)
%2 = and i64 %1, 65536
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1953)
br label %6
6: ; preds = %4, %0
%7 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%8 = and i64 %7, 3840
ret i64 %8
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void fastcgi_version(int32_t *version_major, int32_t *version_minor,
                     int32_t *version_patch) {
  if (version_major != 0) {
    *version_major = 0;
  }
  if (version_minor != 0) {
    *version_minor = 1;
  }
  if (version_patch != 0) {
    *version_patch = 0;
  }
}


x86 assembly (clang, -O0):
<fastcgi_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <fastcgi_version+0x25>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113a <fastcgi_version+0x3a>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     114f <fastcgi_version+0x4f>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastcgi_version>:
test   %rdi,%rdi
je     110b <fastcgi_version+0xb>
movl   $0x0,(%rdi)
test   %rsi,%rsi
je     1116 <fastcgi_version+0x16>
movl   $0x1,(%rsi)
test   %rdx,%rdx
je     1121 <fastcgi_version+0x21>
movl   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define void @fastcgi_version(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2) {
%4 = icmp eq i32* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i32 0, i32* %0
br label %6
6: ; preds = %5, %3
%7 = icmp eq i32* %1, null
br i1 %7, label %9, label %8
8: ; preds = %6
store i32 1, i32* %1
br label %9
9: ; preds = %8, %6
%10 = icmp eq i32* %2, null
br i1 %10, label %12, label %11
11: ; preds = %9
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
ret void
}
/* Variables and functions */
int test(char *, char *);
int main(int argc, char *argv[]) {
  if (argc == 3) {
    return test(argv[1], argv[2]);
  } else {
    return test(argv[1], "tests/out");
  }
}


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)
cmpl   $0x3,-0x8(%rbp)
jne    114d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <test@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea4(%rip),%rsi
call   1030 <test@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    %edi,%eax
mov    0x8(%rsi),%rdi
cmp    $0x3,%eax
jne    1124 <main+0x14>
mov    0x10(%rsi),%rsi
jmp    1030 <test@plt>
lea    0xed5(%rip),%rsi
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"tests/out\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 = load i32, i32* %4
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @test(i8* %11, i8* %14)
store i32 %15, i32* %3
br label %21
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @test(i8* %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %20, i32* %3
br label %21
21: ; preds = %16, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [10 x i8] c"tests/out\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
br i1 %3, label %6, label %9
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %8, %6 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %2 ]
%11 = tail call i32 @test(i8* %5, i8* %10)
ret i32 %11
}
double f4_cb_send_pre_double_double(double (*cb)(double, double)) {
  double r = 66.0;
  return cb(8.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
call   *%rax
movsd  0xecc(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_double>:
push   %rax
movsd  0xef7(%rip),%xmm0
movsd  0xef7(%rip),%xmm1
call   *%rdi
addsd  0xef5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_double(double (double, double)* %0) {
%2 = alloca double (double, double)*
%3 = alloca double
store double (double, double)* %0, double (double, double)** %2
store double 6.600000e+01, double* %3
%4 = load double (double, double)*, double (double, double)** %2
%5 = load double, double* %3
%6 = call double %4(double 8.250000e+00, double %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_double(double (double, double)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, double 6.600000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned short);
void oc_random_init(unsigned short seed) { srand(seed); }


x86 assembly (clang, -O0):
<oc_random_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oc_random_init>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @oc_random_init(i16 zeroext %0) {
%2 = tail call i32 @srand(i16 zeroext %0)
ret void
}
void ml_abort_check(int flag) {
  int i;
  i = flag;
  return;
}


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

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

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

LLVM IR (-O2):
define void @ml_abort_check(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double frandUniform() { return rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<frandUniform>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frandUniform>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @frandUniform() {
%1 = call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @frandUniform() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
int /*<<< orphan*/ output_string(char *);
void output_bracketed(char *p) {
  output_byte('(');
  output_string(p);
  output_byte(')');
}


x86 assembly (clang, -O0):
<output_bracketed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x28,%edi
call   1030 <output_byte@plt>
mov    -0x8(%rbp),%rdi
call   1040 <output_string@plt>
mov    $0x29,%edi
call   1030 <output_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_bracketed>:
push   %rbx
mov    %rdi,%rbx
mov    $0x28,%edi
call   1030 <output_byte@plt>
mov    %rbx,%rdi
call   1040 <output_string@plt>
mov    $0x29,%edi
pop    %rbx
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define void @output_bracketed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @output_byte(i8 signext 40)
%4 = load i8*, i8** %2
%5 = call i32 @output_string(i8* %4)
%6 = call i32 @output_byte(i8 signext 41)
ret void
}

LLVM IR (-O2):
define void @output_bracketed(i8* %0) {
%2 = tail call i32 @output_byte(i8 signext 40)
%3 = tail call i32 @output_string(i8* %0)
%4 = tail call i32 @output_byte(i8 signext 41)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  uint32_t value;
  value = (((((1048576L) << 5) / 115000) & 0x1F & 0x3) == 0x3
               ? (((1048576L) << 5) / 115000) & 0x1F | 0x4
               : (((1048576L) << 5) / 115000) & 0x1F) >>
          2 << 1;
  printf("%x\n", value);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
char *_X3D_makeShortCommand(char);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ sscanf(char *, char *, float *);
float X3D_getCurrentFrameRate() {
  char *ptr;
  float curframe;
  ptr = _X3D_makeShortCommand('N');
  if (sscanf(ptr, "%f", &curframe) == 0) {
    printf("client, error - problem reading float from %s\n", ptr);
    exit(0);
  }
  return curframe;
}


x86 assembly (clang, -O0):
<X3D_getCurrentFrameRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4e,%edi
call   1040 <_X3D_makeShortCommand@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x0,%rax
jne    118b <X3D_getCurrentFrameRate+0x4b>
mov    -0x8(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X3D_getCurrentFrameRate>:
push   %rbx
sub    $0x10,%rsp
mov    $0x4e,%edi
call   1040 <_X3D_makeShortCommand@plt>
mov    %rax,%rbx
lea    0xea7(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1050 <sscanf@plt>
test   %rax,%rax
je     1177 <X3D_getCurrentFrameRate+0x37>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe85(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [47 x i8] c"client, error - problem reading float from %s\0A\00"
define float @X3D_getCurrentFrameRate() {
%1 = alloca i8*
%2 = alloca float
%3 = call i8* @_X3D_makeShortCommand(i8 signext 78)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i8*, i8** %1
%9 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %0
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [47 x i8] c"client, error - problem reading float from %s\0A\00"
define float @X3D_getCurrentFrameRate() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i8* @_X3D_makeShortCommand(i8 signext 78)
%4 = call i64 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = load float, float* %1
ret float %10
}
int fun468() { return 468; }


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

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

LLVM IR (-O0):
define i32 @fun468() {
ret i32 468
}

LLVM IR (-O2):
define i32 @fun468() {
ret i32 468
}
void attachInterrupt(int irq, void (*func)(), int type) {}


x86 assembly (clang, -O0):
<attachInterrupt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @attachInterrupt(i32 %0, void (...)* %1, i32 %2) {
%4 = alloca i32
%5 = alloca void (...)*
%6 = alloca i32
store i32 %0, i32* %4
store void (...)* %1, void (...)** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @attachInterrupt(i32 %0, void (...)* nocapture %1, i32 %2) {
ret void
}
void mtrace_magic(unsigned long ax, unsigned long bx, unsigned long cx,
                  unsigned long dx, unsigned long si, unsigned long di) {
  __asm __volatile("xchg %%bx, %%bx"
                   :
                   : "a"(ax), "b"(bx), "c"(cx), "d"(dx), "S"(si), "D"(di));
}


x86 assembly (clang, -O0):
<mtrace_magic>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdi
xchg   %bx,%bx
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtrace_magic>:
push   %rbx
mov    %rcx,%r10
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %r9,%rdi
mov    %r8,%rsi
mov    %r10,%rdx
xchg   %bx,%bx
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mtrace_magic(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
tail call void asm sideeffect "xchg %bx, %bx", "{ax},{bx},{cx},{dx},{si},{di},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5)
ret void
}
char decrypt(char c, int key) {
  if (c < 'A' || 'Z' < c)
    return c;
  else
    return (char)('A' + (c - 'A' + 26 - key) % 26);
}


x86 assembly (clang, -O0):
<decrypt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     112b <decrypt+0x2b>
movsbl -0x2(%rbp),%ecx
mov    $0x5a,%eax
cmp    %ecx,%eax
jge    1136 <decrypt+0x36>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1153 <decrypt+0x53>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0x1a,%eax
sub    -0x8(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt>:
mov    %edi,%eax
lea    -0x5b(%rax),%ecx
cmp    $0xe6,%cl
jb     1134 <decrypt+0x34>
movzbl %al,%eax
sub    %esi,%eax
add    $0xffffffd9,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x41,%al
ret

LLVM IR (-O0):
define signext i8 @decrypt(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 65
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp slt i32 90, %11
br i1 %12, label %13, label %15
13: ; preds = %9, %2
%14 = load i8, i8* %4
store i8 %14, i8* %3
br label %25
15: ; preds = %9
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 65
%19 = add nsw i32 %18, 26
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
%22 = srem i32 %21, 26
%23 = add nsw i32 65, %22
%24 = trunc i32 %23 to i8
store i8 %24, i8* %3
br label %25
25: ; preds = %15, %13
%26 = load i8, i8* %3
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @decrypt(i8 signext %0, i32 %1) {
%3 = add i8 %0, -91
%4 = icmp ult i8 %3, -26
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = zext i8 %0 to i32
%7 = add nsw i32 %6, -39
%8 = sub i32 %7, %1
%9 = srem i32 %8, 26
%10 = trunc i32 %9 to i8
%11 = add nsw i8 %10, 65
br label %12
12: ; preds = %2, %5
%13 = phi i8 [ %11, %5 ], [ %0, %2 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
void user_input(char *name_address) {
  puts("Enter the card_name:");
  scanf("%2s", name_address);
}


x86 assembly (clang, -O0):
<user_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_input>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Enter the card_name:\00"
@.str.1 = [4 x i8] c"%2s\00"
define void @user_input(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter the card_name:\00"
@.str.1 = [4 x i8] c"%2s\00"
define void @user_input(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *executable_name) {
  printf("Usage: %s <input.srt> <output.srt>\n", executable_name);
  printf("Changes the IDs in an SRT file to be numbers from 1 to the total "
         "number of subtitles in the file.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: %s <input.srt> <output.srt>\0A\00"
@.str.1 = [99 x i8] c"Changes the IDs in an SRT file to be numbers from 1 to the total number of subtitles in the file.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: %s <input.srt> <output.srt>\0A\00"
@str = [98 x i8] c"Changes the IDs in an SRT file to be numbers from 1 to the total number of subtitles in the file.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
ret void
}
void HSMMCSDDataTimeoutSet(unsigned int baseAddr, unsigned int timeout) {
  (*((volatile unsigned int *)(baseAddr + (0x22C)))) &= ~((0x000F0000u));
  (*((volatile unsigned int *)(baseAddr + (0x22C)))) |= timeout;
}


x86 assembly (clang, -O0):
<HSMMCSDDataTimeoutSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x22c,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfff0ffff,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x22c,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSMMCSDDataTimeoutSet>:
add    $0x22c,%edi
andl   $0xfff0ffff,(%rdi)
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @HSMMCSDDataTimeoutSet(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 = add i32 %5, 556
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -983041
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add i32 %12, 556
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, %11
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @HSMMCSDDataTimeoutSet(i32 %0, i32 %1) {
%3 = add i32 %0, 556
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -983041
store volatile i32 %7, i32* %5
%8 = load volatile i32, i32* %5
%9 = or i32 %8, %1
store volatile i32 %9, i32* %5
ret void
}
void shiftaddress_canon() {}


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

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

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

LLVM IR (-O2):
define void @shiftaddress_canon() {
ret void
}
int utf8_unichar_to_encoded_len(const int unichar) {
  if (unichar < 0x80)
    return 1;
  if (unichar < 0x800)
    return 2;
  if (unichar < 0x10000)
    return 3;
  if (unichar < 0x200000)
    return 4;
  if (unichar < 0x4000000)
    return 5;
  return 6;
}


x86 assembly (clang, -O0):
<utf8_unichar_to_encoded_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1120 <utf8_unichar_to_encoded_len+0x20>
movl   $0x1,-0x4(%rbp)
jmp    118b <utf8_unichar_to_encoded_len+0x8b>
cmpl   $0x800,-0x8(%rbp)
jge    1139 <utf8_unichar_to_encoded_len+0x39>
movl   $0x2,-0x4(%rbp)
jmp    118b <utf8_unichar_to_encoded_len+0x8b>
cmpl   $0x10000,-0x8(%rbp)
jge    1152 <utf8_unichar_to_encoded_len+0x52>
movl   $0x3,-0x4(%rbp)
jmp    118b <utf8_unichar_to_encoded_len+0x8b>
cmpl   $0x200000,-0x8(%rbp)
jge    116b <utf8_unichar_to_encoded_len+0x6b>
movl   $0x4,-0x4(%rbp)
jmp    118b <utf8_unichar_to_encoded_len+0x8b>
cmpl   $0x4000000,-0x8(%rbp)
jge    1184 <utf8_unichar_to_encoded_len+0x84>
movl   $0x5,-0x4(%rbp)
jmp    118b <utf8_unichar_to_encoded_len+0x8b>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_unichar_to_encoded_len>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1142 <utf8_unichar_to_encoded_len+0x42>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1142 <utf8_unichar_to_encoded_len+0x42>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1142 <utf8_unichar_to_encoded_len+0x42>
mov    $0x4,%eax
cmp    $0x200000,%edi
jb     1142 <utf8_unichar_to_encoded_len+0x42>
cmp    $0x4000000,%edi
mov    $0x6,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @utf8_unichar_to_encoded_len(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 2097152
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i32 %0, 67108864
%11 = select i1 %10, i32 5, i32 6
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ 4, %7 ], [ %11, %9 ]
ret i32 %13
}
float clad_minf(float one, float two) { return (one < two) ? one : two; }


x86 assembly (clang, -O0):
<clad_minf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <clad_minf+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <clad_minf+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_minf>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @clad_minf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @clad_minf(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
char GetSym(int type) {
  if (type == 2)
    return 'S';
  else if (type == 3)
    return 'F';
  else if (type == 1)
    return '*';
  else
    return ' ';
}


x86 assembly (clang, -O0):
<GetSym>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    111a <GetSym+0x1a>
movb   $0x53,-0x1(%rbp)
jmp    1144 <GetSym+0x44>
cmpl   $0x3,-0x8(%rbp)
jne    112d <GetSym+0x2d>
movb   $0x46,-0x1(%rbp)
jmp    1144 <GetSym+0x44>
cmpl   $0x1,-0x8(%rbp)
jne    1140 <GetSym+0x40>
movb   $0x2a,-0x1(%rbp)
jmp    1144 <GetSym+0x44>
movb   $0x20,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSym>:
lea    -0x8(,%rdi,8),%ecx
mov    %edi,%eax
add    $0xffffffff,%eax
mov    $0x46532a,%edx
shr    %cl,%edx
cmp    $0x3,%eax
mov    $0x20,%eax
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @GetSym(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
%4 = trunc i32 %2 to i24
%5 = shl i24 %4, 3
%6 = lshr i24 4608810, %5
%7 = trunc i24 %6 to i8
%8 = select i1 %3, i8 %7, i8 32
ret i8 %8
}
/* Variables and functions */
scalar_t__ exe(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  char cmd[77];
  while (1) {
    printf("\n # > ");
    gets(cmd);
    if (exe(cmd) < 0)
      printf("cmd err");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x60(%rbp),%rdi
call   1030 <exe@plt>
cmp    $0x0,%rax
jge    117a <main+0x4a>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
lea    0xec0(%rip),%r14
mov    %rsp,%rbx
lea    0xebd(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1030 <exe@plt>
test   %rax,%rax
jns    1150 <main+0x20>
mov    %r15,%rdi
call   1040 <printf@plt>
jmp    1150 <main+0x20>

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

LLVM IR (-O2):
@.str = [7 x i8] c"\0A # > \00"
@.str.1 = [8 x i8] c"cmd err\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [77 x i8]
%4 = getelementptr inbounds [77 x i8], [77 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %12, %2
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @gets(i8* %4)
%8 = call i64 @exe(i8* %4)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %5
br label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
void db_sqlite3_finish_stmt(void *dbstmt) {
  sqlite3_stmt *dbst = dbstmt;
  if (dbst)
    sqlite3_finalize(dbst);
}


x86 assembly (clang, -O0):
<db_sqlite3_finish_stmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <db_sqlite3_finish_stmt+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <sqlite3_finalize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_sqlite3_finish_stmt>:
test   %rdi,%rdi
je     111a <db_sqlite3_finish_stmt+0xa>
jmp    1030 <sqlite3_finalize@plt>
ret

LLVM IR (-O0):
define void @db_sqlite3_finish_stmt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @sqlite3_finalize(i32* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @db_sqlite3_finish_stmt(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @sqlite3_finalize(i32* %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int tonumber();
int /*<<< orphan*/ word();
int number() {
  word();
  return tonumber();
}


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

x86 assembly (clang, -O2):
<number>:
push   %rax
xor    %eax,%eax
call   1040 <word@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tonumber@plt>

LLVM IR (-O0):
define i32 @number() {
%1 = call i32 (...) @word()
%2 = call i32 (...) @tonumber()
ret i32 %2
}

LLVM IR (-O2):
define i32 @number() {
%1 = tail call i32 (...) @word()
%2 = tail call i32 (...) @tonumber()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exits(char *);
int /*<<< orphan*/ fprint(int, char *);
void *malloc(long);
void *Malloc(long n) {
  void *p;
  p = malloc(n);
  if (p == 0) {
    fprint(2, "malloc error");
    exits("malloc");
  }
  return p;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <Malloc+0x41>
mov    $0x2,%edi
lea    0xea0(%rip),%rsi
call   1030 <fprint@plt>
lea    0xea1(%rip),%rdi
call   1050 <exits@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115b <Malloc+0x2b>
lea    0xebb(%rip),%rsi
mov    $0x2,%edi
call   1030 <fprint@plt>
lea    0xeb7(%rip),%rdi
call   1050 <exits@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"malloc error\00"
@.str.1 = [7 x i8] c"malloc\00"
define i8* @Malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @fprint(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exits(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"malloc error\00"
@.str.1 = [7 x i8] c"malloc\00"
define noalias i8* @Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @fprint(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exits(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EPIAddressMapSet(uint32_t ui32Base, uint32_t ui32Map) {
  ASSERT(ui32Base == 0x400D0000);
  ASSERT(ui32Map < 0x1000);
  (*((volatile uint32_t *)(ui32Base + 0x0000001C))) = ui32Map;
}


x86 assembly (clang, -O0):
<EPIAddressMapSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x1000,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x1c,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIAddressMapSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400d0000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x1000,%ebx
setl   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0x1c(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @EPIAddressMapSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1074593792
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 4096
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 28
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %13, i32* %17
ret void
}

LLVM IR (-O2):
define void @EPIAddressMapSet(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074593792
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp slt i32 %1, 4096
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = add nsw i32 %0, 28
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %1, i32* %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ ULONG_MAX;
unsigned long wcstox(int /*<<< orphan*/ const *, int /*<<< orphan*/ **, int,
                     int /*<<< orphan*/);
unsigned long wcstoul(const wchar_t *restrict s, wchar_t **restrict p,
                      int base) {
  return wcstox(s, p, base, ULONG_MAX);
}


x86 assembly (clang, -O0):
<wcstoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ecx
call   1030 <wcstox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstoul>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <wcstox@plt>

LLVM IR (-O0):
@ULONG_MAX = global i32 0
define i64 @wcstoul(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32**
%6 = alloca i32
store i32* %0, i32** %4
store i32** %1, i32*** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32**, i32*** %5
%9 = load i32, i32* %6
%10 = load i32, i32* @ULONG_MAX
%11 = call i64 @wcstox(i32* %7, i32** %8, i32 %9, i32 %10)
ret i64 %11
}

LLVM IR (-O2):
@ULONG_MAX = global i32 0
define i64 @wcstoul(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = load i32, i32* @ULONG_MAX
%5 = tail call i64 @wcstox(i32* %0, i32** %1, i32 %2, i32 %4)
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bcm2835_spi_transfernb(char *, char *, int /*<<< orphan*/);
void bcm2835_spi_transfern(char *buf, uint32_t len) {
  bcm2835_spi_transfernb(buf, buf, len);
}


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

x86 assembly (clang, -O2):
<bcm2835_spi_transfern>:
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <bcm2835_spi_transfernb@plt>

LLVM IR (-O0):
define void @bcm2835_spi_transfern(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 i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @bcm2835_spi_transfernb(i8* %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @bcm2835_spi_transfern(i8* %0, i32 %1) {
%3 = tail call i32 @bcm2835_spi_transfernb(i8* %0, i8* %0, i32 %1)
ret void
}