xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int fputs(char const *const, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int putserr(const char *const str) {
  int retr = fputs(str, stderr);
  fputc('\n', stderr);
  return retr;
}


x86 assembly (clang, -O0):
<putserr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putserr>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%esi
call   1030 <fputs@plt>
mov    %eax,%ebx
mov    (%r14),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @putserr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* @stderr
%8 = call i32 @fputc(i8 signext 10, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @putserr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputc(i8 signext 10, i32 %4)
ret i32 %3
}
void recurser(x) int x;
{
  int local_x = 0;
  if (x > 0)
    recurser(x - 1);
  local_x = x;
}


x86 assembly (clang, -O0):
<recurser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1137 <recurser+0x27>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <recurser@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @recurser(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
store i32 %10, i32* %3
ret void
}

LLVM IR (-O2):
define void @recurser(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
size_t indent_length(const wchar_t *line, size_t length) {
  size_t n = 0;
  while (n < length && *line++ == ' ')
    ++n;
  return n;
}


x86 assembly (clang, -O0):
<indent_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113f <indent_length+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x20,(%rax)
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114f <indent_length+0x4f>
jmp    1160 <indent_length+0x60>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <indent_length+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent_length>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <indent_length+0x22>
nopw   0x0(%rax,%rax,1)
cmpl   $0x20,(%rdi,%rax,4)
jne    1122 <indent_length+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <indent_length+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @indent_length(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %11, %9 ], [ 0, %2 ]
%6 = phi i32* [ %10, %9 ], [ %0, %2 ]
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = add nuw i64 %5, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %2
%14 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %14
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0) {
    reverse(line);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1183 <main+0x53>
lea    -0x3f0(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = call i32 @reverse(i8* %9)
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @getline(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FreeMemory(void *pv) {
  ;
  free(pv);
}


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

x86 assembly (clang, -O2):
<FreeMemory>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeMemory(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fldEsc(struct S *);
void proxy(struct S *s) { fldEsc(s); }


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

x86 assembly (clang, -O2):
<proxy>:
jmp    1030 <fldEsc@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @proxy(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = load %struct.S*, %struct.S** %2
%4 = call i32 @fldEsc(%struct.S* %3)
ret void
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @proxy(%struct.S* %0) {
%2 = tail call i32 @fldEsc(%struct.S* %0)
ret void
}
void emulate_setimedol(char *time) {}


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

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

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

LLVM IR (-O2):
define void @emulate_setimedol(i8* nocapture %0) {
ret void
}
/* Variables and functions */
double pow(int, int);
double ExponentialEaseIn(double p) {
  return (p == 0.0) ? p : pow(2, 10 * (p - 1));
}


x86 assembly (clang, -O0):
<ExponentialEaseIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1144 <ExponentialEaseIn+0x34>
jp     1144 <ExponentialEaseIn+0x34>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <ExponentialEaseIn+0x64>
movsd  -0x8(%rbp),%xmm1
movsd  0xeb7(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExponentialEaseIn>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    111d <ExponentialEaseIn+0xd>
jp     111d <ExponentialEaseIn+0xd>
ret
addsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @ExponentialEaseIn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %13
7: ; preds = %1
%8 = load double, double* %2
%9 = fsub double %8, 1.000000e+00
%10 = fmul double 1.000000e+01, %9
%11 = fptosi double %10 to i32
%12 = call double @pow(i32 2, i32 %11)
br label %13
13: ; preds = %7, %5
%14 = phi double [ %6, %5 ], [ %12, %7 ]
ret double %14
}

LLVM IR (-O2):
define double @ExponentialEaseIn(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = fadd double %0, -1.000000e+00
%5 = fmul double %4, 1.000000e+01
%6 = fptosi double %5 to i32
%7 = tail call double @pow(i32 2, i32 %6)
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ %0, %1 ]
ret double %9
}
void setupMotorSystem() {}


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

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

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

LLVM IR (-O2):
define void @setupMotorSystem() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ complain(char *, char const *);
int /*<<< orphan*/ exit(int);
int read(int, void *, size_t);
size_t doread(const char *path, int fd, void *buf, size_t len) {
  int result;
  result = read(fd, buf, len);
  if (result < 0) {
    complain("%s: read", path);
    exit(1);
  }
  return (size_t)result;
}


x86 assembly (clang, -O0):
<doread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    117e <doread+0x4e>
mov    -0x8(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1050 <complain@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
movslq -0x24(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doread>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <read@plt>
test   %eax,%eax
js     1149 <doread+0x19>
mov    %eax,%eax
pop    %rbx
ret
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1050 <complain@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s: read\00"
define i64 @doread(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @read(i32 %10, i8* %11, i64 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = call i32 @complain(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %4
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
ret i64 %22
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s: read\00"
define i64 @doread(i8* %0, i32 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i32 @read(i32 %1, i8* %2, i64 %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @complain(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
%11 = zext i32 %5 to i64
ret i64 %11
}
/* Variables and functions */
bool checkPidTypeIndexInRange(unsigned int pidTypeIndex) {
  return (pidTypeIndex >= 0 || pidTypeIndex < 6);
}


x86 assembly (clang, -O0):
<checkPidTypeIndexInRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jae    1120 <checkPidTypeIndexInRange+0x20>
cmpl   $0x6,-0x4(%rbp)
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @checkPidTypeIndexInRange(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ult i32 %6, 6
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @checkPidTypeIndexInRange(i32 %0) {
ret i32 1
}
int getNumericX(char c, int boardSize) { return (c - 97) - boardSize / 2; }


x86 assembly (clang, -O0):
<getNumericX>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumericX>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
sub    %eax,%edi
lea    -0x61(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getNumericX(i8 signext %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 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 97
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 2
%10 = sub nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @getNumericX(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = add nsw i32 %3, -97
%5 = sdiv i32 %1, -2
%6 = add nsw i32 %4, %5
ret i32 %6
}
unsigned char SMS_TP_MTI_SET(unsigned char c, unsigned char mti) {
  c &= ~(0x03);
  c |= mti;
  return c;
}


x86 assembly (clang, -O0):
<SMS_TP_MTI_SET>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xfffffffc,%eax
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%ecx
movzbl -0x1(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SMS_TP_MTI_SET>:
mov    %edi,%eax
and    $0xfc,%al
or     %sil,%al
ret

LLVM IR (-O0):
define zeroext i8 @SMS_TP_MTI_SET(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = and i32 %6, -4
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %12, %10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
%15 = load i8, i8* %3
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @SMS_TP_MTI_SET(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %0, -4
%4 = or i8 %3, %1
ret i8 %4
}
void curl_easy_duphandle() {}


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

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

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

LLVM IR (-O2):
define void @curl_easy_duphandle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fb_hDateDecodeSerial(double, int /*<<< orphan*/,
                                        int /*<<< orphan*/, int *);
int fb_Day(double serial) {
  int day;
  fb_hDateDecodeSerial(serial, 0, 0, &day);
  return day;
}


x86 assembly (clang, -O0):
<fb_Day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %esi,%esi
lea    -0xc(%rbp),%rdx
mov    %esi,%edi
call   1030 <fb_hDateDecodeSerial@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_Day>:
push   %rax
lea    0x4(%rsp),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <fb_hDateDecodeSerial@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fb_Day(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @fb_hDateDecodeSerial(double %4, i32 0, i32 0, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @fb_Day(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fb_hDateDecodeSerial(double %0, i32 0, i32 0, i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
void IncreaseNumber(int Number) { Number += 5; }


x86 assembly (clang, -O0):
<IncreaseNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @IncreaseNumber(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _netid_usage(void) {
  fputs("Usage: netid network...\n", stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_netid_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_netid_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: netid network...\0A\00"
@stderr = global i32 0
define i32 @_netid_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: netid network...\0A\00"
@stderr = global i32 0
define i32 @_netid_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
int main() {
  int i;
  int res = 12;
  goto L1;
  for (i = 0; i < 100; i++) {
  L3:
    res = res + 1;
    goto L2;
    if (i > 100) {
    L1:
      res = 0;
      goto L3;
    }
    break;
  }
L2:
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0xc(%rbp)
jmp    1125 <main+0x25>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <main+0x31>
movl   $0x0,-0xc(%rbp)
jmp    1117 <main+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ mode_t;

/* Variables and functions */
void traiter(mode_t bit, char c1, char c2, int *indice_mode, char *modes) {
  modes[(*indice_mode)++] = bit ? c1 : c2;
}


x86 assembly (clang, -O0):
<traiter>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1132 <traiter+0x32>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1139 <traiter+0x39>
movsbl -0xa(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %al,%dl
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<traiter>:
test   %rdi,%rdi
cmove  %edx,%esi
movslq (%rcx),%rax
lea    0x1(%rax),%edx
mov    %edx,(%rcx)
mov    %sil,(%r8,%rax,1)
ret

LLVM IR (-O0):
define void @traiter(i64 %0, i8 signext %1, i8 signext %2, i32* %3, i8* %4) {
%6 = alloca i64
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32*
%10 = alloca i8*
store i64 %0, i64* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load i64, i64* %6
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i8, i8* %7
%15 = sext i8 %14 to i32
br label %19
16: ; preds = %5
%17 = load i8, i8* %8
%18 = sext i8 %17 to i32
br label %19
19: ; preds = %16, %13
%20 = phi i32 [ %15, %13 ], [ %18, %16 ]
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %10
%23 = load i32*, i32** %9
%24 = load i32, i32* %23
%25 = add nsw i32 %24, 1
store i32 %25, i32* %23
%26 = sext i32 %24 to i64
%27 = getelementptr inbounds i8, i8* %22, i64 %26
store i8 %21, i8* %27
ret void
}

LLVM IR (-O2):
define void @traiter(i64 %0, i8 signext %1, i8 signext %2, i32* nocapture %3, i8* nocapture writeonly %4) {
%6 = icmp eq i64 %0, 0
%7 = select i1 %6, i8 %2, i8 %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %4, i64 %10
store i8 %7, i8* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__8__GeneralIO__makeOutput();
void LedsP__Led1__makeOutput(void) { Msp430GpioC__8__GeneralIO__makeOutput(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__8__GeneralIO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_cmn(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_imm_op();
void arm_cmn_imm() { arm_arith_cmn(arm_data_imm_op()); }


x86 assembly (clang, -O0):
<arm_cmn_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
call   1040 <arm_arith_cmn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_cmn_imm>:
push   %rax
xor    %eax,%eax
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_arith_cmn@plt>

LLVM IR (-O0):
define void @arm_cmn_imm() {
%1 = call i32 (...) @arm_data_imm_op()
%2 = call i32 @arm_arith_cmn(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_cmn_imm() {
%1 = tail call i32 (...) @arm_data_imm_op()
%2 = tail call i32 @arm_arith_cmn(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  char *s = "%d -- bad!\n";
  printf(s);
  return 0;
}


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

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d -- bad!\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned long rnd();
unsigned long abqRnd(unsigned long n) { return rnd() % n; }


x86 assembly (clang, -O0):
<abqRnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rnd@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rdx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abqRnd>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rnd@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1131 <abqRnd+0x21>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @abqRnd(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @rnd()
%4 = load i64, i64* %2
%5 = urem i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @abqRnd(i64 %0) {
%2 = tail call i64 (...) @rnd()
%3 = urem i64 %2, %0
ret i64 %3
}
char *langRomTypeMsxAudio() { return "MSX Audio"; }


x86 assembly (clang, -O0):
<langRomTypeMsxAudio>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"MSX Audio\00"
define i8* @langRomTypeMsxAudio() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"MSX Audio\00"
define i8* @langRomTypeMsxAudio() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int sdeco_get();
int sdeco_get_uint16(void) {
  int h;
  unsigned int val;
  h = sdeco_get();
  if (h < 0)
    return 0;
  val = (h << 8);
  h = sdeco_get();
  if (h < 0)
    return 0;
  return val + h;
}


x86 assembly (clang, -O0):
<sdeco_get_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sdeco_get@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1138 <sdeco_get_uint16+0x28>
movl   $0x0,-0x4(%rbp)
jmp    116a <sdeco_get_uint16+0x5a>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <sdeco_get@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1161 <sdeco_get_uint16+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116a <sdeco_get_uint16+0x5a>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdeco_get_uint16>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <sdeco_get@plt>
test   %eax,%eax
js     1136 <sdeco_get_uint16+0x26>
mov    %eax,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <sdeco_get@plt>
test   %eax,%eax
js     1136 <sdeco_get_uint16+0x26>
shl    $0x8,%ebp
add    %ebp,%eax
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sdeco_get_uint16() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @sdeco_get()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %19
8: ; preds = %0
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
store i32 %10, i32* %3
%11 = call i32 (...) @sdeco_get()
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 0, i32* %1
br label %19
15: ; preds = %8
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = add i32 %16, %17
store i32 %18, i32* %1
br label %19
19: ; preds = %15, %14, %7
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @sdeco_get_uint16() {
%1 = tail call i32 (...) @sdeco_get()
%2 = icmp slt i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 (...) @sdeco_get()
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = shl i32 %1, 8
%8 = add i32 %4, %7
br label %9
9: ; preds = %3, %0, %6
%10 = phi i32 [ %8, %6 ], [ 0, %0 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ prune_add2(int);
void call_prune_add2_2_Bad() { prune_add2(10); }


x86 assembly (clang, -O0):
<call_prune_add2_2_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <prune_add2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_prune_add2_2_Bad>:
mov    $0xa,%edi
jmp    1030 <prune_add2@plt>

LLVM IR (-O0):
define void @call_prune_add2_2_Bad() {
%1 = call i32 @prune_add2(i32 10)
ret void
}

LLVM IR (-O2):
define void @call_prune_add2_2_Bad() {
%1 = tail call i32 @prune_add2(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int atob(char a) {
  if ((a == 't') || (a == 'T'))
    return 1;
  else if ((a == 'f') || (a == 'F'))
    return 0;
  else
    exit(-1);
}


x86 assembly (clang, -O0):
<atob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x74,%eax
je     1138 <atob+0x28>
movsbl -0x5(%rbp),%eax
cmp    $0x54,%eax
jne    1144 <atob+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1174 <atob+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
je     115e <atob+0x4e>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jne    116a <atob+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1174 <atob+0x64>
mov    $0xffffffff,%edi
call   1030 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atob>:
and    $0xdf,%dil
cmp    $0x46,%dil
je     1126 <atob+0x16>
mov    $0x1,%eax
cmp    $0x54,%dil
jne    1129 <atob+0x19>
ret
xor    %eax,%eax
ret
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @atob(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
%6 = icmp eq i32 %5, 116
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 84
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %23
12: ; preds = %7
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 102
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 70
br i1 %19, label %20, label %21
20: ; preds = %16, %12
store i32 0, i32* %2
br label %23
21: ; preds = %16
%22 = call i32 @exit(i32 -1)
unreachable
23: ; preds = %20, %11
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @atob(i8 signext %0) {
%2 = and i8 %0, -33
switch i8 %2, label %3 [
i8 84, label %6
i8 70, label %5
]
3: ; preds = %1
%4 = tail call i32 @exit(i32 -1)
unreachable
5: ; preds = %1
br label %6
6: ; preds = %1, %5
%7 = phi i32 [ 1, %1 ], [ 0, %5 ]
ret i32 %7
}
unsigned long f1(unsigned int x) { return __builtin_clz(x); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i64 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @f1(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = zext i32 %2 to i64
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void int32Copy(int32_t *dst, const int32_t *src) {
  assert(dst != NULL);
  assert(src != NULL);
  *dst = *src;
}


x86 assembly (clang, -O0):
<int32Copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int32Copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @int32Copy(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 ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %4
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @int32Copy(i32* writeonly %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i32* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* %1
store i32 %9, i32* %0
ret void
}
int test_imm_EFuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xEF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EFuint64_lowword_reg>:
test   $0xef,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EFuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 239
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
scalar_t__ x54x_in(int /*<<< orphan*/, void *);
uint16_t x54x_inw(uint16_t port, void *priv) {
  return ((uint16_t)x54x_in(port, priv));
}


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

x86 assembly (clang, -O2):
<x54x_inw>:
jmp    1030 <x54x_in@plt>

LLVM IR (-O0):
define i32 @x54x_inw(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i64 @x54x_in(i32 %5, i8* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @x54x_inw(i32 %0, i8* %1) {
%3 = tail call i64 @x54x_in(i32 %0, i8* %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
void gtk_editable_select_region() {}


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

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

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

LLVM IR (-O2):
define void @gtk_editable_select_region() {
ret void
}
void Code_Stop(void) {}


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

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

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

LLVM IR (-O2):
define void @Code_Stop() {
ret void
}
OP(fd, fb) {
  illegal_1();
  op_fb();
}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_fb()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mag_free(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<mag_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <mag_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mag_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int grub_strword(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (grub_strword("Hello World", "World") == 1)
    printf("Found\n");
  else
    printf("Not Found\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1030 <grub_strword@plt>
cmp    $0x1,%eax
jne    115c <main+0x3c>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
jmp    1168 <main+0x48>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <grub_strword@plt>
cmp    $0x1,%eax
lea    0xed2(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [6 x i8] c"World\00"
@.str.2 = [7 x i8] c"Found\0A\00"
@.str.3 = [11 x i8] c"Not Found\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @grub_strword(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [6 x i8] c"World\00"
@str = [10 x i8] c"Not Found\00"
@str.4 = [6 x i8] c"Found\00"
define i32 @main() {
%1 = tail call i32 @grub_strword(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WDIOC_SETOPTIONS;
int WDIOS_ENABLECARD;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
void enable_watchdog(int fd) {
  int flags = WDIOS_ENABLECARD;
  ioctl(fd, WDIOC_SETOPTIONS, &flags);
}


x86 assembly (clang, -O0):
<enable_watchdog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_watchdog>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rax
ret

LLVM IR (-O0):
@WDIOS_ENABLECARD = global i32 0
@WDIOC_SETOPTIONS = global i32 0
define void @enable_watchdog(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @WDIOS_ENABLECARD
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* @WDIOC_SETOPTIONS
%7 = call i32 @ioctl(i32 %5, i32 %6, i32* %3)
ret void
}

LLVM IR (-O2):
@WDIOS_ENABLECARD = global i32 0
@WDIOC_SETOPTIONS = global i32 0
define void @enable_watchdog(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WDIOS_ENABLECARD
store i32 %4, i32* %2
%5 = load i32, i32* @WDIOC_SETOPTIONS
%6 = call i32 @ioctl(i32 %0, i32 %5, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x05() {
  Assert_real((isdigit(5) == 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_isdigit.c",
              30, ("isdigit should be 0 for 0x05"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x05>:
push   %rax
mov    $0x5,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x05\00"
define void @t_isdigit_0x05() {
%1 = tail call i64 @isdigit(i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void queueHandleInstanceDestructor(void *instance) {}


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

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

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

LLVM IR (-O2):
define void @queueHandleInstanceDestructor(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HALT();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0x76(void) {
  HALT();
  T_WAIT_UNTIL(4);
  return;
}


x86 assembly (clang, -O0):
<op_0x76>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <HALT@plt>
mov    $0x4,%edi
call   1030 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0x76>:
push   %rax
xor    %eax,%eax
call   1040 <HALT@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0x76() {
%1 = call i32 (...) @HALT()
%2 = call i32 @T_WAIT_UNTIL(i32 4)
ret void
}

LLVM IR (-O2):
define void @op_0x76() {
%1 = tail call i32 (...) @HALT()
%2 = tail call i32 @T_WAIT_UNTIL(i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ NOTICEREF;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ NOTICEREF_it;
NOTICEREF *NOTICEREF_new(void) {
  return (NOTICEREF *)ASN1_item_new(&NOTICEREF_it);
}


x86 assembly (clang, -O0):
<NOTICEREF_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NOTICEREF_new>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@NOTICEREF_it = global i32 0
define i32* @NOTICEREF_new() {
%1 = call i64 @ASN1_item_new(i32* @NOTICEREF_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@NOTICEREF_it = global i32 0
define i32* @NOTICEREF_new() {
%1 = tail call i64 @ASN1_item_new(i32* @NOTICEREF_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
double cos(double);
double sin(double);
double tan(double rad) { return sin(rad) / cos(rad); }


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = load double, double* %2
%6 = call double @cos(double %5)
%7 = fdiv double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double @sin(double %0)
%3 = tail call double @cos(double %0)
%4 = fdiv double %2, %3
ret double %4
}