xunge/DecIR huggingface dataset:
long PTRACE(req, pid, addr, data)
long *req, *pid, *addr, *data;
{ return ((long)ptrace(*req, *pid, *addr, *data)); }


x86 assembly (clang, -O0):
<PTRACE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    $0x0,%al
call   1030 <ptrace@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PTRACE>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    (%rdx),%rdx
mov    (%rcx),%rcx
xor    %eax,%eax
call   1030 <ptrace@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @PTRACE(i64* %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = load i64*, i64** %6
%12 = load i64, i64* %11
%13 = load i64*, i64** %7
%14 = load i64, i64* %13
%15 = load i64*, i64** %8
%16 = load i64, i64* %15
%17 = call i32 (i64, i64, i64, i64, ...) bitcast (i32 (...)* @ptrace to i32 (i64, i64, i64, i64, ...)*)(i64 %10, i64 %12, i64 %14, i64 %16)
%18 = sext i32 %17 to i64
ret i64 %18
}

LLVM IR (-O2):
define i64 @PTRACE(i64* nocapture %0, i64* nocapture %1, i64* nocapture %2, i64* nocapture %3) {
%5 = load i64, i64* %0
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = tail call i32 (i64, i64, i64, i64, ...) bitcast (i32 (...)* @ptrace to i32 (i64, i64, i64, i64, ...)*)(i64 %5, i64 %6, i64 %7, i64 %8)
%10 = sext i32 %9 to i64
ret i64 %10
}
int get_cutoff_line(int sample_rate, int fmax_line_offset, int bandwidth) {
  float fmax;
  float delta_f;
  int offset;
  fmax = (float)sample_rate / 2.;
  delta_f = fmax / fmax_line_offset;
  offset = (int)((float)bandwidth / delta_f);
  return offset;
}


x86 assembly (clang, -O0):
<get_cutoff_line>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cutoff_line>:
cvtsi2ss %edi,%xmm0
mulss  0xef4(%rip),%xmm0
cvtsi2ss %esi,%xmm1
cvtsi2ss %edx,%xmm2
divss  %xmm1,%xmm0
divss  %xmm0,%xmm2
cvttss2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @get_cutoff_line(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to float
%12 = fpext float %11 to double
%13 = fdiv double %12, 2.000000e+00
%14 = fptrunc double %13 to float
store float %14, float* %7
%15 = load float, float* %7
%16 = load i32, i32* %5
%17 = sitofp i32 %16 to float
%18 = fdiv float %15, %17
store float %18, float* %8
%19 = load i32, i32* %6
%20 = sitofp i32 %19 to float
%21 = load float, float* %8
%22 = fdiv float %20, %21
%23 = fptosi float %22 to i32
store i32 %23, i32* %9
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
define i32 @get_cutoff_line(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to float
%5 = fmul float %4, 5.000000e-01
%6 = sitofp i32 %1 to float
%7 = fdiv float %5, %6
%8 = sitofp i32 %2 to float
%9 = fdiv float %8, %7
%10 = fptosi float %9 to i32
ret i32 %10
}
/* Variables and functions */
int hotpo(int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int n = 5;
  printf("%d", hotpo(n));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <hotpo@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @hotpo(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
char get_keyboard_entry() {
  char buffer[2];
  scanf("%1s", buffer);
  return buffer[0];
}


x86 assembly (clang, -O0):
<get_keyboard_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rsi
lea    0xedd(%rip),%rdi
call   1030 <scanf@plt>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_keyboard_entry>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x6(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x6(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%1s\00"
define signext i8 @get_keyboard_entry() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
ret i8 %4
}
/* Type definitions */
struct orphan {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct orphan *);
void free_orphan(struct orphan *orphan) { kfree(orphan); }


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

x86 assembly (clang, -O2):
<free_orphan>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
%struct.orphan = type { i32 }
define void @free_orphan(%struct.orphan* %0) {
%2 = tail call i32 @kfree(%struct.orphan* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ take_d(float);
take_f(float f) { take_d(f); }


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

x86 assembly (clang, -O2):
<take_f>:
jmp    1030 <take_d@plt>

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

LLVM IR (-O2):
define i32 @take_f(float %0) {
%2 = tail call i32 @take_d(float %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeFileArgs(char **args) {
  char **a;
  for (a = args; *a; a++)
    free(*a);
  free((char *)args);
}


x86 assembly (clang, -O0):
<freeFileArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <freeFileArgs+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <freeFileArgs+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeFileArgs>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freeFileArgs+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freeFileArgs+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeFileArgs(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i8** [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @free(i8* %5)
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = bitcast i8** %0 to i8*
%13 = tail call i32 @free(i8* %12)
ret void
}
void Convert8To16Row_C() {}


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

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

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

LLVM IR (-O2):
define void @Convert8To16Row_C() {
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
scalar_t__ clock();
void delay(unsigned int sec) {
  clock_t ticks1 = clock();
  clock_t ticks2 = ticks1;
  while ((ticks2 / CLOCKS_PER_SEC - ticks1 / CLOCKS_PER_SEC) < (clock_t)sec)
    ticks2 = clock();
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2eaf(%rip),%rcx
cqto
idivq  (%rcx)
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2e9b(%rip),%rcx
cqto
idivq  (%rcx)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    -0x4(%rbp),%ecx
cmp    %rcx,%rax
jge    1178 <delay+0x68>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
jmp    112e <delay+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <clock@plt>
test   %ebp,%ebp
je     117a <delay+0x6a>
mov    %rax,%rbx
mov    %ebp,%ebp
mov    0x2ebb(%rip),%r14
jmp    1140 <delay+0x30>
nop
mov    %rbx,%rax
cqto
idiv   %rsi
sub    %rax,%rcx
cmp    %rbp,%rcx
jge    117a <delay+0x6a>
xor    %eax,%eax
call   1030 <clock@plt>
mov    (%r14),%rsi
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1160 <delay+0x50>
cqto
idiv   %rsi
mov    %rax,%rcx
jmp    1166 <delay+0x56>
xor    %edx,%edx
div    %esi
mov    %eax,%ecx
mov    %rbx,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1130 <delay+0x20>
mov    %ebx,%eax
xor    %edx,%edx
div    %esi
jmp    1138 <delay+0x28>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = call i64 (...) @clock()
store i64 %5, i64* %3
%6 = load i64, i64* %3
store i64 %6, i64* %4
br label %7
7: ; preds = %18, %1
%8 = load i64, i64* %4
%9 = load i64, i64* @CLOCKS_PER_SEC
%10 = sdiv i64 %8, %9
%11 = load i64, i64* %3
%12 = load i64, i64* @CLOCKS_PER_SEC
%13 = sdiv i64 %11, %12
%14 = sub nsw i64 %10, %13
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = icmp slt i64 %14, %16
br i1 %17, label %18, label %20
18: ; preds = %7
%19 = call i64 (...) @clock()
store i64 %19, i64* %4
br label %7
20: ; preds = %7
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define void @delay(i32 %0) {
%2 = tail call i64 (...) @clock()
%3 = zext i32 %0 to i64
%4 = icmp eq i32 %0, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = tail call i64 (...) @clock()
%7 = load i64, i64* @CLOCKS_PER_SEC
%8 = sdiv i64 %6, %7
%9 = sdiv i64 %2, %7
%10 = sub nsw i64 %8, %9
%11 = icmp slt i64 %10, %3
br i1 %11, label %5, label %12
12: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
float roundInt(float);
int main() {
  float delta = 0.03125;
  float a[3];
  a[1] = -0.375;
  float b = roundInt(a[1] / delta);
  assert(b == -13.0f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xed8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xec7(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
call   1040 <roundInt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe9d(%rip),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1040 <roundInt@plt>
cmpeqss 0xecd(%rip),%xmm0
movd   %xmm0,%edi
and    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca [3 x float]
%3 = alloca float
store float 3.125000e-02, float* %1
%4 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
store float -3.750000e-01, float* %4
%5 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
%6 = load float, float* %5
%7 = load float, float* %1
%8 = fdiv float %6, %7
%9 = call float @roundInt(float %8)
store float %9, float* %3
%10 = load float, float* %3
%11 = fcmp oeq float %10, -1.300000e+01
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float @roundInt(float -1.200000e+01)
%2 = fcmp oeq float %1, -1.300000e+01
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
void async_synchronize_full(void) {}


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

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

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

LLVM IR (-O2):
define void @async_synchronize_full() {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ free(char *);
scalar_t__ jelopt(char **, int, char *, char **, int *);
int jelopt_int(char **argv, int opt_short, char *opt_long, int *value,
               int *err) {
  char *cvalue;
  if (jelopt(argv, opt_short, opt_long, &cvalue, err)) {
    *value = atoi(cvalue);
    free(cvalue);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<jelopt_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%r8
lea    -0x38(%rbp),%rcx
call   1050 <jelopt@plt>
cmp    $0x0,%rax
je     1193 <jelopt_int+0x63>
mov    -0x38(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    119a <jelopt_int+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jelopt_int>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsp,%rcx
call   1050 <jelopt@plt>
test   %rax,%rax
je     1162 <jelopt_int+0x32>
mov    (%rsp),%rbx
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %eax,(%r14)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
jmp    1164 <jelopt_int+0x34>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @jelopt_int(i8** %0, i32 %1, i8* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8*
store i8** %0, i8*** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
%13 = load i8**, i8*** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32*, i32** %11
%17 = call i64 @jelopt(i8** %13, i32 %14, i8* %15, i8** %12, i32* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %5
%20 = load i8*, i8** %12
%21 = call i32 @atoi(i8* %20)
%22 = load i32*, i32** %10
store i32 %21, i32* %22
%23 = load i8*, i8** %12
%24 = call i32 @free(i8* %23)
store i32 1, i32* %6
br label %26
25: ; preds = %5
store i32 0, i32* %6
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %6
ret i32 %27
}

LLVM IR (-O2):
define i32 @jelopt_int(i8** %0, i32 %1, i8* %2, i32* nocapture writeonly %3, i32* %4) {
%6 = alloca i8*
%7 = bitcast i8** %6 to i8*
%8 = call i64 @jelopt(i8** %0, i32 %1, i8* %2, i8** %6, i32* %4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = load i8*, i8** %6
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %3
%13 = call i32 @free(i8* %11)
br label %14
14: ; preds = %5, %10
%15 = phi i32 [ 1, %10 ], [ 0, %5 ]
ret i32 %15
}
int Prec(char ch) {
  switch (ch) {
  case '+':
  case '-':
    return 1;
  case '*':
  case '/':
    return 2;
  case '^':
    return 3;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<Prec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2a,%eax
je     116f <Prec+0x6f>
jmp    111f <Prec+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     1163 <Prec+0x63>
jmp    1130 <Prec+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1163 <Prec+0x63>
jmp    1141 <Prec+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     116f <Prec+0x6f>
jmp    1152 <Prec+0x52>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     117b <Prec+0x7b>
jmp    1187 <Prec+0x87>
movl   $0x1,-0x4(%rbp)
jmp    118e <Prec+0x8e>
movl   $0x2,-0x4(%rbp)
jmp    118e <Prec+0x8e>
movl   $0x3,-0x4(%rbp)
jmp    118e <Prec+0x8e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Prec>:
lea    -0x2a(%rdi),%ecx
cmp    $0x5,%ecx
ja     1123 <Prec+0x23>
mov    $0x1,%eax
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x2,%eax
ret
cmp    $0x5e,%edi
jne    112e <Prec+0x2e>
mov    $0x3,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @Prec(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 94, label %8
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %10
7: ; preds = %1, %1
store i32 2, i32* %2
br label %10
8: ; preds = %1
store i32 3, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @Prec(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 43, label %6
i32 45, label %6
i32 42, label %3
i32 47, label %3
i32 94, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3
%7 = phi i32 [ -1, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void exit_handler(int sig) {
  cleanup();
  if (sig)
    printf("Exiting on signal %d\n", sig);
  exit(0);
}


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cleanup@plt>
cmpl   $0x0,-0x4(%rbp)
je     115b <exit_handler+0x2b>
mov    -0x4(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <cleanup@plt>
test   %ebx,%ebx
je     114c <exit_handler+0x1c>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Exiting on signal %d\0A\00"
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Exiting on signal %d\0A\00"
define void @exit_handler(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @exit(i32 0)
unreachable
}
void __divide_error(void) { asm volatile("int $0"); }


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

x86 assembly (clang, -O2):
<__divide_error>:
int    $0x0
ret

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

LLVM IR (-O2):
define void @__divide_error() {
tail call void asm sideeffect "int $$0", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toupper(int);
char *strupr(char *string) {
  int c;
  while ((c = *string) != 0) {
    *string++ = toupper(c);
  }
  return (string);
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     114f <strupr+0x3f>
mov    -0xc(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111c <strupr+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%cl
test   %cl,%cl
je     113d <strupr+0x2d>
nopw   0x0(%rax,%rax,1)
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    %eax,%ecx
lea    0x1(%rbx),%rax
mov    %cl,(%rbx)
movzbl 0x1(%rbx),%ecx
mov    %rax,%rbx
test   %cl,%cl
jne    1120 <strupr+0x10>
pop    %rbx
ret
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @toupper(i32 %7)
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_arguments_message() {
  printf("O programa precisa de pelo menos 3 argumentos: \n");
  printf("1) O valor de a\n");
  printf("2) O valor de b\n");
  printf("3) O valor p que será o módulo da equação\n");
}


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

x86 assembly (clang, -O2):
<print_arguments_message>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"O programa precisa de pelo menos 3 argumentos: \0A\00"
@.str.1 = [17 x i8] c"1) O valor de a\0A\00"
@.str.2 = [17 x i8] c"2) O valor de b\0A\00"
@.str.3 = [47 x i8] c"3) O valor p que ser\C3\A1 o m\C3\B3dulo da equa\C3\A7\C3\A3o\0A\00"
define void @print_arguments_message() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"O programa precisa de pelo menos 3 argumentos: \00"
@str.4 = [16 x i8] c"1) O valor de a\00"
@str.5 = [16 x i8] c"2) O valor de b\00"
@str.6 = [46 x i8] c"3) O valor p que ser\C3\A1 o m\C3\B3dulo da equa\C3\A7\C3\A3o\00"
define void @print_arguments_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int pixel_satd_wxh(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int, int,
                   int);
int pixel_satd_16x16(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                     int i_stride_pix2) {
  return pixel_satd_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 16, 16);
}


x86 assembly (clang, -O0):
<pixel_satd_16x16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x10,%r9d
mov    %r9d,%r8d
call   1030 <pixel_satd_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_satd_16x16>:
mov    $0x10,%r8d
mov    $0x10,%r9d
jmp    1030 <pixel_satd_wxh@plt>

LLVM IR (-O0):
define i32 @pixel_satd_16x16(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 = load i32, i32* %8
%13 = call i32 @pixel_satd_wxh(i32* %9, i32 %10, i32* %11, i32 %12, i32 16, i32 16)
ret i32 %13
}

LLVM IR (-O2):
define i32 @pixel_satd_16x16(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @pixel_satd_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 16, i32 16)
ret i32 %5
}
void dsp_time(int nline, const char *str) {}


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

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

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

LLVM IR (-O2):
define void @dsp_time(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(int);
int my_put_nbr(int nb) {
  if (nb < 0) {
    nb = -nb;
    my_putchar('-');
  }
  if (nb >= 10)
    my_put_nbr(nb / 10);
  my_putchar(nb % 10 + '0');
  return (0);
}


x86 assembly (clang, -O0):
<my_put_nbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1147 <my_put_nbr+0x27>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x2d,%edi
call   1040 <my_putchar@plt>
cmpl   $0xa,-0x4(%rbp)
jl     1163 <my_put_nbr+0x43>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <my_put_nbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1040 <my_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_put_nbr>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jns    1136 <my_put_nbr+0x16>
neg    %ebx
mov    $0x2d,%edi
call   1040 <my_putchar@plt>
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     1150 <my_put_nbr+0x30>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1030 <my_put_nbr@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
call   1040 <my_putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @my_put_nbr(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = tail call i32 @my_putchar(i32 45)
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %4, %3 ], [ %0, %1 ]
%8 = icmp ugt i32 %7, 9
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = udiv i32 %7, 10
%11 = tail call i32 @my_put_nbr(i32 %10)
br label %12
12: ; preds = %9, %6
%13 = urem i32 %7, 10
%14 = or i32 %13, 48
%15 = tail call i32 @my_putchar(i32 %14)
ret i32 0
}
int precedence(char operator) {
  switch (operator) {
  case 0:
  case ')':
    return 0;
  case '+':
  case '-':
    return 1;
  case '*':
  case '/':
    return 2;
  }
}


x86 assembly (clang, -O0):
<precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1173 <precedence+0x73>
jmp    111e <precedence+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x29,%eax
je     1173 <precedence+0x73>
jmp    112f <precedence+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x2a,%eax
je     118b <precedence+0x8b>
jmp    1140 <precedence+0x40>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     117f <precedence+0x7f>
jmp    1151 <precedence+0x51>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     117f <precedence+0x7f>
jmp    1162 <precedence+0x62>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     118b <precedence+0x8b>
jmp    1192 <precedence+0x92>
movl   $0x0,-0x4(%rbp)
jmp    1192 <precedence+0x92>
movl   $0x1,-0x4(%rbp)
jmp    1192 <precedence+0x92>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedence>:
add    $0xffffffd6,%edi
xor    %eax,%eax
cmp    $0x5,%edi
ja     1117 <precedence+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @precedence(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 0, label %6
i32 41, label %6
i32 43, label %7
i32 45, label %7
i32 42, label %8
i32 47, label %8
]
6: ; preds = %1, %1
store i32 0, i32* %2
br label %9
7: ; preds = %1, %1
store i32 1, i32* %2
br label %9
8: ; preds = %1, %1
store i32 2, i32* %2
br label %9
9: ; preds = %6, %7, %8, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@switch.table.precedence = [6 x i32] [i32 2, i32 1, i32 0, i32 1, i32 0, i32 2]
define i32 @precedence(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -42
%4 = icmp ult i32 %3, 6
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.precedence, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
void nseel_asm_mod(void) {
  __asm__("fabs\n"
          "fistpl (%esi)\n"
          "fabs\n"
          "fistpl 4(%esi)\n"
          "xorl %edx, %edx\n"
          "cmpl $0, (%esi)\n"
          "je 0f\n"
          "movl 4(%esi), %eax\n"
          "divl (%esi)\n"
          "0:\n"
          "movl %edx, (%esi)\n"
          "fildl (%esi)\n");
}


x86 assembly (clang, -O0):
<nseel_asm_mod>:
push   %rbp
mov    %rsp,%rbp
fabs
fistpl (%esi)
fabs
fistpl 0x4(%esi)
xor    %edx,%edx
cmpl   $0x0,(%esi)
je     1122 <nseel_asm_mod+0x22>
mov    0x4(%esi),%eax
divl   (%esi)
mov    %edx,(%esi)
fildl  (%esi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_mod>:
fabs
fistpl (%esi)
fabs
fistpl 0x4(%esi)
xor    %edx,%edx
cmpl   $0x0,(%esi)
je     111a <nseel_asm_mod+0x1a>
mov    0x4(%esi),%eax
divl   (%esi)
mov    %edx,(%esi)
fildl  (%esi)
ret

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

LLVM IR (-O2):
define void @nseel_asm_mod() {
tail call void asm sideeffect "fabs\0Afistpl (%esi)\0Afabs\0Afistpl 4(%esi)\0Axorl %edx, %edx\0Acmpl $$0, (%esi)\0Aje 0f\0Amovl 4(%esi), %eax\0Adivl (%esi)\0A0:\0Amovl %edx, (%esi)\0Afildl (%esi)\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int is_str_var_delimiter(c)
char c;
{ return (c == '*'); }


x86 assembly (clang, -O0):
<is_str_var_delimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_str_var_delimiter>:
xor    %eax,%eax
cmp    $0x2a,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_str_var_delimiter(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 42
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_str_var_delimiter(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 42
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ perror(char *);
void forkc(void (*child)(), void (*parent)()) {
  pid_t pid;
  switch (pid = fork()) {
  case -1:
    perror("fork()");
    exit(EXIT_FAILURE);
  case 0:
    child();
    break;
  default:
    parent();
  }
}


x86 assembly (clang, -O0):
<forkc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
sub    $0xffffffff,%eax
je     116d <forkc+0x3d>
jmp    115d <forkc+0x2d>
mov    -0x18(%rbp),%eax
test   %eax,%eax
je     1187 <forkc+0x57>
jmp    1191 <forkc+0x61>
lea    0xe8c(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   *-0x8(%rbp)
jmp    1196 <forkc+0x66>
mov    $0x0,%al
call   *-0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forkc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
mov    %rbx,%rcx
test   %eax,%eax
je     1150 <forkc+0x20>
cmp    $0xffffffff,%eax
je     115b <forkc+0x2b>
mov    %r14,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rcx
lea    0xe9e(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"fork()\00"
@EXIT_FAILURE = global i32 0
define void @forkc(void (...)* %0, void (...)* %1) {
%3 = alloca void (...)*
%4 = alloca void (...)*
%5 = alloca i32
store void (...)* %0, void (...)** %3
store void (...)* %1, void (...)** %4
%6 = call i32 (...) @fork()
store i32 %6, i32* %5
switch i32 %6, label %13 [
i32 -1, label %7
i32 0, label %11
]
7: ; preds = %2
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = load void (...)*, void (...)** %3
br label %15
13: ; preds = %2
%14 = load void (...)*, void (...)** %4
br label %15
15: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"fork()\00"
@EXIT_FAILURE = global i32 0
define void @forkc(void (...)* nocapture %0, void (...)* nocapture %1) {
%3 = tail call i32 (...) @fork()
switch i32 %3, label %8 [
i32 -1, label %4
i32 0, label %9
]
4: ; preds = %2
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
br label %9
9: ; preds = %2, %8
%10 = phi void (...)* [ %1, %8 ], [ %0, %2 ]
tail call void (...) %10()
ret void
}
void XSetSelectionOwner() {}


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

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

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

LLVM IR (-O2):
define void @XSetSelectionOwner() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Object_Destruct(void *data) {
  free(data);
  return;
}


x86 assembly (clang, -O0):
<Object_Destruct>:
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):
<Object_Destruct>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @Object_Destruct(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 @Object_Destruct(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int Bar9(int, int, int, int, int, int, int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int total;
  total = Bar9(1, 2, 3, 4, 5, 6, 7, 8, 9);
  printf("main: total = %d\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x9,0x10(%rsp)
call   1040 <Bar9@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x9
push   $0x8
push   $0x7
call   1040 <Bar9@plt>
add    $0x20,%rsp
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"main: total = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @Bar9(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) {
  printf("Usage: %s grib_file\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s grib_file\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int JSHash(unsigned char *str) {
  unsigned int hash = 1315423911;
  int c;
  while ((c = *str++)) {
    hash ^= ((hash << 5) + c + (hash >> 2));
  }
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<JSHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x4e67c6a7,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1149 <JSHash+0x49>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <JSHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<JSHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1134 <JSHash+0x34>
add    $0x1,%rdi
mov    $0x4e67c6a7,%eax
nop
mov    %eax,%edx
movzbl %cl,%ecx
mov    %eax,%esi
shl    $0x5,%esi
shr    $0x2,%eax
add    %esi,%eax
add    %ecx,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <JSHash+0x10>
and    $0x7fffffff,%eax
ret
mov    $0x4e67c6a7,%eax
ret

LLVM IR (-O0):
define i32 @JSHash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 1315423911, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %5
%12 = load i32, i32* %3
%13 = shl i32 %12, 5
%14 = load i32, i32* %4
%15 = add i32 %13, %14
%16 = load i32, i32* %3
%17 = lshr i32 %16, 2
%18 = add i32 %15, %17
%19 = load i32, i32* %3
%20 = xor i32 %19, %18
store i32 %20, i32* %3
br label %5
21: ; preds = %5
%22 = load i32, i32* %3
%23 = and i32 %22, 2147483647
ret i32 %23
}

LLVM IR (-O2):
define i32 @JSHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %14, %4 ], [ 1315423911, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = shl i32 %7, 5
%11 = lshr i32 %7, 2
%12 = add i32 %11, %10
%13 = add i32 %12, %8
%14 = xor i32 %13, %7
%15 = load i8, i8* %9
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = and i32 %14, 2147483647
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ 1315423911, %1 ], [ %18, %17 ]
ret i32 %20
}
/* Variables and functions */
int *malloc(int);
int main(void) {
  int *p = malloc(sizeof(int));
  *(long *)p = 42;
  return *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x2a,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    $0x2a,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = bitcast i32* %4 to i64*
store i64 42, i64* %5
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
ret i32 42
}
void sws_isSupportedEndiannessConversion() {}


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

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

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

LLVM IR (-O2):
define void @sws_isSupportedEndiannessConversion() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemon(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int success_handler() {
  printf("You are now ONLINE.\n");
  daemon(0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<success_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <daemon@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<success_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <daemon@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"You are now ONLINE.\0A\00"
define i32 @success_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @daemon(i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"You are now ONLINE.\00"
define i32 @success_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @daemon(i32 0, i32 0)
ret i32 0
}
void outw(unsigned short value, int port) {
  asm volatile("outw %w0, %w1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%edx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

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

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i32 %1) {
tail call void asm sideeffect "outw ${0:w}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430UsartShareP__1__RawInterrupts__txDone();
void HplMsp430Usart0P__Interrupts__txDone(void) {
  Msp430UsartShareP__1__RawInterrupts__txDone();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430Usart0P__Interrupts__txDone() {
%1 = tail call i32 (...) @Msp430UsartShareP__1__RawInterrupts__txDone()
ret void
}