xunge/DecIR huggingface dataset:
void strip_char(char *str, char strip) {
  char *p, *q;
  for (q = p = str; *p; p++)
    if (*p != strip)
      *q++ = *p;
  *q = '\0';
}


x86 assembly (clang, -O0):
<strip_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1167 <strip_char+0x67>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     1151 <strip_char+0x51>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1156 <strip_char+0x56>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <strip_char+0x1a>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <strip_char+0x28>
lea    0x1(%rdi),%rax
jmp    111b <strip_char+0x1b>
nopl   0x0(%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1128 <strip_char+0x28>
cmp    %sil,%cl
je     1110 <strip_char+0x10>
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1110 <strip_char+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @strip_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %15, %12 ], [ %3, %2 ]
%7 = phi i8* [ %13, %12 ], [ %0, %2 ]
%8 = phi i8* [ %14, %12 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
br label %12
12: ; preds = %5, %10
%13 = phi i8* [ %11, %10 ], [ %7, %5 ]
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ]
store i8 0, i8* %18
ret void
}
float lerp(float s, float e, float t) { return s + (e - s) * t; }


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %4
%10 = fsub float %8, %9
%11 = load float, float* %6
%12 = call float @llvm.fmuladd.f32(float %10, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %4, float %2, float %0)
ret float %5
}
void RTCrc64(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCrc64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_channel_watch_connectivity_state() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_channel_watch_connectivity_state>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_channel_watch_connectivity_state>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_watch_connectivity_state() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_watch_connectivity_state() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void gtk_toolbar_child_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_child_type_get_type() {
ret void
}
double geoRads2DD(double rads) {
  return (rads * (180.0 / 3.14159265358979323846));
}


x86 assembly (clang, -O0):
<geoRads2DD>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoRads2DD>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @geoRads2DD(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x404CA5DC1A63C1F8
ret double %4
}

LLVM IR (-O2):
define double @geoRads2DD(double %0) {
%2 = fmul double %0, 0x404CA5DC1A63C1F8
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_str(char **arr, int size) {
  for (int i = 0; i < size; i++)
    printf("%s\n", arr[i]);
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <print_str+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_str+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_str+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_str+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_str(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  foo(0x10224);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 66084)
ret i32 0
}
void swap_bytes(unsigned char *a, unsigned char *b) {
  unsigned char t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<swap_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bytes>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap_bytes(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap_bytes(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
int abx540_get_modem_power(void) { return 0; }


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

x86 assembly (clang, -O2):
<abx540_get_modem_power>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @abx540_get_modem_power() {
ret i32 0
}

LLVM IR (-O2):
define i32 @abx540_get_modem_power() {
ret i32 0
}
__attribute__((weak)) void EFC0_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @EFC0_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int *malloc(int);
int main() {
  volatile int *arr = malloc(10 * sizeof(int));
  arr[5] = 12;
  arr[4] = 43;
  return arr[5] + arr[4];
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1030 <malloc@plt>
movl   $0xc,0x14(%rax)
movl   $0x2b,0x10(%rax)
mov    0x14(%rax),%ecx
add    0x10(%rax),%ecx
mov    %ecx,%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 40)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 5
store volatile i32 12, i32* %5
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 4
store volatile i32 43, i32* %7
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 5
%10 = load volatile i32, i32* %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = load volatile i32, i32* %12
%14 = add nsw i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = getelementptr inbounds i32, i32* %1, i64 5
store volatile i32 12, i32* %2
%3 = getelementptr inbounds i32, i32* %1, i64 4
store volatile i32 43, i32* %3
%4 = load volatile i32, i32* %2
%5 = load volatile i32, i32* %3
%6 = add nsw i32 %5, %4
ret i32 %6
}
void ble_evt_attclient_read_multiple_response(
    const struct ble_msg_attclient_read_multiple_response_evt_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_attclient_read_multiple_response_evt_t = type opaque
define void @ble_evt_attclient_read_multiple_response(%struct.ble_msg_attclient_read_multiple_response_evt_t* %0) {
%2 = alloca %struct.ble_msg_attclient_read_multiple_response_evt_t*
store %struct.ble_msg_attclient_read_multiple_response_evt_t* %0, %struct.ble_msg_attclient_read_multiple_response_evt_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_attclient_read_multiple_response_evt_t = type opaque
define void @ble_evt_attclient_read_multiple_response(%struct.ble_msg_attclient_read_multiple_response_evt_t* nocapture %0) {
ret void
}
void SPI_RP_DisableRxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_RP_DisableRxInt() {
ret void
}
/* Variables and functions */
double sqrt(double);
double norm(double a, double b, double c) {
  return (sqrt(a * a + b * b + c * c));
}


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1136 <norm+0x26>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
ret
movapd %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @norm(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %6
%14 = load double, double* %6
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double %12)
%16 = call double @sqrt(double %15)
ret double %16
}

LLVM IR (-O2):
define double @norm(double %0, double %1, double %2) {
%4 = fmul double %1, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = tail call double @sqrt(double %6)
ret double %7
}
/* Variables and functions */
int evaluatePostfixExpression(char *);
int /*<<< orphan*/ getLine(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char postfix[50];
  int result;
  printf("Please enter postfix expression: ");
  getLine(postfix, 50);
  result = evaluatePostfixExpression(postfix);
  printf("Result: %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x32,%esi
call   1050 <getLine@plt>
lea    -0x40(%rbp),%rdi
call   1030 <evaluatePostfixExpression@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1050 <getLine@plt>
mov    %rbx,%rdi
call   1030 <evaluatePostfixExpression@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Please enter postfix expression: \00"
@.str.1 = [12 x i8] c"Result: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = call i32 @getLine(i8* %5, i32 50)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%8 = call i32 @evaluatePostfixExpression(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Please enter postfix expression: \00"
@.str.1 = [12 x i8] c"Result: %d\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @getLine(i8* %2, i32 50)
%5 = call i32 @evaluatePostfixExpression(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
struct posset {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ filebench_log(int /*<<< orphan*/, char *);
int posset_collection_fill(struct posset *ps) {
  filebench_log(0, "posset_alloc: possets of type "
                   "\"collection\" are not supported at the moment");
  return -1;
}


x86 assembly (clang, -O0):
<posset_collection_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
lea    0xedb(%rip),%rsi
call   1030 <filebench_log@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posset_collection_fill>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <filebench_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.posset = type { i32 }
@.str = [75 x i8] c"posset_alloc: possets of type \22collection\22 are not supported at the moment\00"
define i32 @posset_collection_fill(%struct.posset* %0) {
%2 = alloca %struct.posset*
store %struct.posset* %0, %struct.posset** %2
%3 = call i32 @filebench_log(i32 0, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.posset = type { i32 }
@.str = [75 x i8] c"posset_alloc: possets of type \22collection\22 are not supported at the moment\00"
define i32 @posset_collection_fill(%struct.posset* nocapture readnone %0) {
%2 = tail call i32 @filebench_log(i32 0, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *myname) {
  fprintf(stderr,
          "Usage: %s [ -sawm ] [ -S xxx ] PID\n"
          "  -s      - wait for fault signal before generating a dump\n"
          "  -a      - skip non-anonymous maps (libraries etc)\n"
          "  -w      - write index file to stdout instead of mfetch.lst\n"
          "  -m      - avoid mmap(), helps prevent hanging on some 2.2 boxes\n"
          "  -S xxx  - dump segment containing address xxx (hex) only\n",
          myname);
  exit(3);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [333 x i8] c"Usage: %s [ -sawm ] [ -S xxx ] PID\0A -s - wait for fault signal before generating a dump\0A -a - skip non-anonymous maps (libraries etc)\0A -w - write index file to stdout instead of mfetch.lst\0A -m - avoid mmap(), helps prevent hanging on some 2.2 boxes\0A -S xxx - dump segment containing address xxx (hex) only\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [333 x i8] c"Usage: %s [ -sawm ] [ -S xxx ] PID\0A -s - wait for fault signal before generating a dump\0A -a - skip non-anonymous maps (libraries etc)\0A -w - write index file to stdout instead of mfetch.lst\0A -m - avoid mmap(), helps prevent hanging on some 2.2 boxes\0A -S xxx - dump segment containing address xxx (hex) only\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 3)
unreachable
}
void touch_int(int *x) {}


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

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

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

LLVM IR (-O2):
define void @touch_int(i32* nocapture %0) {
ret void
}
void ftrace_generate_call_insn(struct ftrace_insn *insn, unsigned long ip) {}


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

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

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

LLVM IR (-O2):
%struct.ftrace_insn = type opaque
define void @ftrace_generate_call_insn(%struct.ftrace_insn* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("memwrexe options\n");
  printf("where options is:\n");
  printf("\tmmap - mmap test\n");
  printf("\tmprotect - mprotect test\n");
  printf("\tmemfd_create - memfd_create test\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"memwrexe options\0A\00"
@.str.1 = [19 x i8] c"where options is:\0A\00"
@.str.2 = [19 x i8] c"\09mmap - mmap test\0A\00"
@.str.3 = [27 x i8] c"\09mprotect - mprotect test\0A\00"
@.str.4 = [35 x i8] c"\09memfd_create - memfd_create test\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"memwrexe options\00"
@str.5 = [18 x i8] c"where options is:\00"
@str.6 = [18 x i8] c"\09mmap - mmap test\00"
@str.7 = [26 x i8] c"\09mprotect - mprotect test\00"
@str.8 = [34 x i8] c"\09memfd_create - memfd_create test\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.8, i64 0, i64 0))
ret void
}
void rop3_96_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_96_1_0>:
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
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_96_1_0>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_96_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cli();
int /*<<< orphan*/ restore_flags(unsigned long);
int /*<<< orphan*/ save_flags(unsigned long);
void cli_iis(void) {
  unsigned long flags;
  save_flags(flags);
  cli();
  restore_flags(flags);
}


x86 assembly (clang, -O0):
<cli_iis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1040 <save_flags@plt>
mov    $0x0,%al
call   1050 <cli@plt>
mov    -0x8(%rbp),%rdi
call   1030 <restore_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_iis>:
push   %rax
call   1040 <save_flags@plt>
xor    %eax,%eax
call   1050 <cli@plt>
pop    %rax
jmp    1030 <restore_flags@plt>

LLVM IR (-O0):
define void @cli_iis() {
%1 = alloca i64
%2 = load i64, i64* %1
%3 = call i32 @save_flags(i64 %2)
%4 = call i32 (...) @cli()
%5 = load i64, i64* %1
%6 = call i32 @restore_flags(i64 %5)
ret void
}

LLVM IR (-O2):
define void @cli_iis() {
%1 = tail call i32 @save_flags(i64 undef)
%2 = tail call i32 (...) @cli()
%3 = tail call i32 @restore_flags(i64 undef)
ret void
}
int ti_adxr_start(double const *options) { return ((int)options[0] - 1) * 3; }


x86 assembly (clang, -O0):
<ti_adxr_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
imul   $0x3,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_adxr_start>:
cvttsd2si (%rdi),%eax
lea    (%rax,%rax,2),%eax
add    $0xfffffffd,%eax
ret

LLVM IR (-O0):
define i32 @ti_adxr_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
%8 = mul nsw i32 %7, 3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ti_adxr_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = mul i32 %3, 3
%5 = add i32 %4, -3
ret i32 %5
}
void YUY2ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToARGB() {
ret void
}
void gtk_font_selection_set_font_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_selection_set_font_name() {
ret void
}
void sigunblock(int s) {}


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

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

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

LLVM IR (-O2):
define void @sigunblock(i32 %0) {
ret void
}
signed int sign_extend_13bit(signed int x) {
  signed int r = 0;
  struct {
    signed int x : 13;
  } s;
  r = s.x = x;
  return r;
}


x86 assembly (clang, -O0):
<sign_extend_13bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%cx
and    $0x1fff,%ax
and    $0xe000,%cx
or     %ax,%cx
mov    %cx,-0x10(%rbp)
shl    $0x3,%ax
sar    $0x3,%ax
cwtl
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_extend_13bit>:
mov    %edi,%eax
shl    $0x13,%eax
sar    $0x13,%eax
ret

LLVM IR (-O0):
%struct.anon = type { i16, [2 x i8] }
define i32 @sign_extend_13bit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.anon
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = bitcast %struct.anon* %4 to i16*
%7 = trunc i32 %5 to i16
%8 = load i16, i16* %6
%9 = and i16 %7, 8191
%10 = and i16 %8, -8192
%11 = or i16 %10, %9
store i16 %11, i16* %6
%12 = shl i16 %9, 3
%13 = ashr i16 %12, 3
%14 = sext i16 %13 to i32
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @sign_extend_13bit(i32 %0) {
%2 = shl i32 %0, 19
%3 = ashr exact i32 %2, 19
ret i32 %3
}
__attribute__((vector_size(16))) float
f2(__attribute__((vector_size(16))) float a1) {
  return (a1);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define <4 x float> @f2(<4 x float> %0) {
%2 = alloca <4 x float>
store <4 x float> %0, <4 x float>* %2
%3 = load <4 x float>, <4 x float>* %2
ret <4 x float> %3
}

LLVM IR (-O2):
define <4 x float> @f2(<4 x float> returned %0) {
ret <4 x float> %0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
scalar_t__ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int my_send(int socket, char *message) {
  if (send(socket, message, strlen(message), 0) < 0) {
    puts("failure");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
cmp    $0x0,%rax
jge    1188 <my_send+0x58>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118f <my_send+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_send>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
xor    %r14d,%r14d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
test   %rax,%rax
jns    1169 <my_send+0x39>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"failure\00"
define i32 @my_send(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
%10 = call i64 @send(i32 %6, i8* %7, i32 %9, i32 0)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"failure\00"
define i32 @my_send(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testNotEqualTo() { printf("%d != %d = %d\n", 10, 4, 10 != 4); }


x86 assembly (clang, -O0):
<testNotEqualTo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testNotEqualTo>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d != %d = %d\0A\00"
define void @testNotEqualTo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d != %d = %d\0A\00"
define void @testNotEqualTo() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
ret void
}
/* Variables and functions */
double M_PI;
double deg_of_rad(double r) { return ((r * 180.) / M_PI); }


x86 assembly (clang, -O0):
<deg_of_rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_of_rad>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @deg_of_rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @deg_of_rad(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void raise() { exit(33); }


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<raise>:
push   %rax
mov    $0x21,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @raise() {
%1 = call i32 @exit(i32 33)
unreachable
}

LLVM IR (-O2):
define void @raise() {
%1 = tail call i32 @exit(i32 33)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
unsigned char CheckId_NOON30PC11(void) {
  unsigned char temp;
  VIM_SIF_I2cReadByte(0x28, &temp);
  if (temp == 0x11)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CheckId_NOON30PC11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x28,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x11,%eax
jne    113c <CheckId_NOON30PC11+0x2c>
movb   $0x1,-0x1(%rbp)
jmp    1140 <CheckId_NOON30PC11+0x30>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckId_NOON30PC11>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x28,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
cmpb   $0x11,0x7(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CheckId_NOON30PC11() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 40, i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 17
br i1 %6, label %7, label %8
7: ; preds = %0
store i8 1, i8* %1
br label %9
8: ; preds = %0
store i8 0, i8* %1
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %1
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @CheckId_NOON30PC11() {
%1 = alloca i8
%2 = call i32 @VIM_SIF_I2cReadByte(i32 40, i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 17
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main() {
  int a = 1;
  int b = sizeof a++;
  char *c;
  printf("a %d, b %d, %d %d\n", a, b, sizeof(c), sizeof(*c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
mov    $0x8,%ecx
mov    $0x1,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"a %d, b %d, %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 8, i32 1)
ret i32 0
}
long long GetStackHeight(long long i) { return i; }


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

x86 assembly (clang, -O2):
<GetStackHeight>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @GetStackHeight(i64 returned %0) {
ret i64 %0
}
long long l_min(num1, num2)
long long num1, num2;
{
  if (num1 >= num2)
    return num2;
  else
    return num1;
}


x86 assembly (clang, -O0):
<l_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     1127 <l_min+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <l_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @l_min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp sge i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %5
store i64 %10, i64* %3
br label %13
11: ; preds = %2
%12 = load i64, i64* %4
store i64 %12, i64* %3
br label %13
13: ; preds = %11, %9
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @l_min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int disable_clock(int id, char *name) { return 0; }


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

x86 assembly (clang, -O2):
<disable_clock>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @disable_clock(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ ltr_int_pause_tir();
int ltr_int_tracker_pause() { return ltr_int_pause_tir() ? 0 : -1; }


x86 assembly (clang, -O0):
<ltr_int_tracker_pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ltr_int_pause_tir@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltr_int_tracker_pause>:
push   %rax
xor    %eax,%eax
call   1030 <ltr_int_pause_tir@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ltr_int_tracker_pause() {
%1 = call i64 (...) @ltr_int_pause_tir()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 0, i32 -1
ret i32 %4
}

LLVM IR (-O2):
define i32 @ltr_int_tracker_pause() {
%1 = tail call i64 (...) @ltr_int_pause_tir()
%2 = icmp eq i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
int addDigits(int num) {
  if (num <= 0) {
    return 0;
  }
  int result = num % 9;
  return result == 0 ? 9 : result;
}


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <addDigits+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    114e <addDigits+0x4e>
mov    -0x8(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <addDigits+0x42>
mov    $0x9,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <addDigits+0x48>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
test   %edi,%edi
jle    111f <addDigits+0x1f>
mov    %edi,%eax
imul   $0x38e38e39,%rax,%rax
shr    $0x21,%rax
lea    (%rax,%rax,8),%eax
sub    %eax,%edi
mov    $0x9,%eax
cmovne %edi,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = urem i32 %0, 9
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 9, i32 %4
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int get_char_count() {
  int i = 0;
  char c = 0;
  do {
    scanf("%c", &c);
    if (c == '\n') {
      break;
    }
    i++;
  } while (1);
  return i;
}


x86 assembly (clang, -O0):
<get_char_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1030 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1145 <get_char_count+0x35>
jmp    115d <get_char_count+0x4d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1123 <get_char_count+0x13>
jmp    115d <get_char_count+0x4d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_count>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
mov    $0xffffffff,%ebx
lea    0xed6(%rip),%r14
lea    0xf(%rsp),%r15
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
add    $0x1,%ebx
cmpb   $0xa,0xf(%rsp)
jne    1130 <get_char_count+0x20>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @get_char_count() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 0, %0 ], [ %7, %2 ]
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 10
%7 = add nuw nsw i32 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i32 %3
}