xunge/DecIR huggingface dataset:
int raiz(int x) {
  int i;
  while (x > 0) {
    x = x - i;
    i = i + 2;
  }
  if (x == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<raiz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1128 <raiz+0x28>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1107 <raiz+0x7>
cmpl   $0x0,-0x8(%rbp)
jne    113e <raiz+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <raiz+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raiz>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @raiz(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void toe_bond_neigh_propagate(struct net_device *dev, struct neighbour *neigh) {
}


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

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

LLVM IR (-O0):
%struct.net_device = type opaque
%struct.neighbour = type opaque
define void @toe_bond_neigh_propagate(%struct.net_device* %0, %struct.neighbour* %1) {
%3 = alloca %struct.net_device*
%4 = alloca %struct.neighbour*
store %struct.net_device* %0, %struct.net_device** %3
store %struct.neighbour* %1, %struct.neighbour** %4
ret void
}

LLVM IR (-O2):
%struct.net_device = type opaque
%struct.neighbour = type opaque
define void @toe_bond_neigh_propagate(%struct.net_device* nocapture %0, %struct.neighbour* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_makefile_options(void) {
  fprintf(
      stderr,
      "The code is *NOT* going to read in velocities from the group files\n");
  fprintf(stderr, "Assumes that Gadget particle ids are 4 bytes\n");
  fprintf(stderr,
          "Assumes particle load is smaller than INT_MAX (~2 billion)\n");
}


x86 assembly (clang, -O0):
<print_makefile_options>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf0b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xf24(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_makefile_options>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf15(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf35(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"The code is *NOT* going to read in velocities from the group files\0A\00"
@.str.1 = [46 x i8] c"Assumes that Gadget particle ids are 4 bytes\0A\00"
@.str.2 = [60 x i8] c"Assumes particle load is smaller than INT_MAX (~2 billion)\0A\00"
define void @print_makefile_options() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"The code is *NOT* going to read in velocities from the group files\0A\00"
@.str.1 = [46 x i8] c"Assumes that Gadget particle ids are 4 bytes\0A\00"
@.str.2 = [60 x i8] c"Assumes particle load is smaller than INT_MAX (~2 billion)\0A\00"
define void @print_makefile_options() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bar();
__attribute__((no)) int foo_1(void) { return bar(); }


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

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

LLVM IR (-O0):
define i32 @foo_1() {
%1 = call i32 (...) @bar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo_1() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void swap(char *p1, char *p2) {
  char p[20];
  strcpy(p, p1);
  strcpy(p1, p2);
  strcpy(p2, p);
}


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

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [20 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strcpy(i8* %0, i8* %1)
%7 = call i32 @strcpy(i8* %1, i8* %4)
ret void
}
/* Variables and functions */
float _expf(float);
float expf(float x) { return _expf(x); }


x86 assembly (clang, -O0):
<expf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <_expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expf>:
jmp    1030 <_expf@plt>

LLVM IR (-O0):
define float @expf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @_expf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @expf(float %0) {
%2 = tail call float @_expf(float %0)
ret float %2
}
int deref(int *a) { return *a; }


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

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

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

LLVM IR (-O2):
define i32 @deref(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ srand48(long);
__attribute__((__visibility__("default"))) void hts_srand48(long seed) {
  srand48(seed);
}


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

x86 assembly (clang, -O2):
<hts_srand48>:
jmp    1030 <srand48@plt>

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

LLVM IR (-O2):
define void @hts_srand48(i64 %0) {
%2 = tail call i32 @srand48(i64 %0)
ret void
}
/* Variables and functions */
float powf(float, float);
float sinf(float);
float elastic_ease_out(float p) {
  return sinf(-13.0f * 1.5707963268f * (p + 1.0f)) * powf(2.0f, -10.0f * p) +
         1.0f;
}


x86 assembly (clang, -O0):
<elastic_ease_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecb(%rip),%xmm1
addss  -0x4(%rbp),%xmm1
movss  0xeca(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xeb0(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xe9f(%rip),%xmm0
call   1040 <powf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  0xe82(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elastic_ease_out>:
push   %rax
movss  %xmm0,(%rsp)
addss  0xed2(%rip),%xmm0
mulss  0xece(%rip),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
mulss  0xeba(%rip),%xmm0
call   1040 <exp2f@plt>
mulss  0x4(%rsp),%xmm0
addss  0xe9f(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @elastic_ease_out(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 1.000000e+00
%5 = fmul float 0xC0346B9C40000000, %4
%6 = call float @sinf(float %5)
%7 = load float, float* %2
%8 = fmul float -1.000000e+01, %7
%9 = call float @powf(float 2.000000e+00, float %8)
%10 = call float @llvm.fmuladd.f32(float %6, float %9, float 1.000000e+00)
ret float %10
}

LLVM IR (-O2):
define float @elastic_ease_out(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fmul float %2, 0xC0346B9C40000000
%4 = tail call float @sinf(float %3)
%5 = fmul float %0, -1.000000e+01
%6 = tail call float @exp2f(float %5)
%7 = tail call float @llvm.fmuladd.f32(float %4, float %6, float 1.000000e+00)
ret float %7
}
void RTLinuxSysFsReadDevNumFile(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLinuxSysFsReadDevNumFile() {
ret void
}
unsigned xrop3_171_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_171_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_171_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x8,%esi
or     %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_171_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_171_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int num;
  printf("Digite um numero: ");
  scanf("%d", &num);
  if (num)
    printf("Mensagem um.\n");
  else
    printf("Mensagem dois.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
je     115f <main+0x3f>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    116b <main+0x4b>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xebc(%rip),%rax
lea    0xec4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"Mensagem um.\0A\00"
@.str.3 = [16 x i8] c"Mensagem dois.\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [15 x i8] c"Mensagem dois.\00"
@str.4 = [13 x i8] c"Mensagem um.\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("info coreutils - man printf \n \200");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@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 = [32 x i8] c"info coreutils - man printf \0A \80\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"info coreutils - man printf \0A \80\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int strlen(const char *a) {
  int ans = 0;
  while (*a++)
    ans++;
  return ans;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void rop3_126_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = *D ^ S;
  stk1 = stk1 | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_126_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_126_0_1>:
mov    %edx,%eax
xor    %sil,%al
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %sil,%cl
or     %al,%cl
mov    %edx,%eax
not    %al
or     %sil,%al
and    %cl,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_126_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = or i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = load i8, i8* %5
%31 = zext i8 %30 to i32
%32 = and i32 %29, %31
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = or i32 %32, %38
%40 = load i8, i8* %6
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = xor i32 %43, -1
%45 = and i32 %41, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = and i32 %45, %48
%50 = or i32 %39, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_126_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %1
%7 = or i8 %6, %4
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %7, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %5
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ my_readdir(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("usage: %s <target path>\n", argv[0]);
    exit(1);
  }
  if (my_readdir(argv[1]) < 0) {
    exit(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)
jge    116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <my_readdir@plt>
cmp    $0x0,%rax
jge    118e <main+0x5e>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1148 <main+0x18>
mov    0x8(%rsi),%rdi
call   1050 <my_readdir@plt>
test   %rax,%rax
js     1157 <main+0x27>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"usage: %s <target path>\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 slt 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 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @my_readdir(i8* %17)
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"usage: %s <target path>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @my_readdir(i8* %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %8
ret i32 0
}
/* Type definitions */
struct ssh_string_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ssh_string_struct *);
void ssh_string_free(struct ssh_string_struct *s) {
  do {
    if ((s) != NULL) {
      free(s);
      s = NULL;
    }
  } while (0);
}


x86 assembly (clang, -O0):
<ssh_string_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <ssh_string_free+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    113d <ssh_string_free+0x2d>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.ssh_string_struct = type { i32 }
define void @ssh_string_free(%struct.ssh_string_struct* %0) {
%2 = icmp eq %struct.ssh_string_struct* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.ssh_string_struct* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int const uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t host_word_parity(uint32_t w) {
  static const uint32_t p32 = 0x96696996;
  uint32_t parity = 0;
  while (w) {
    uint8_t bits = w & 037;
    parity ^= (p32 >> bits) & 1;
    w >>= 5;
  }
  return parity;
}


x86 assembly (clang, -O0):
<host_word_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <host_word_parity+0x42>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x96696996,%eax
sar    %cl,%eax
and    $0x1,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <host_word_parity+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_word_parity>:
test   %edi,%edi
je     1127 <host_word_parity+0x27>
mov    %edi,%ecx
xor    %eax,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
mov    $0x96696996,%esi
shr    %cl,%esi
and    $0x1,%esi
xor    %esi,%eax
sar    $0x5,%edx
cmp    $0x1f,%ecx
mov    %edx,%ecx
ja     1110 <host_word_parity+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@host_word_parity.p32 = internal constant i32 -1771476586
define i32 @host_word_parity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, 31
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = ashr i32 -1771476586, %11
%13 = and i32 %12, 1
%14 = load i32, i32* %3
%15 = xor i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = ashr i32 %16, 5
store i32 %17, i32* %2
br label %5
18: ; preds = %5
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @host_word_parity(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = and i32 %4, 31
%7 = lshr i32 -1771476586, %6
%8 = and i32 %7, 1
%9 = xor i32 %8, %5
%10 = ashr i32 %4, 5
%11 = icmp ult i32 %4, 32
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void usrError(const char *msg) {
  fprintf(stdout, "%s\n\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<usrError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usrError>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"%s\0A\0A\00"
define void @usrError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%s\0A\0A\00"
define void @usrError(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cli_init();
int /*<<< orphan*/ cli_parse(int, char **);
int /*<<< orphan*/ jc_print();
int main(int argc, char *argv[]) {
  jc_print();
  cli_init();
  cli_parse(argc, argv);
  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)
mov    $0x0,%al
call   1040 <jc_print@plt>
mov    $0x0,%al
call   1050 <cli_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cli_parse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <jc_print@plt>
xor    %eax,%eax
call   1050 <cli_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <cli_parse@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @jc_print()
%7 = call i32 (...) @cli_init()
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @cli_parse(i32 %8, i8** %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @jc_print()
%4 = tail call i32 (...) @cli_init()
%5 = tail call i32 @cli_parse(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int min_ii(int /*<<< orphan*/, int);
int /*<<< orphan*/ min_iii(int, int, int);
int min_iiii(int a, int b, int c, int d) { return min_ii(min_iii(a, b, c), d); }


x86 assembly (clang, -O0):
<min_iiii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <min_iii@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%esi
call   1040 <min_ii@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_iiii>:
push   %rbx
mov    %ecx,%ebx
call   1030 <min_iii@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <min_ii@plt>

LLVM IR (-O0):
define i32 @min_iiii(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @min_iii(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %8
%14 = call i32 @min_ii(i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @min_iiii(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @min_iii(i32 %0, i32 %1, i32 %2)
%6 = tail call i32 @min_ii(i32 %5, i32 %3)
ret i32 %6
}
int abs_is_98(int elem) { return (elem == 98 || -elem == 98); }


x86 assembly (clang, -O0):
<abs_is_98>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x62,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1124 <abs_is_98+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cmp    $0x62,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_is_98>:
cmp    $0x62,%edi
sete   %al
cmp    $0xffffff9e,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @abs_is_98(i32 %0) {
%2 = icmp eq i32 %0, 98
%3 = icmp eq i32 %0, -98
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __NR_ioctl;
int ppc_syscall(int /*<<< orphan*/, int, int, void *);
int ppc_ioctl(int fd, int ioctl_nr, void *data) {
  return ppc_syscall(__NR_ioctl, fd, ioctl_nr, data);
}


x86 assembly (clang, -O0):
<ppc_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <ppc_syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppc_ioctl>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ppc_syscall@plt>

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

LLVM IR (-O2):
@__NR_ioctl = global i32 0
define i32 @ppc_ioctl(i32 %0, i32 %1, i8* %2) {
%4 = load i32, i32* @__NR_ioctl
%5 = tail call i32 @ppc_syscall(i32 %4, i32 %0, i32 %1, i8* %2)
ret i32 %5
}
/* Variables and functions */
int hmt_check_all_coverage();
int hmt_run_all_tests();
int main() {
  int tests_failed = hmt_run_all_tests();
  int coverage_failed = hmt_check_all_coverage();
  return tests_failed || coverage_failed;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <hmt_run_all_tests@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <hmt_check_all_coverage@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    115c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <hmt_run_all_tests@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <hmt_check_all_coverage@plt>
xor    %ecx,%ecx
or     %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hmt_run_all_tests()
%2 = tail call i32 (...) @hmt_check_all_coverage()
%3 = icmp ne i32 %1, 0
%4 = icmp ne i32 %2, 0
%5 = select i1 %3, i1 true, i1 %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("Hello World\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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 = [13 x i8] c"Hello World\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 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
osfinish(void) {}


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

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

LLVM IR (-O0):
define i32 @osfinish() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @osfinish() {
ret i32 undef
}
void I422ToRGBARow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I422ToRGBARow_Any_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_uci_info(void) {
  printf("id name alexchess\n");
  printf("id author Alex Thomson\n\n");
  printf("uciok\n");
}


x86 assembly (clang, -O0):
<show_uci_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_uci_info>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"id name alexchess\0A\00"
@.str.1 = [25 x i8] c"id author Alex Thomson\0A\0A\00"
@.str.2 = [7 x i8] c"uciok\0A\00"
define void @show_uci_info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"id name alexchess\00"
@str.3 = [24 x i8] c"id author Alex Thomson\0A\00"
@str.4 = [6 x i8] c"uciok\00"
define void @show_uci_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WDOG1_DriverIRQHandler();
__attribute__((weak)) void WDOG1_IRQHandler(void) { WDOG1_DriverIRQHandler(); }


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

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

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

LLVM IR (-O2):
define weak void @WDOG1_IRQHandler() {
%1 = tail call i32 (...) @WDOG1_DriverIRQHandler()
ret void
}
void sm_abort_defaulthandler(filename, lineno, msg) const char *filename;
int lineno;
const char *msg;
{}


x86 assembly (clang, -O0):
<sm_abort_defaulthandler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sm_abort_defaulthandler(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void _erase_all(void) { fprintf(stdout, "\x1B[2J"); }


x86 assembly (clang, -O0):
<_erase_all>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_erase_all>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
define void @_erase_all() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
define void @_erase_all() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() { return 1 >> 32; }


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

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

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

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

/* Variables and functions */
int fget_u8(int /*<<< orphan*/ *);
unsigned fget_u16l(FILE *f) {
  unsigned res;
  res = fget_u8(f);
  res = res | (fget_u8(f) << 8);
  return res;
}


x86 assembly (clang, -O0):
<fget_u16l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fget_u8@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fget_u8@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget_u16l>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fget_u8@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fget_u8@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fget_u16l(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fget_u8(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @fget_u8(i32* %7)
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @fget_u16l(i32* %0) {
%2 = tail call i32 @fget_u8(i32* %0)
%3 = tail call i32 @fget_u8(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char fgetc(int /*<<< orphan*/ *);
int ftell(int /*<<< orphan*/ *);
unsigned char my_fgetc(FILE *fin) {
  switch (ftell(fin)) {
  case 0x28c4:
  case 0x2b67:
  case 0x2fd4:
    fgetc(fin);
    break;
  default:
    break;
  };
  return fgetc(fin);
}


x86 assembly (clang, -O0):
<my_fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0x28c4,%eax
je     1170 <my_fgetc+0x50>
jmp    114a <my_fgetc+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2b67,%eax
je     1170 <my_fgetc+0x50>
jmp    115d <my_fgetc+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x2fd4,%eax
jne    117e <my_fgetc+0x5e>
jmp    1170 <my_fgetc+0x50>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
jmp    1183 <my_fgetc+0x63>
jmp    1183 <my_fgetc+0x63>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fgetc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ftell@plt>
cmp    $0x28c4,%eax
je     113e <my_fgetc+0x1e>
cmp    $0x2fd4,%eax
je     113e <my_fgetc+0x1e>
cmp    $0x2b67,%eax
jne    1146 <my_fgetc+0x26>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
define zeroext i8 @my_fgetc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ftell(i32* %3)
switch i32 %4, label %8 [
i32 10436, label %5
i32 11111, label %5
i32 12244, label %5
]
5: ; preds = %1, %1, %1
%6 = load i32*, i32** %2
%7 = call zeroext i8 @fgetc(i32* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = load i32*, i32** %2
%11 = call zeroext i8 @fgetc(i32* %10)
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @my_fgetc(i32* nocapture %0) {
%2 = tail call i32 @ftell(i32* %0)
switch i32 %2, label %5 [
i32 10436, label %3
i32 11111, label %3
i32 12244, label %3
]
3: ; preds = %1, %1, %1
%4 = tail call zeroext i8 @fgetc(i32* %0)
br label %5
5: ; preds = %1, %3
%6 = tail call zeroext i8 @fgetc(i32* %0)
ret i8 %6
}
void usage_fault(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<usage_fault>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <usage_fault+0x9>
jmp    1109 <usage_fault+0x9>

x86 assembly (clang, -O2):
<usage_fault>:
jmp    1100 <usage_fault>

LLVM IR (-O0):
define void @usage_fault() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @usage_fault() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct entry_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_new();
struct entry_list *entry_list_new(void) {
  return (struct entry_list *)genlist_new();
}


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

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

LLVM IR (-O0):
%struct.entry_list = type { i32 }
define %struct.entry_list* @entry_list_new() {
%1 = call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.entry_list*
ret %struct.entry_list* %2
}

LLVM IR (-O2):
%struct.entry_list = type { i32 }
define %struct.entry_list* @entry_list_new() {
%1 = tail call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.entry_list*
ret %struct.entry_list* %2
}
unsigned short toASCIILower(unsigned short c) {
  return c | ((c >= 'A' && c <= 'Z') << 5);
}


x86 assembly (clang, -O0):
<toASCIILower>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1131 <toASCIILower+0x31>
movzwl -0x2(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x3(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toASCIILower>:
lea    -0x41(%rdi),%ecx
xor    %eax,%eax
cmp    $0x1a,%cx
setb   %al
shl    $0x5,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @toASCIILower(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = icmp sle i32 %10, 90
br label %12
12: ; preds = %8, %1
%13 = phi i1 [ false, %1 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = shl i32 %14, 5
%16 = or i32 %4, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @toASCIILower(i16 zeroext %0) {
%2 = add i16 %0, -65
%3 = icmp ult i16 %2, 26
%4 = select i1 %3, i16 32, i16 0
%5 = or i16 %4, %0
ret i16 %5
}