xunge/DecIR huggingface dataset:
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
char *get_addrname(struct sockaddr *);
int /*<<< orphan*/ logi(char *, char *, char *);
void print_request(char *questions, struct sockaddr *from_addr) {
  logi("request %s from %s\n", questions,
       from_addr ? get_addrname(from_addr) : "");
}


x86 assembly (clang, -O0):
<print_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <print_request+0x35>
mov    -0x10(%rbp),%rdi
call   1030 <get_addrname@plt>
mov    %rax,-0x20(%rbp)
jmp    1165 <print_request+0x45>
lea    0xeb7(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1165 <print_request+0x45>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe8c(%rip),%rdi
call   1040 <logi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_request>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     1136 <print_request+0x16>
mov    %rsi,%rdi
call   1030 <get_addrname@plt>
mov    %rax,%rdx
jmp    113d <print_request+0x1d>
lea    0xed6(%rip),%rdx
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <logi@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [20 x i8] c"request %s from %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @print_request(i8* %0, %struct.sockaddr* %1) {
%3 = alloca i8*
%4 = alloca %struct.sockaddr*
store i8* %0, i8** %3
store %struct.sockaddr* %1, %struct.sockaddr** %4
%5 = load i8*, i8** %3
%6 = load %struct.sockaddr*, %struct.sockaddr** %4
%7 = icmp ne %struct.sockaddr* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load %struct.sockaddr*, %struct.sockaddr** %4
%10 = call i8* @get_addrname(%struct.sockaddr* %9)
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %8
%13 = phi i8* [ %10, %8 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %11 ]
%14 = call i32 @logi(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [20 x i8] c"request %s from %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @print_request(i8* %0, %struct.sockaddr* %1) {
%3 = icmp eq %struct.sockaddr* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @get_addrname(%struct.sockaddr* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %2 ]
%8 = tail call i32 @logi(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
ret void
}
int get_blue(unsigned int p) { return p & 0x0000FF; }


x86 assembly (clang, -O0):
<get_blue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_blue>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @get_blue(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
void gtk_text_iter_backward_cursor_positions() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_backward_cursor_positions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void kwadrat(int linia) {
  if (linia == 0 || linia == 5) {
    printf("*****\n");
  } else {
    printf("*   *\n");
  }
}


x86 assembly (clang, -O0):
<kwadrat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <kwadrat+0x1f>
cmpl   $0x5,-0x4(%rbp)
jne    1140 <kwadrat+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    114c <kwadrat+0x3c>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kwadrat>:
test   %edi,%edi
lea    0xeed(%rip),%rcx
lea    0xee0(%rip),%rax
cmove  %rcx,%rax
cmp    $0x5,%edi
cmove  %rcx,%rax
mov    %rax,%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"* *\00"
@str.2 = [6 x i8] c"*****\00"
define void @kwadrat(i32 %0) {
%2 = icmp eq i32 %0, 5
%3 = icmp eq i32 %0, 0
%4 = or i1 %2, %3
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned int population(int);
unsigned int nlz(uint32_t x) {
  x |= (x >> 1);
  x |= (x >> 2);
  x |= (x >> 4);
  x |= (x >> 8);
  x |= (x >> 16);
  return population(~x);
}


x86 assembly (clang, -O0):
<nlz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    $0xffffffff,%edi
call   1030 <population@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlz>:
mov    %edi,%eax
sar    %eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x2,%eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x4,%eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x8,%eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x10,%eax
or     %eax,%edi
not    %edi
jmp    1030 <population@plt>

LLVM IR (-O0):
define i32 @nlz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 16
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = xor i32 %23, -1
%25 = call i32 @population(i32 %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @nlz(i32 %0) {
%2 = ashr i32 %0, 1
%3 = or i32 %2, %0
%4 = ashr i32 %3, 2
%5 = or i32 %4, %3
%6 = ashr i32 %5, 4
%7 = or i32 %6, %5
%8 = ashr i32 %7, 8
%9 = or i32 %8, %7
%10 = ashr i32 %9, 16
%11 = or i32 %10, %9
%12 = xor i32 %11, -1
%13 = tail call i32 @population(i32 %12)
ret i32 %13
}
int BIT(int u, int m, int op) { return op ? u | m : u & ~m; }


x86 assembly (clang, -O0):
<BIT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1125 <BIT+0x25>
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <BIT+0x33>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIT>:
mov    %esi,%eax
or     %edi,%eax
not    %esi
and    %edi,%esi
test   %edx,%edx
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @BIT(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = or i32 %10, %11
br label %18
13: ; preds = %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = xor i32 %15, -1
%17 = and i32 %14, %16
br label %18
18: ; preds = %13, %9
%19 = phi i32 [ %12, %9 ], [ %17, %13 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @BIT(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = or i32 %1, %0
%6 = xor i32 %1, -1
%7 = and i32 %6, %0
%8 = select i1 %4, i32 %7, i32 %5
ret i32 %8
}
/* Variables and functions */
double log(double);
double pow(double, double);
double rq_rate_compounding_to_continuous(double r, double days,
                                         double days_in_comp_period) {
  double af = pow(1.0 + r, days / days_in_comp_period);
  return log(af) / (days / 365.0);
}


x86 assembly (clang, -O0):
<rq_rate_compounding_to_continuous>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xec9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <log@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe91(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_rate_compounding_to_continuous>:
push   %rax
movsd  %xmm1,(%rsp)
addsd  0xed2(%rip),%xmm0
divsd  %xmm2,%xmm1
call   1040 <pow@plt>
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rq_rate_compounding_to_continuous(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = fadd double 1.000000e+00, %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fdiv double %10, %11
%13 = call double @pow(double %9, double %12)
store double %13, double* %7
%14 = load double, double* %7
%15 = call double @log(double %14)
%16 = load double, double* %5
%17 = fdiv double %16, 3.650000e+02
%18 = fdiv double %15, %17
ret double %18
}

LLVM IR (-O2):
define double @rq_rate_compounding_to_continuous(double %0, double %1, double %2) {
%4 = fadd double %0, 1.000000e+00
%5 = fdiv double %1, %2
%6 = tail call double @pow(double %4, double %5)
%7 = tail call double @log(double %6)
%8 = fdiv double %1, 3.650000e+02
%9 = fdiv double %7, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 100;
  int *p = NULL;
  printf("Value of x: %d\n", x);
  p = &x;
  printf("Value of *p: %d\n", *p);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Value of x: %d\0A\00"
@.str.1 = [17 x i8] c"Value of *p: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
double rangelimit(double, int, int);
double cumulative_cubed_parabola(double x) {
  double x2;
  x = rangelimit(x, -1., 1.);
  x2 = x * x;
  return (((-0.3125 * x2 + 1.3125) * x2 - 2.1875) * x2 + 2.1875) * x;
}


x86 assembly (clang, -O0):
<cumulative_cubed_parabola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <rangelimit@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe78(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cumulative_cubed_parabola>:
push   %rax
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <rangelimit@plt>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xed0(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xecc(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xec8(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cumulative_cubed_parabola(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @rangelimit(double %4, i32 -1, i32 1)
store double %5, double* %2
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double -3.125000e-01, double %9, double 1.312500e+00)
%11 = load double, double* %3
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double -2.187500e+00)
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double 2.187500e+00)
%15 = load double, double* %2
%16 = fmul double %14, %15
ret double %16
}

LLVM IR (-O2):
define double @cumulative_cubed_parabola(double %0) {
%2 = tail call double @rangelimit(double %0, i32 -1, i32 1)
%3 = fmul double %2, %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double -3.125000e-01, double 1.312500e+00)
%5 = tail call double @llvm.fmuladd.f64(double %4, double %3, double -2.187500e+00)
%6 = tail call double @llvm.fmuladd.f64(double %5, double %3, double 2.187500e+00)
%7 = fmul double %2, %6
ret double %7
}
void fadeout(unsigned char *light, unsigned char incr, unsigned char ending) {
  if ((*light - incr) <= ending)
    *light = ending;
  else
    (*light) -= incr;
}


x86 assembly (clang, -O0):
<fadeout>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
sub    %ecx,%eax
movzbl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jg     113a <fadeout+0x3a>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1149 <fadeout+0x49>
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
sub    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fadeout>:
movzbl (%rdi),%eax
sub    %esi,%eax
cmp    %edx,%eax
cmovle %edx,%eax
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @fadeout(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = zext i8 %4 to i32
%6 = zext i8 %1 to i32
%7 = sub nsw i32 %5, %6
%8 = zext i8 %2 to i32
%9 = icmp sgt i32 %7, %8
%10 = trunc i32 %7 to i8
%11 = select i1 %9, i8 %10, i8 %2
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage \n");
  printf("p5 number \n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Usage \0A\00"
@.str.1 = [12 x i8] c"p5 number \0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage \00"
@str.2 = [11 x i8] c"p5 number \00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int tc_core_time2tick(int);
unsigned tc_calc_xmittime(unsigned rate, unsigned size) {
  return tc_core_time2tick(1000000000 * ((double)size / rate));
}


x86 assembly (clang, -O0):
<tc_calc_xmittime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm1
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
divsd  %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <tc_core_time2tick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tc_calc_xmittime>:
mov    %esi,%eax
cvtsi2sd %rax,%xmm0
mov    %edi,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xed6(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <tc_core_time2tick@plt>

LLVM IR (-O0):
define i32 @tc_calc_xmittime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = uitofp i32 %5 to double
%7 = load i32, i32* %3
%8 = uitofp i32 %7 to double
%9 = fdiv double %6, %8
%10 = fmul double 1.000000e+09, %9
%11 = fptosi double %10 to i32
%12 = call i32 @tc_core_time2tick(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @tc_calc_xmittime(i32 %0, i32 %1) {
%3 = uitofp i32 %1 to double
%4 = uitofp i32 %0 to double
%5 = fdiv double %3, %4
%6 = fmul double %5, 1.000000e+09
%7 = fptosi double %6 to i32
%8 = tail call i32 @tc_core_time2tick(i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fillstructure();
int /*<<< orphan*/ printstructure();
int main() {
  fillstructure();
  printstructure();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fillstructure@plt>
mov    $0x0,%al
call   1030 <printstructure@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fillstructure@plt>
xor    %eax,%eax
call   1030 <printstructure@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fillstructure()
%3 = call i32 (...) @printstructure()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fillstructure()
%2 = tail call i32 (...) @printstructure()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int do_posix_spawn(int /*<<< orphan*/ *, char const *,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                   char *const *, char *const *, int);
int posix_spawnp(pid_t *pid, const char *path,
                 const posix_spawn_file_actions_t *fa,
                 const posix_spawnattr_t *sa, char *const argv[],
                 char *const envp[]) {
  return do_posix_spawn(pid, path, fa, sa, argv, envp, 1);
}


x86 assembly (clang, -O0):
<posix_spawnp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
movl   $0x1,(%rsp)
call   1030 <do_posix_spawn@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnp>:
push   %rax
movl   $0x1,(%rsp)
call   1030 <do_posix_spawn@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @posix_spawnp(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = tail call i32 @do_posix_spawn(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5, i32 1)
ret i32 %7
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ printf(char *, int);
int shmget(int, int /*<<< orphan*/, int /*<<< orphan*/);
int delete_shared_memory(int key) {
  errno = 0;
  int shmid = shmget(key, 0, 0);
  if (shmid < 0) {
    printf("shared memory of key [0x%x] not exists\n", key);
    return -1;
  }
}


x86 assembly (clang, -O0):
<delete_shared_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eae(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <shmget@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1168 <delete_shared_memory+0x48>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_shared_memory>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
movq   $0x0,(%rax)
xor    %esi,%esi
xor    %edx,%edx
call   1040 <shmget@plt>
test   %eax,%eax
jns    114c <delete_shared_memory+0x2c>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [40 x i8] c"shared memory of key [0x%x] not exists\0A\00"
define i32 @delete_shared_memory(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i64 0, i64* @errno
%5 = load i32, i32* %3
%6 = call i32 @shmget(i32 %5, i32 0, i32 0)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %10)
store i32 -1, i32* %2
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [40 x i8] c"shared memory of key [0x%x] not exists\0A\00"
define i32 @delete_shared_memory(i32 %0) {
store i64 0, i64* @errno
%2 = tail call i32 @shmget(i32 %0, i32 0, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %4
ret i32 -1
}
int test_imm_3Cint64_highword_reg(long long val) {
  return ((val >> 32) & (0x3C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Cint64_highword_reg>:
movabs $0x3c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Cint64_highword_reg(i64 %0) {
%2 = and i64 %0, 257698037760
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int func_a(int);
int func_b(int);
int main() {
  int a;
  a = func_a(1);
  a = a + func_b(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <func_a@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <func_b@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <func_a@plt>
mov    %eax,%edi
call   1030 <func_b@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @func_a(i32 1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @func_b(i32 %5)
%7 = add nsw i32 %4, %6
store i32 %7, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func_a(i32 1)
%2 = tail call i32 @func_b(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int get_endsw() {
  printf("get_endsw\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"get_endsw\0A\00"
define i32 @get_endsw() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"get_endsw\00"
define i32 @get_endsw() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f15(long j) {
  if ((j & ((1UL << (15)) - 1)) >= ((1UL << ((15) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7fff,%rax
cmp    $0x4002,%rax
jb     1139 <f15+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f15>:
and    $0x7ffe,%edi
cmp    $0x4002,%edi
jae    111f <f15+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f15(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 32767
%5 = icmp uge i64 %4, 16386
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f15(i64 %0) {
%2 = and i64 %0, 32766
%3 = icmp ugt i64 %2, 16385
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ removerSpacos(char *);
int main() {
  char frase[] = "Ola Mundo!";
  removerSpacos(frase);
  printf("%s", frase);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xf(%rbp),%rdi
call   1030 <removerSpacos@plt>
lea    -0xf(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x646e754d20616c4f,%rax
75 6e 64
mov    %rax,(%rsp)
movl   $0x216f64,0x7(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <removerSpacos@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.frase = [11 x i8] c"Ola Mundo!\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 0, i32* %1
%3 = bitcast [11 x i8]* %2 to i8*
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = call i32 @removerSpacos(i8* %4)
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.frase = [11 x i8] c"Ola Mundo!\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i32 @removerSpacos(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  fprintf(stderr, "thank you for testing the client interface\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"thank you for testing the client interface\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"thank you for testing the client interface\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_imm_13uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x13 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_13uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 19
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
long strtol(char const *, char **, int);
int parse_uint(const char *str, int *i) {
  int retval = 0;
  char *endptr;
  long val = strtol(str, &endptr, 10);
  if (*str != '\0' && (*endptr) == '\0') {
    *i = (int)val;
    retval = 1;
  }
  return retval;
}


x86 assembly (clang, -O0):
<parse_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1170 <parse_uint+0x60>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1170 <parse_uint+0x60>
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_uint>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmpb   $0x0,(%rbx)
je     1142 <parse_uint+0x32>
mov    (%rsp),%rdx
cmpb   $0x0,(%rdx)
jne    1142 <parse_uint+0x32>
mov    %ecx,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @parse_uint(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtol(i8* %0, i8** %3, i32 10)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = trunc i64 %5 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %12, %8, %2
%15 = phi i32 [ 1, %12 ], [ 0, %8 ], [ 0, %2 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ dump_data(float *, int);
int main(int argc, char *argv[]) {
  float d = 5.0f;
  dump_data(&d, sizeof(d));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1030 <dump_data@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x40a00000,0x4(%rsp)
40
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <dump_data@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 5.000000e+00, float* %6
%7 = call i32 @dump_data(float* %6, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
store float 5.000000e+00, float* %3
%5 = call i32 @dump_data(float* %3, i32 4)
ret i32 0
}
int divis(int *a, int b) {
  if (*a < b) {
    *a ^= b;
    b ^= *a;
    *a ^= b;
  }
  if (!(*a % b)) {
    return (*a /= b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<divis>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jge    113c <divis+0x3c>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    1165 <divis+0x65>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
cltd
idiv   %esi
mov    %eax,(%rcx)
mov    %eax,-0x4(%rbp)
jmp    116c <divis+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divis>:
mov    (%rdi),%r9d
cmp    %esi,%r9d
mov    %r9d,%r10d
cmovl  %esi,%r10d
mov    %esi,%ecx
cmovl  %r9d,%ecx
mov    %r10d,%eax
cltd
idiv   %ecx
mov    %eax,%r8d
xor    %eax,%eax
test   %edx,%edx
cmove  %r8d,%r10d
cmove  %r8d,%eax
cmp    %esi,%r9d
jl     1132 <divis+0x32>
test   %edx,%edx
je     1132 <divis+0x32>
ret
mov    %r10d,(%rdi)
ret

LLVM IR (-O0):
define i32 @divis(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = xor i32 %13, %11
store i32 %14, i32* %12
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i32, i32* %5
%18 = xor i32 %17, %16
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = load i32*, i32** %4
%21 = load i32, i32* %20
%22 = xor i32 %21, %19
store i32 %22, i32* %20
br label %23
23: ; preds = %10, %2
%24 = load i32*, i32** %4
%25 = load i32, i32* %24
%26 = load i32, i32* %5
%27 = srem i32 %25, %26
%28 = icmp ne i32 %27, 0
br i1 %28, label %34, label %29
29: ; preds = %23
%30 = load i32, i32* %5
%31 = load i32*, i32** %4
%32 = load i32, i32* %31
%33 = sdiv i32 %32, %30
store i32 %33, i32* %31
store i32 %33, i32* %3
br label %35
34: ; preds = %23
store i32 0, i32* %3
br label %35
35: ; preds = %34, %29
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @divis(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp slt i32 %3, %1
%5 = select i1 %4, i32 %1, i32 %3
%6 = select i1 %4, i32 %3, i32 %1
%7 = srem i32 %5, %6
%8 = sdiv i32 %5, %6
%9 = icmp eq i32 %7, 0
%10 = select i1 %9, i32 %8, i32 %5
%11 = select i1 %9, i32 %8, i32 0
%12 = xor i1 %4, true
%13 = xor i1 %9, true
%14 = xor i1 %12, true
%15 = xor i1 %13, true
%16 = or i1 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 %10, i32* %0
br label %18
18: ; preds = %2, %17
ret i32 %11
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzSlice_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int /*<<< orphan*/, int /*<<< orphan*/);
void BrzSlice_ackdown(struct comp *comp, int port) {
  struct BrzSlice_ *c = (struct BrzSlice_ *)comp;
  SEND_ACKDOWN_DELAYED(0, 0);
}


x86 assembly (clang, -O0):
<BrzSlice_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzSlice_ackdown>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <SEND_ACKDOWN_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzSlice_ = type { i32 }
define void @BrzSlice_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzSlice_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzSlice_*
store %struct.BrzSlice_* %7, %struct.BrzSlice_** %5
%8 = call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzSlice_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char *, unsigned char *);
void callback(unsigned char *key, unsigned char *data, void *userdata) {
  printf("find %s => %s\n", key, data);
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"find %s => %s\0A\00"
define void @callback(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int test_imm_67int8_reg(signed char val) {
  return ((val) & (0x67 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_67int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x67,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_67int8_reg(i8 signext %0) {
%2 = and i8 %0, 103
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ streamDefByteorder(int, int);
int /*<<< orphan*/ streamDefCompLevel(int, int);
int /*<<< orphan*/ streamDefCompType(int, int);
int /*<<< orphan*/ streamDefVlist(int, int);
void defineStream(int streamID, int vlistID) {
  streamDefByteorder(streamID, 1);
  streamDefCompType(streamID, 2);
  streamDefCompLevel(streamID, 3);
  streamDefVlist(streamID, vlistID);
}


x86 assembly (clang, -O0):
<defineStream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <streamDefByteorder@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1060 <streamDefCompType@plt>
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1030 <streamDefCompLevel@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <streamDefVlist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defineStream>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%esi
call   1050 <streamDefByteorder@plt>
mov    %ebp,%edi
mov    $0x2,%esi
call   1060 <streamDefCompType@plt>
mov    %ebp,%edi
mov    $0x3,%esi
call   1030 <streamDefCompLevel@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <streamDefVlist@plt>

LLVM IR (-O0):
define void @defineStream(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @streamDefByteorder(i32 %5, i32 1)
%7 = load i32, i32* %3
%8 = call i32 @streamDefCompType(i32 %7, i32 2)
%9 = load i32, i32* %3
%10 = call i32 @streamDefCompLevel(i32 %9, i32 3)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @streamDefVlist(i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @defineStream(i32 %0, i32 %1) {
%3 = tail call i32 @streamDefByteorder(i32 %0, i32 1)
%4 = tail call i32 @streamDefCompType(i32 %0, i32 2)
%5 = tail call i32 @streamDefCompLevel(i32 %0, i32 3)
%6 = tail call i32 @streamDefVlist(i32 %0, i32 %1)
ret void
}
int __attribute__((unused)) strcmp(const char *s1, const char *s2) {
  while (*s1 && (*s1 == *s2)) {
    ++s1;
    ++s2;
  }
  return (unsigned char)*s1 - (unsigned char)*s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}