xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ show_float(float);
int /*<<< orphan*/ show_int(int);
int /*<<< orphan*/ show_pointer(int *);
void test_show_bytes(int val) {
  int ival = val;
  float fval = (float)ival;
  int *pval = &val;
  show_int(ival);
  show_float(fval);
  show_pointer(pval);
}


x86 assembly (clang, -O0):
<test_show_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <show_int@plt>
movss  -0xc(%rbp),%xmm0
call   1030 <show_float@plt>
mov    -0x18(%rbp),%rdi
call   1050 <show_pointer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_show_bytes>:
push   %rax
mov    %edi,0x4(%rsp)
cvtsi2ss %edi,%xmm0
movss  %xmm0,(%rsp)
call   1040 <show_int@plt>
movss  (%rsp),%xmm0
call   1030 <show_float@plt>
lea    0x4(%rsp),%rdi
call   1050 <show_pointer@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_show_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i32*
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
store float %8, float* %4
store i32* %2, i32** %5
%9 = load i32, i32* %3
%10 = call i32 @show_int(i32 %9)
%11 = load float, float* %4
%12 = call i32 @show_float(float %11)
%13 = load i32*, i32** %5
%14 = call i32 @show_pointer(i32* %13)
ret void
}

LLVM IR (-O2):
define void @test_show_bytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = sitofp i32 %0 to float
%4 = tail call i32 @show_int(i32 %0)
%5 = tail call i32 @show_float(float %3)
%6 = call i32 @show_pointer(i32* %2)
ret void
}
int doblar(int a) { return 2 * a; }


x86 assembly (clang, -O0):
<doblar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @doblar(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int doubleSize() {
  double doubArray[10];
  double *doubPtr1;
  double *doubPtr2;
  return 2;
}


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

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

LLVM IR (-O0):
define i32 @doubleSize() {
%1 = alloca [10 x double]
%2 = alloca double*
%3 = alloca double*
ret i32 2
}

LLVM IR (-O2):
define i32 @doubleSize() {
ret i32 2
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t rotr64(const uint64_t w, const unsigned c) {
  return (w >> c) | (w << (64 - c));
}


x86 assembly (clang, -O0):
<rotr64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr64>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotr64(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotr64(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ queueFrameInvalidationTuple(int, int);
void connectionSinkTooSlow(int startFrame, int endFrame) {
  queueFrameInvalidationTuple(startFrame, endFrame);
}


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

x86 assembly (clang, -O2):
<connectionSinkTooSlow>:
jmp    1030 <queueFrameInvalidationTuple@plt>

LLVM IR (-O0):
define void @connectionSinkTooSlow(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 @queueFrameInvalidationTuple(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @connectionSinkTooSlow(i32 %0, i32 %1) {
%3 = tail call i32 @queueFrameInvalidationTuple(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
char *scopy_char(char *, char const *, char);
char *scopy_spc(char *d, const char *s) { return scopy_char(d, s, ' '); }


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

x86 assembly (clang, -O2):
<scopy_spc>:
mov    $0x20,%edx
jmp    1030 <scopy_char@plt>

LLVM IR (-O0):
define i8* @scopy_spc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @scopy_char(i8* %5, i8* %6, i8 signext 32)
ret i8* %7
}

LLVM IR (-O2):
define i8* @scopy_spc(i8* %0, i8* %1) {
%3 = tail call i8* @scopy_char(i8* %0, i8* %1, i8 signext 32)
ret i8* %3
}
double add(double m1, double m2) { return m1 + m2; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ra;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, ...);
int foo(int n, int ra[2 * n]) {
  printf("sizeof(ra) = %d.  sizeof(*ra) = %d\n", sizeof(ra), sizeof(*ra));
  if (sizeof(ra) != sizeof(int *)) {
    printf("Error %d\n", (int)1);
    exit(1);
  };
  if (sizeof(*ra) != sizeof(int)) {
    printf("Error %d\n", (int)2);
    exit(2);
  };
  return n;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    $0x4,%edx
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"sizeof(ra) = %d. sizeof(*ra) = %d\0A\00"
define i32 @foo(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 = mul nsw i32 2, %5
%7 = zext i32 %6 to i64
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 8, i64 4)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [36 x i8] c"sizeof(ra) = %d. sizeof(*ra) = %d\0A\00"
define i32 @foo(i32 returned %0, i32* nocapture readnone %1) {
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 8, i64 4)
ret i32 %0
}
char *COM_SkipPath(char *pathname) {
  char *last;
  last = pathname;
  while (*pathname) {
    if (*pathname == '/') {
      last = pathname + 1;
    }
    pathname++;
  }
  return last;
}


x86 assembly (clang, -O0):
<COM_SkipPath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <COM_SkipPath+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1139 <COM_SkipPath+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <COM_SkipPath+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_SkipPath>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <COM_SkipPath+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <COM_SkipPath+0x10>
test   %dl,%dl
jne    1113 <COM_SkipPath+0x13>
ret

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

LLVM IR (-O2):
define i8* @COM_SkipPath(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
float f1(float x) { return x * (x > 0.f ? 1.f : -1.f); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xee5(%rip),%xmm4
movss  0xee1(%rip),%xmm3
xorps  %xmm1,%xmm1
cmpltss %xmm2,%xmm1
movaps %xmm1,%xmm2
andps  %xmm4,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movaps 0xef9(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @f1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp ogt float %4, 0.000000e+00
%6 = zext i1 %5 to i64
%7 = select i1 %5, float 1.000000e+00, float -1.000000e+00
%8 = fmul float %3, %7
ret float %8
}

LLVM IR (-O2):
define float @f1(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %0, float %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ read_with_timeout(int, unsigned char *, int, long);
unsigned char readByte(int fd) {
  unsigned char c;
  read_with_timeout(fd, &c, 1, 1000l);
  return c;
}


x86 assembly (clang, -O0):
<readByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
mov    $0x3e8,%ecx
call   1030 <read_with_timeout@plt>
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readByte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x3e8,%ecx
mov    $0x1,%edx
call   1030 <read_with_timeout@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @readByte(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @read_with_timeout(i32 %4, i8* %3, i32 1, i64 1000)
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @readByte(i32 %0) {
%2 = alloca i8
%3 = call i32 @read_with_timeout(i32 %0, i8* %2, i32 1, i64 1000)
%4 = load i8, i8* %2
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ vuln(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("%s <arg>\n", argv[0]);
    exit(0);
  }
  printf("ROP me if you can :]\n");
  vuln(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
je     116c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <vuln@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1162 <main+0x22>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rdi
call   1040 <vuln@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    (%rbx),%rsi
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s <arg>\0A\00"
@.str.1 = [22 x i8] c"ROP me if you can :]\0A\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 ne i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @vuln(i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s <arg>\0A\00"
@str = [21 x i8] c"ROP me if you can :]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @vuln(i8* %11)
ret i32 0
}
/* Type definitions */
struct Message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ equip_inventory(struct Message *, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int);
void cmd_equipall(int pindex __attribute__((unused)), struct Message *msg) {
  equip_inventory(msg, 0, 0, 1);
}


x86 assembly (clang, -O0):
<cmd_equipall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%esi
call   1030 <equip_inventory@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_equipall>:
mov    %rsi,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <equip_inventory@plt>

LLVM IR (-O0):
%struct.Message = type { i32 }
define void @cmd_equipall(i32 %0, %struct.Message* %1) {
%3 = alloca i32
%4 = alloca %struct.Message*
store i32 %0, i32* %3
store %struct.Message* %1, %struct.Message** %4
%5 = load %struct.Message*, %struct.Message** %4
%6 = call i32 @equip_inventory(%struct.Message* %5, i32 0, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
%struct.Message = type { i32 }
define void @cmd_equipall(i32 %0, %struct.Message* %1) {
%3 = tail call i32 @equip_inventory(%struct.Message* %1, i32 0, i32 0, i32 1)
ret void
}
int main(void) {
  if (__builtin_cpu_supports("avx2"))
    return 4;
  else
    return 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ecb(%rip),%eax
and    $0x400,%eax
cmp    $0x400,%eax
sete   %al
and    $0x1,%al
test   $0x1,%al
jne    219d <main+0x2d>
jmp    21a9 <main+0x39>
movl   $0x4,-0x4(%rbp)
jmp    21b0 <main+0x40>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed7(%rip),%al
and    $0x4,%al
cmp    $0x1,%al
mov    $0x4,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
@__cpu_model = external global { i32, i32, i32, [1 x i32] }
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* getelementptr inbounds ({ i32, i32, i32, [1 x i32] }, { i32, i32, i32, [1 x i32] }* @__cpu_model, i32 0, i32 3, i32 0)
%3 = and i32 %2, 1024
%4 = icmp eq i32 %3, 1024
%5 = and i1 true, %4
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 4, i32* %1
br label %8
7: ; preds = %0
store i32 3, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@__cpu_model = external global { i32, i32, i32, [1 x i32] }
define i32 @main() {
%1 = load i32, i32* getelementptr inbounds ({ i32, i32, i32, [1 x i32] }, { i32, i32, i32, [1 x i32] }* @__cpu_model, i64 0, i32 3, i64 0)
%2 = and i32 %1, 1024
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 3, i32 4
ret i32 %4
}
/* Variables and functions */
scalar_t__ number_of_n_digits_with_unique_digits(int);
int countNumbersWithUniqueDigits(int n) {
  int total = 0, index;
  for (index = 0; index <= n; ++index) {
    total += number_of_n_digits_with_unique_digits(index);
  }
  return (total);
}


x86 assembly (clang, -O0):
<countNumbersWithUniqueDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1158 <countNumbersWithUniqueDigits+0x48>
mov    -0xc(%rbp),%edi
call   1030 <number_of_n_digits_with_unique_digits@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <countNumbersWithUniqueDigits+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countNumbersWithUniqueDigits>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
js     1143 <countNumbersWithUniqueDigits+0x33>
mov    %edi,%r14d
add    $0x1,%r14d
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <number_of_n_digits_with_unique_digits@plt>
add    %eax,%ebp
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1130 <countNumbersWithUniqueDigits+0x20>
jmp    1145 <countNumbersWithUniqueDigits+0x35>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @countNumbersWithUniqueDigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %4
%11 = call i64 @number_of_n_digits_with_unique_digits(i32 %10)
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
br label %16
16: ; preds = %9
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @countNumbersWithUniqueDigits(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = tail call i64 @number_of_n_digits_with_unique_digits(i32 %4)
%7 = trunc i64 %6 to i32
%8 = add i32 %5, %7
%9 = add nuw i32 %4, 1
%10 = icmp eq i32 %4, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
void SysCtlIntFlagClear(unsigned long ulIntFlags) {

  ;
  (*((volatile unsigned long *)(0x40021008))) |= (ulIntFlags << 16);
}


x86 assembly (clang, -O0):
<SysCtlIntFlagClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%rax
mov    $0x40021008,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x40021008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlIntFlagClear>:
shl    $0x10,%rdi
or     %rdi,0x40021008
40
ret

LLVM IR (-O0):
define void @SysCtlIntFlagClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 16
%5 = load volatile i64, i64* inttoptr (i64 1073877000 to i64*)
%6 = or i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1073877000 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlIntFlagClear(i64 %0) {
%2 = shl i64 %0, 16
%3 = load volatile i64, i64* inttoptr (i64 1073877000 to i64*)
%4 = or i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 1073877000 to i64*)
ret void
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int k;
  scanf("%d", &k);
  printf("%d\n", abs(k) * 2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
add    %esi,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = shl nuw nsw i32 %5, 1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
char *convert(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *output;
  output = convert(argv[1]);
  printf("%s\n", output);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <convert@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <convert@plt>
lea    0xecf(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @convert(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int print_bar(void) {
  int i;
  putchar('|');
  for (i = 0; i < 81 - 3; i++)
    putchar('-');
  printf("|\n");
  return 0;
}


x86 assembly (clang, -O0):
<print_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7c,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x4e,-0x4(%rbp)
jge    115b <print_bar+0x3b>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <print_bar+0x19>
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bar>:
push   %rbx
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0x4e,%ebx
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <print_bar+0x10>
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"|\0A\00"
define i32 @print_bar() {
%1 = alloca i32
%2 = call i32 @putchar(i8 signext 124)
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 78
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @putchar(i8 signext 45)
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"|\00"
define i32 @print_bar() {
%1 = tail call i32 @putchar(i8 signext 124)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @putchar(i8 signext 45)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 78
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ compal_get_lcd_brightness();
int /*<<< orphan*/ compal_set_lcd_brightness(scalar_t__);
void Compal_lcdBrightness_DownOneStep(void) {
  compal_set_lcd_brightness(compal_get_lcd_brightness() - 1);
}


x86 assembly (clang, -O0):
<Compal_lcdBrightness_DownOneStep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <compal_get_lcd_brightness@plt>
mov    %rax,%rdi
sub    $0x1,%rdi
call   1040 <compal_set_lcd_brightness@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Compal_lcdBrightness_DownOneStep>:
push   %rax
xor    %eax,%eax
call   1030 <compal_get_lcd_brightness@plt>
lea    -0x1(%rax),%rdi
pop    %rax
jmp    1040 <compal_set_lcd_brightness@plt>

LLVM IR (-O0):
define void @Compal_lcdBrightness_DownOneStep() {
%1 = call i64 (...) @compal_get_lcd_brightness()
%2 = sub nsw i64 %1, 1
%3 = call i32 @compal_set_lcd_brightness(i64 %2)
ret void
}

LLVM IR (-O2):
define void @Compal_lcdBrightness_DownOneStep() {
%1 = tail call i64 (...) @compal_get_lcd_brightness()
%2 = add nsw i64 %1, -1
%3 = tail call i32 @compal_set_lcd_brightness(i64 %2)
ret void
}
int precedence(char op) {
  switch (op) {
  case '|':
    return 1;
  case '^':
    return 2;
  case '&':
    return 3;
  case '>':
  case '<':
    return 4;
  case '+':
  case '-':
    return 5;
  case '*':
  case '/':
  case '%':
    return 6;
  case '~':
  case '_':
    return 1000;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffdb,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x59,%eax
ja     1188 <precedence+0x88>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    118f <precedence+0x8f>
movl   $0x2,-0x4(%rbp)
jmp    118f <precedence+0x8f>
movl   $0x3,-0x4(%rbp)
jmp    118f <precedence+0x8f>
movl   $0x4,-0x4(%rbp)
jmp    118f <precedence+0x8f>
movl   $0x5,-0x4(%rbp)
jmp    118f <precedence+0x8f>
movl   $0x6,-0x4(%rbp)
jmp    118f <precedence+0x8f>
movl   $0x3e8,-0x4(%rbp)
jmp    118f <precedence+0x8f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedence>:
add    $0xffffffdb,%edi
cmp    $0x59,%edi
ja     113b <precedence+0x3b>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x6,%eax
ret
mov    $0x5,%eax
ret
mov    $0x4,%eax
ret
mov    $0x3e8,%eax
ret
mov    $0x3,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @precedence(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %13 [
i32 124, label %6
i32 94, label %7
i32 38, label %8
i32 62, label %9
i32 60, label %9
i32 43, label %10
i32 45, label %10
i32 42, label %11
i32 47, label %11
i32 37, label %11
i32 126, label %12
i32 95, label %12
]
6: ; preds = %1
store i32 1, i32* %2
br label %14
7: ; preds = %1
store i32 2, i32* %2
br label %14
8: ; preds = %1
store i32 3, i32* %2
br label %14
9: ; preds = %1, %1
store i32 4, i32* %2
br label %14
10: ; preds = %1, %1
store i32 5, i32* %2
br label %14
11: ; preds = %1, %1, %1
store i32 6, i32* %2
br label %14
12: ; preds = %1, %1
store i32 1000, i32* %2
br label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @precedence(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 124, label %10
i32 94, label %3
i32 38, label %4
i32 62, label %5
i32 60, label %5
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 37, label %7
i32 126, label %8
i32 95, label %8
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1, %1
br label %10
6: ; preds = %1, %1
br label %10
7: ; preds = %1, %1, %1
br label %10
8: ; preds = %1, %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3
%11 = phi i32 [ -1, %9 ], [ 1000, %8 ], [ 6, %7 ], [ 5, %6 ], [ 4, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ]
ret i32 %11
}
/* Variables and functions */
int fptr_capi20_fileno(unsigned int);
scalar_t__ loadlib();
int capi20_fileno(unsigned ApplID) {
  if (loadlib() < 0)
    return -1;
  return fptr_capi20_fileno(ApplID);
}


x86 assembly (clang, -O0):
<capi20_fileno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <loadlib@plt>
cmp    $0x0,%rax
jge    1148 <capi20_fileno+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <capi20_fileno+0x33>
mov    -0x8(%rbp),%edi
call   1040 <fptr_capi20_fileno@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capi20_fileno>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <loadlib@plt>
test   %rax,%rax
js     1137 <capi20_fileno+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <fptr_capi20_fileno@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @capi20_fileno(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @loadlib()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @fptr_capi20_fileno(i32 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @capi20_fileno(i32 %0) {
%2 = tail call i64 (...) @loadlib()
%3 = icmp slt i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fptr_capi20_fileno(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_sin();
scalar_t__ sin(double);
void test_sin(double d) {
  if (sin(d) != sin(d))
    link_failure_sin();
}


x86 assembly (clang, -O0):
<test_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_sin+0x3c>
mov    $0x0,%al
call   1040 <link_failure_sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sin>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
cmp    %rax,%rbx
jne    1149 <test_sin+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_sin@plt>

LLVM IR (-O0):
define void @test_sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @sin(double %3)
%5 = load double, double* %2
%6 = call i64 @sin(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_sin()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_sin(double %0) {
%2 = tail call i64 @sin(double %0)
%3 = tail call i64 @sin(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_sin()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
struct ptdump_options {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print(struct ptdump_options const *, char *);
void print_col_separator(const struct ptdump_options *options) {
  print(options, "  ");
}


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

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

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

LLVM IR (-O2):
%struct.ptdump_options = type { i32 }
@.str = [3 x i8] c" \00"
define void @print_col_separator(%struct.ptdump_options* %0) {
%2 = tail call i32 @print(%struct.ptdump_options* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double **matriz(int, int);
int /*<<< orphan*/ preenche_valor(double **, int, int, int /*<<< orphan*/);
double **matriz_nula(int l, int c) {
  double **M = matriz(l, c);
  preenche_valor(M, l, c, 0);
  return M;
}


x86 assembly (clang, -O0):
<matriz_nula>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <matriz@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %ecx,%ecx
call   1040 <preenche_valor@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matriz_nula>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <matriz@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %ecx,%ecx
call   1040 <preenche_valor@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double** @matriz_nula(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double**
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call double** @matriz(i32 %6, i32 %7)
store double** %8, double*** %5
%9 = load double**, double*** %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @preenche_valor(double** %9, i32 %10, i32 %11, i32 0)
%13 = load double**, double*** %5
ret double** %13
}

LLVM IR (-O2):
define double** @matriz_nula(i32 %0, i32 %1) {
%3 = tail call double** @matriz(i32 %0, i32 %1)
%4 = tail call i32 @preenche_valor(double** %3, i32 %0, i32 %1, i32 0)
ret double** %3
}
unsigned int get_empeg_id(void) {
  unsigned int *flash = (unsigned int *)(0xd0000000 + 0x2000);
  return flash[1];
}


x86 assembly (clang, -O0):
<get_empeg_id>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd0002000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_empeg_id>:
mov    $0xd0002004,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @get_empeg_id() {
%1 = alloca i32*
store i32* inttoptr (i64 3489669120 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = getelementptr inbounds i32, i32* %2, i64 1
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_empeg_id() {
%1 = load i32, i32* inttoptr (i64 3489669124 to i32*)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ PinConfigSet(unsigned long, int, int);
int /*<<< orphan*/ PinModeSet(unsigned long, unsigned long);
void PinTypeSPI(unsigned long ulPin, unsigned long ulPinMode) {
  PinModeSet(ulPin, ulPinMode);
  PinConfigSet(ulPin, 0x00000020 | 0x00000040, 0x00000000);
}


x86 assembly (clang, -O0):
<PinTypeSPI>:
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   1030 <PinModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x60,%esi
xor    %edx,%edx
call   1040 <PinConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PinTypeSPI>:
push   %rbx
mov    %rdi,%rbx
call   1030 <PinModeSet@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <PinConfigSet@plt>

LLVM IR (-O0):
define void @PinTypeSPI(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @PinModeSet(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = call i32 @PinConfigSet(i64 %8, i32 96, i32 0)
ret void
}

LLVM IR (-O2):
define void @PinTypeSPI(i64 %0, i64 %1) {
%3 = tail call i32 @PinModeSet(i64 %0, i64 %1)
%4 = tail call i32 @PinConfigSet(i64 %0, i32 96, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello world! \t\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Hello world! \09\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x3f() {
  Assert_real((isxdigit(63) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              320, ("isxdigit should be 0 for ?"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x3f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x140,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x3f>:
push   %rax
mov    $0x3f,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x140,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for ?\00"
define void @t_isxdigit_0x3f() {
%1 = call i64 @isxdigit(i32 63)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for ?\00"
define void @t_isxdigit_0x3f() {
%1 = tail call i64 @isxdigit(i32 63)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long cqreek_port2addr(unsigned long port) {
  if (0x0000 <= port && port <= 0x0040)
    return 0xA4000000UL + port;
  if ((0x01f0 <= port && port <= 0x01f7) || port == 0x03f6)
    return 0xA4000000UL + port;
  return 0xA4A00000UL + port;
}


x86 assembly (clang, -O0):
<cqreek_port2addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
ja     1136 <cqreek_port2addr+0x36>
cmpq   $0x40,-0x10(%rbp)
ja     1136 <cqreek_port2addr+0x36>
movabs $0xa4000000,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118a <cqreek_port2addr+0x8a>
mov    $0x1f0,%eax
cmp    -0x10(%rbp),%rax
ja     1153 <cqreek_port2addr+0x53>
cmpq   $0x1f7,-0x10(%rbp)
jbe    1161 <cqreek_port2addr+0x61>
cmpq   $0x3f6,-0x10(%rbp)
jne    1178 <cqreek_port2addr+0x78>
movabs $0xa4000000,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118a <cqreek_port2addr+0x8a>
movabs $0xa4a00000,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cqreek_port2addr>:
mov    $0xa4000000,%eax
cmp    $0x41,%rdi
jb     112f <cqreek_port2addr+0x2f>
mov    %rdi,%rcx
and    $0xfffffffffffffff8,%rcx
lea    0xa00000(%rax),%rdx
cmp    $0x1f0,%rcx
cmove  %rax,%rdx
cmp    $0x3f6,%rdi
cmovne %rdx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @cqreek_port2addr(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ule i64 0, %4
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i64, i64* %3
%8 = icmp ule i64 %7, 64
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i64, i64* %3
%11 = add i64 2751463424, %10
store i64 %11, i64* %2
br label %27
12: ; preds = %6, %1
%13 = load i64, i64* %3
%14 = icmp ule i64 496, %13
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i64, i64* %3
%17 = icmp ule i64 %16, 503
br i1 %17, label %21, label %18
18: ; preds = %15, %12
%19 = load i64, i64* %3
%20 = icmp eq i64 %19, 1014
br i1 %20, label %21, label %24
21: ; preds = %18, %15
%22 = load i64, i64* %3
%23 = add i64 2751463424, %22
store i64 %23, i64* %2
br label %27
24: ; preds = %18
%25 = load i64, i64* %3
%26 = add i64 2761949184, %25
store i64 %26, i64* %2
br label %27
27: ; preds = %24, %21, %9
%28 = load i64, i64* %2
ret i64 %28
}

LLVM IR (-O2):
define i64 @cqreek_port2addr(i64 %0) {
%2 = icmp ult i64 %0, 65
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = and i64 %0, -8
%5 = icmp eq i64 %4, 496
%6 = icmp eq i64 %0, 1014
%7 = or i1 %6, %5
%8 = select i1 %7, i64 2751463424, i64 2761949184
br label %9
9: ; preds = %3, %1
%10 = phi i64 [ 2751463424, %1 ], [ %8, %3 ]
%11 = add i64 %10, %0
ret i64 %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t bcdtobin8(uint8_t bcd) {
  uint8_t res = 0;
  res = (bcd & 0x0F);
  res += ((bcd >> 4) & 0x0F) * 10;
  return res;
}


x86 assembly (clang, -O0):
<bcdtobin8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
imul   $0xa,%eax,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcdtobin8>:
mov    %edi,%eax
and    $0xf,%eax
shr    $0x4,%edi
and    $0xf,%edi
lea    (%rdi,%rdi,4),%ecx
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @bcdtobin8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 15
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = ashr i32 %6, 4
%8 = and i32 %7, 15
%9 = mul nsw i32 %8, 10
%10 = load i32, i32* %3
%11 = add nsw i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @bcdtobin8(i32 %0) {
%2 = and i32 %0, 15
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = mul nuw nsw i32 %4, 10
%6 = add nuw nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
unsigned int __crc32w(unsigned int, unsigned short);
unsigned int test__crc32w(unsigned int CRC, unsigned short V) {
  return __crc32w(CRC, V);
}


x86 assembly (clang, -O0):
<test__crc32w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
movzwl -0x6(%rbp),%esi
call   1030 <__crc32w@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test__crc32w>:
jmp    1030 <__crc32w@plt>

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

LLVM IR (-O2):
define i32 @test__crc32w(i32 %0, i16 zeroext %1) {
%3 = tail call i32 @__crc32w(i32 %0, i16 zeroext %1)
ret i32 %3
}
int main(void) {
  1 == 2.0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}